From 0fd23298f07ebdfa044ef8bf2ee4c1463d4aed94 Mon Sep 17 00:00:00 2001 From: d9tilov <9.tilov@gmail.com> Date: Sun, 20 Jul 2025 14:47:24 +0700 Subject: [PATCH 1/7] Started new branch --- app/build.gradle.kts | 24 ++- app/src/main/cpp/libs/fptn | 2 +- .../kotlin/org/fptn/vpn/PvnApplication.kt | 16 ++ .../main/kotlin/org/fptn/vpn/di/AppModule.kt | 26 +++ .../vpn/navigation/TopLevelDestination.kt | 34 ++++ .../kotlin/org/fptn/vpn/ui/MainActivity.kt | 88 +++++++++ .../org/fptn/vpn/viewmodel/MainViewModel.kt | 50 ++++++ app/src/main/res/drawable/ic_splash.xml | 34 ++++ app/src/main/res/values-night/colors.xml | 5 + app/src/main/res/values/color.xml | 4 + app/src/main/res/values/strings.xml | 4 + build.gradle.kts | 1 + buildSrc/build.gradle.kts | 49 +++-- ...droidApplicationComposeConventionPlugin.kt | 19 ++ .../AndroidApplicationConventionPlugin.kt | 35 ++++ .../AndroidApplicationKoinConventionPlugin.kt | 19 ++ .../AndroidLibraryComposeConventionPlugin.kt | 19 ++ .../gradle/AndroidLibraryConventionPlugin.kt | 32 ++++ .../fptn/vpn/gradle/KoinConventionPlugin.kt | 21 +++ .../gradle/KotlinLibraryConventionPlugin.kt | 18 ++ .../vpn/gradle/extensions/AndroidCompose.kt | 76 ++++++++ .../vpn/gradle/extensions/AndroidFirebase.kt | 32 ++++ .../fptn/vpn/gradle/extensions/AndroidKoin.kt | 33 ++++ core/common/build.gradle.kts | 4 +- .../org/fptn/vpn/core/common/AgDispatchers.kt | 7 + .../org/fptn/vpn/core/common/CommonModule.kt | 20 +++ .../org/fptn/vpn/core/common/Constants.kt | 1 + .../kotlin/org/fptn/vpn/core/common/Result.kt | 39 ++++ core/designsystem/.gitignore | 1 + core/designsystem/build.gradle.kts | 18 ++ core/designsystem/proguard-rules.pro | 21 +++ .../vpn/core/designsystem/icons/PvnIcons.kt | 16 ++ .../designsystem/theme/BackgroundTheme.kt | 17 ++ .../fptn/vpn/core/designsystem/theme/Color.kt | 66 +++++++ .../vpn/core/designsystem/theme/PvnTheme.kt | 110 ++++++++++++ .../fptn/vpn/core/designsystem/theme/Type.kt | 118 ++++++++++++ .../res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++++ .../res/drawable/ic_launcher_foreground.xml | 30 ++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 6 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 6 + .../src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1404 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 2898 bytes .../src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 982 bytes .../res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 1772 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 1900 bytes .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 3918 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 2884 bytes .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 5914 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 3844 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 7778 bytes .../src/main/res/values-night/themes.xml | 16 ++ .../src/main/res/values/colors.xml | 10 ++ .../src/main/res/values/dimens.xml | 8 + .../src/main/res/values/strings.xml | 3 + .../src/main/res/values/themes.xml | 16 ++ core/model/.gitignore | 1 + core/model/build.gradle.kts | 6 + core/model/proguard-rules.pro | 21 +++ .../org/fptn/vpn/core/model/UserData.kt | 5 + core/network/.gitignore | 1 + core/network/build.gradle.kts | 14 ++ core/network/proguard-rules.pro | 21 +++ core/network/src/main/AndroidManifest.xml | 3 + .../ConnectivityManagerNetworkMonitor.kt | 76 ++++++++ .../fptn/vpn/core/network/NetworkModule.kt | 8 + .../fptn/vpn/core/network/NetworkMonitor.kt | 7 + core/persistent/.gitignore | 1 + core/persistent/build.gradle.kts | 13 ++ core/persistent/proguard-rules.pro | 21 +++ .../vpn/core/persistent/PreferencesStore.kt | 41 +++++ .../core/persistent/di/PersistentModule.kt | 10 ++ gradle/libs.versions.toml | 39 +++- home/data/.gitignore | 1 + home/data/build.gradle.kts | 10 ++ home/data/proguard-rules.pro | 21 +++ home/domain/.gitignore | 1 + home/domain/build.gradle.kts | 6 + home/domain/proguard-rules.pro | 21 +++ home/ui/.gitignore | 1 + home/ui/build.gradle.kts | 11 ++ home/ui/proguard-rules.pro | 21 +++ .../home/ui/navigation/HomeNavigation.kt | 14 ++ settings.gradle.kts | 13 ++ settings/data/.gitignore | 1 + settings/data/build.gradle.kts | 10 ++ settings/data/proguard-rules.pro | 21 +++ settings/domain/.gitignore | 1 + settings/domain/build.gradle.kts | 6 + settings/domain/proguard-rules.pro | 21 +++ settings/ui/.gitignore | 1 + settings/ui/build.gradle.kts | 12 ++ settings/ui/proguard-rules.pro | 21 +++ .../settings/ui/navigation/SettingsRoute.kt | 10 ++ vpnclient/build.gradle.kts | 2 +- 94 files changed, 1837 insertions(+), 21 deletions(-) create mode 100644 app/src/main/kotlin/org/fptn/vpn/PvnApplication.kt create mode 100644 app/src/main/kotlin/org/fptn/vpn/di/AppModule.kt create mode 100644 app/src/main/kotlin/org/fptn/vpn/navigation/TopLevelDestination.kt create mode 100644 app/src/main/kotlin/org/fptn/vpn/ui/MainActivity.kt create mode 100644 app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt create mode 100644 app/src/main/res/drawable/ic_splash.xml create mode 100644 app/src/main/res/values-night/colors.xml create mode 100644 buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationComposeConventionPlugin.kt create mode 100644 buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationConventionPlugin.kt create mode 100644 buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationKoinConventionPlugin.kt create mode 100644 buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidLibraryComposeConventionPlugin.kt create mode 100644 buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidLibraryConventionPlugin.kt create mode 100644 buildSrc/src/main/kotlin/org/fptn/vpn/gradle/KoinConventionPlugin.kt create mode 100644 buildSrc/src/main/kotlin/org/fptn/vpn/gradle/KotlinLibraryConventionPlugin.kt create mode 100644 buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidCompose.kt create mode 100644 buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidFirebase.kt create mode 100644 buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidKoin.kt create mode 100644 core/common/src/main/kotlin/org/fptn/vpn/core/common/AgDispatchers.kt create mode 100644 core/common/src/main/kotlin/org/fptn/vpn/core/common/CommonModule.kt create mode 100644 core/common/src/main/kotlin/org/fptn/vpn/core/common/Result.kt create mode 100644 core/designsystem/.gitignore create mode 100644 core/designsystem/build.gradle.kts create mode 100644 core/designsystem/proguard-rules.pro create mode 100644 core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/icons/PvnIcons.kt create mode 100644 core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/BackgroundTheme.kt create mode 100644 core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/Color.kt create mode 100644 core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/PvnTheme.kt create mode 100644 core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/Type.kt create mode 100644 core/designsystem/src/main/res/drawable/ic_launcher_background.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 core/designsystem/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 core/designsystem/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 core/designsystem/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 core/designsystem/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 core/designsystem/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 core/designsystem/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 core/designsystem/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 core/designsystem/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 core/designsystem/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 core/designsystem/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 core/designsystem/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 core/designsystem/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 core/designsystem/src/main/res/values-night/themes.xml create mode 100644 core/designsystem/src/main/res/values/colors.xml create mode 100644 core/designsystem/src/main/res/values/dimens.xml create mode 100644 core/designsystem/src/main/res/values/strings.xml create mode 100644 core/designsystem/src/main/res/values/themes.xml create mode 100644 core/model/.gitignore create mode 100644 core/model/build.gradle.kts create mode 100644 core/model/proguard-rules.pro create mode 100644 core/model/src/main/kotlin/org/fptn/vpn/core/model/UserData.kt create mode 100644 core/network/.gitignore create mode 100644 core/network/build.gradle.kts create mode 100644 core/network/proguard-rules.pro create mode 100644 core/network/src/main/AndroidManifest.xml create mode 100644 core/network/src/main/kotlin/org/fptn/vpn/core/network/ConnectivityManagerNetworkMonitor.kt create mode 100644 core/network/src/main/kotlin/org/fptn/vpn/core/network/NetworkModule.kt create mode 100644 core/network/src/main/kotlin/org/fptn/vpn/core/network/NetworkMonitor.kt create mode 100644 core/persistent/.gitignore create mode 100644 core/persistent/build.gradle.kts create mode 100644 core/persistent/proguard-rules.pro create mode 100644 core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/PreferencesStore.kt create mode 100644 core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/PersistentModule.kt create mode 100644 home/data/.gitignore create mode 100644 home/data/build.gradle.kts create mode 100644 home/data/proguard-rules.pro create mode 100644 home/domain/.gitignore create mode 100644 home/domain/build.gradle.kts create mode 100644 home/domain/proguard-rules.pro create mode 100644 home/ui/.gitignore create mode 100644 home/ui/build.gradle.kts create mode 100644 home/ui/proguard-rules.pro create mode 100644 home/ui/src/main/kotlin/com/filantrop/pvnclient/home/ui/navigation/HomeNavigation.kt create mode 100644 settings/data/.gitignore create mode 100644 settings/data/build.gradle.kts create mode 100644 settings/data/proguard-rules.pro create mode 100644 settings/domain/.gitignore create mode 100644 settings/domain/build.gradle.kts create mode 100644 settings/domain/proguard-rules.pro create mode 100644 settings/ui/.gitignore create mode 100644 settings/ui/build.gradle.kts create mode 100644 settings/ui/proguard-rules.pro create mode 100644 settings/ui/src/main/kotlin/com/filantrop/pvnclient/settings/ui/navigation/SettingsRoute.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 67cc0377..c020d335 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -4,7 +4,9 @@ import java.util.Properties import kotlin.concurrent.thread plugins { - id("pvnclient.android.application") + id("org.fptn.vpn.application") + id("org.fptn.vpn.application.compose") + id("org.fptn.vpn.application.koin") id("com.google.gms.google-services") alias(libs.plugins.crashlytics) } @@ -15,7 +17,9 @@ android { namespace = "org.fptn.vpn" compileSdk = rootProject.extra.get("compileSdkVersion") as Int ndkVersion = "28.1.13356709" + var isCI = System.getenv("KEY_ALIAS") != null + signingConfigs { create("release") { if (isCI) { @@ -34,7 +38,7 @@ android { } else { println( "Warning: keystore.properties file not found. " + - "Release signing configuration will not be applied.", + "Release signing configuration will not be applied.", ) } } @@ -113,12 +117,24 @@ android { dependencies { implementation(platform(libs.firebase.bom)) + implementation(project(":auth:domain")) + implementation(project(":auth:ui")) implementation(project(":core:common")) + implementation(project(":core:designsystem")) + implementation(project(":core:model")) + implementation(project(":core:network")) + implementation(project(":core:persistent")) + implementation(project(":home:ui")) + implementation(project(":settings:ui")) implementation(project(":vpnclient")) implementation(libs.androidx.activity) + implementation(libs.androidx.activity.compose) implementation(libs.androidx.appcompat) - // To use CallbackToFutureAdapter + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.ui) implementation(libs.androidx.constraintlayout) + implementation(libs.androidx.core.splashscreen) implementation(libs.androidx.monitor) implementation(libs.androidx.room.guava) implementation(libs.androidx.room.runtime) @@ -127,6 +143,7 @@ dependencies { implementation(libs.guava) implementation(libs.ipaddress) implementation(libs.jackson.databind) + implementation(libs.koin.android) implementation(libs.material) implementation(libs.zxing) @@ -136,6 +153,7 @@ dependencies { annotationProcessor(libs.lombock) testImplementation(libs.junit) + testImplementation(libs.koin.test) androidTestImplementation(libs.androidx.junit) } diff --git a/app/src/main/cpp/libs/fptn b/app/src/main/cpp/libs/fptn index a3a0f3ea..43626920 160000 --- a/app/src/main/cpp/libs/fptn +++ b/app/src/main/cpp/libs/fptn @@ -1 +1 @@ -Subproject commit a3a0f3ea14634fff4730bfc87464a9a4345a2160 +Subproject commit 4362692027ef112ec57f64be232a2fcc7964ddab diff --git a/app/src/main/kotlin/org/fptn/vpn/PvnApplication.kt b/app/src/main/kotlin/org/fptn/vpn/PvnApplication.kt new file mode 100644 index 00000000..91c29b6d --- /dev/null +++ b/app/src/main/kotlin/org/fptn/vpn/PvnApplication.kt @@ -0,0 +1,16 @@ +package org.fptn.vpn + +import android.app.Application +import org.fptn.vpn.di.appModule +import org.koin.android.ext.koin.androidContext +import org.koin.core.context.startKoin + +class PvnApplication : Application() { + override fun onCreate() { + super.onCreate() + startKoin { + androidContext(this@PvnApplication) + modules(appModule) + } + } +} diff --git a/app/src/main/kotlin/org/fptn/vpn/di/AppModule.kt b/app/src/main/kotlin/org/fptn/vpn/di/AppModule.kt new file mode 100644 index 00000000..52bb93a1 --- /dev/null +++ b/app/src/main/kotlin/org/fptn/vpn/di/AppModule.kt @@ -0,0 +1,26 @@ +package org.fptn.vpn.di + +import com.filantrop.pvnclient.auth.ui.authModule +import org.fptn.vpn.core.common.commonModule +import org.fptn.vpn.core.network.networkModule +import org.fptn.vpn.core.persistent.di.persistentModule +import org.fptn.vpn.viewmodel.MainViewModel +import org.koin.core.module.Module +import org.koin.core.module.dsl.viewModel +import org.koin.dsl.module + +val viewModelModule = + module { + viewModel { MainViewModel(get()) } + } + +val appModule: Module = + module { + includes( + authModule, + commonModule, + persistentModule, + networkModule, + viewModelModule, + ) + } diff --git a/app/src/main/kotlin/org/fptn/vpn/navigation/TopLevelDestination.kt b/app/src/main/kotlin/org/fptn/vpn/navigation/TopLevelDestination.kt new file mode 100644 index 00000000..3e12601d --- /dev/null +++ b/app/src/main/kotlin/org/fptn/vpn/navigation/TopLevelDestination.kt @@ -0,0 +1,34 @@ +package org.fptn.vpn.navigation + +import androidx.annotation.StringRes +import androidx.compose.ui.graphics.vector.ImageVector +import com.filantrop.pvnclient.home.ui.navigation.HOME_BASE_ROUTE +import com.filantrop.pvnclient.home.ui.navigation.HOME_ROUTE +import com.filantrop.pvnclient.settings.ui.navigation.SETTINGS_ROUTE +import org.fptn.vpn.R +import org.fptn.vpn.core.designsystem.icons.PvnIcons + +enum class TopLevelDestination( + val selectedIcon: ImageVector, + val unselectedIcon: ImageVector, + @StringRes val iconTextId: Int, + @StringRes val titleTextId: Int, + val route: String, + val baseRoute: String = route, +) { + HOME( + selectedIcon = PvnIcons.Home, + unselectedIcon = PvnIcons.HomeBorder, + iconTextId = R.string.home_title, + titleTextId = R.string.home_title, + route = HOME_ROUTE, + baseRoute = HOME_BASE_ROUTE, + ), + SETTINGS( + selectedIcon = PvnIcons.Settings, + unselectedIcon = PvnIcons.SettingsBorder, + iconTextId = R.string.settings_title, + titleTextId = R.string.settings_title, + route = SETTINGS_ROUTE, + ), +} diff --git a/app/src/main/kotlin/org/fptn/vpn/ui/MainActivity.kt b/app/src/main/kotlin/org/fptn/vpn/ui/MainActivity.kt new file mode 100644 index 00000000..8995bb9c --- /dev/null +++ b/app/src/main/kotlin/org/fptn/vpn/ui/MainActivity.kt @@ -0,0 +1,88 @@ +package org.fptn.vpn.ui + +import android.content.Intent +import android.graphics.Color +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.SystemBarStyle +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.runtime.DisposableEffect +import androidx.compose.ui.platform.LocalContext +import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.lifecycleScope +import androidx.lifecycle.repeatOnLifecycle +import com.filantrop.pvnclient.auth.ui.AuthScreen +import kotlinx.coroutines.launch +import org.fptn.vpn.core.designsystem.theme.PvnTheme +import org.fptn.vpn.viewmodel.AuthActivityUiState +import org.fptn.vpn.viewmodel.MainViewModel +import org.koin.androidx.viewmodel.ext.android.viewModel + +class MainActivity : ComponentActivity() { + private val viewModel: MainViewModel by viewModel() + + override fun onCreate(savedInstanceState: Bundle?) { + val splashScreen = installSplashScreen() + super.onCreate(savedInstanceState) + + lifecycleScope.launch { + lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) { + viewModel.uiState + .collect { + System.out.println("moggot state: $it") + openScreen(it) + } + } + } + splashScreen.setKeepOnScreenCondition { viewModel.uiState.value.shouldKeepSplashScreen() } + } + + private fun openScreen(state: AuthActivityUiState) { + setContent { + val darkTheme = isSystemInDarkTheme() + + // Update the edge to edge configuration to match the theme + // This is the same parameters as the default enableEdgeToEdge call, but we manually + // resolve whether or not to show dark theme using uiState, since it can be different + // than the configuration's dark theme value based on the user preference. + DisposableEffect(darkTheme) { + enableEdgeToEdge( + statusBarStyle = + SystemBarStyle.auto( + Color.TRANSPARENT, + Color.TRANSPARENT, + ) { darkTheme }, + navigationBarStyle = + SystemBarStyle.auto( + lightScrim, + darkScrim, + ) { darkTheme }, + ) + onDispose {} + } + PvnTheme(darkTheme = darkTheme) { + when (state) { + is AuthActivityUiState.Loading -> { + System.out.println("moggot Loading") + } + is AuthActivityUiState.Login -> { + AuthScreen() + } + is AuthActivityUiState.Main -> { + val context = LocalContext.current + context.startActivity(Intent(context, MainActivity::class.java)) + } + } + } + } + } +} + +@Suppress("MagicNumber") +private val lightScrim = Color.argb(0xe6, 0xFF, 0xFF, 0xFF) + +@Suppress("MagicNumber") +private val darkScrim = Color.argb(0x80, 0x1b, 0x1b, 0x1b) diff --git a/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt b/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt new file mode 100644 index 00000000..2c5fd823 --- /dev/null +++ b/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt @@ -0,0 +1,50 @@ +package org.fptn.vpn.viewmodel + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.filantrop.pvnclient.auth.domain.AuthInteractor +import kotlinx.coroutines.flow.SharingStarted +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.map +import kotlinx.coroutines.flow.stateIn +import org.fptn.vpn.core.common.Result +import org.fptn.vpn.core.common.asResult +import org.fptn.vpn.core.model.UserData + +class MainViewModel( + authInteractor: AuthInteractor, +) : ViewModel() { + val uiState: StateFlow = + authInteractor.userData + .asResult() + .map { result -> + when (result) { + is Result.Error -> AuthActivityUiState.Login + is Result.Loading -> AuthActivityUiState.Loading + is Result.Success -> AuthActivityUiState.Main(result.data) + } + }.stateIn( + scope = viewModelScope, + initialValue = AuthActivityUiState.Loading, + started = SharingStarted.WhileSubscribed(STOP_TIMEOUT_MILLIS), + ) + + companion object { + private const val STOP_TIMEOUT_MILLIS = 5_000L + } +} + +sealed interface AuthActivityUiState { + data object Loading : AuthActivityUiState + + data object Login : AuthActivityUiState + + data class Main( + val userData: UserData, + ) : AuthActivityUiState + + /** + * Returns `true` if the state wasn't loaded yet and it should keep showing the splash screen. + */ + fun shouldKeepSplashScreen() = this is Loading +} diff --git a/app/src/main/res/drawable/ic_splash.xml b/app/src/main/res/drawable/ic_splash.xml new file mode 100644 index 00000000..144393be --- /dev/null +++ b/app/src/main/res/drawable/ic_splash.xml @@ -0,0 +1,34 @@ + + + + + + + + + diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml new file mode 100644 index 00000000..928ff71d --- /dev/null +++ b/app/src/main/res/values-night/colors.xml @@ -0,0 +1,5 @@ + + + #FCFCFC + #000000 + \ No newline at end of file diff --git a/app/src/main/res/values/color.xml b/app/src/main/res/values/color.xml index ab92c849..53d01b54 100644 --- a/app/src/main/res/values/color.xml +++ b/app/src/main/res/values/color.xml @@ -17,4 +17,8 @@ #1B023B #FF03DAC5 + + #000000 + #000000 + #FCFCFC \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d84ceb4f..ae1c8be8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -125,4 +125,8 @@ https://play.google.com/store/apps/details?id=org.fptn.vpn Invalid token format! Check the correctness of the input. + Home + Settings + ⚠️ You aren’t connected to the internet + diff --git a/build.gradle.kts b/build.gradle.kts index 01c364f4..a850e95d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -75,6 +75,7 @@ tasks.register("clean", Delete::class) { } plugins { + alias(libs.plugins.compose.compiler) apply false alias(libs.plugins.crashlytics) apply false alias(libs.plugins.deps.sorting) apply false alias(libs.plugins.deps.unused) apply true diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index a68391c5..9e1cf534 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -8,25 +8,46 @@ buildscript { } } -gradlePlugin { - plugins { - register("androidApplication") { - id = "pvnclient.android.application" - implementationClass = "AndroidApplicationConventionPlugin" - } - register("kotlinLibrary") { - id = "pvnclient.android.library.kotlin" - implementationClass = "KotlinLibraryConventionPlugin" - } - } -} - dependencies { implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) - implementation(libs.detekt) implementation(libs.android.gradle.plugin) + implementation(libs.detekt) + implementation(libs.java.poet) implementation(libs.guava) implementation(libs.kotlin.gradle.plugin) implementation(libs.kotlin.metadata.jvm) implementation(libs.ksp.gradle.plugin) } + +gradlePlugin { + plugins { + register("androidApplication") { + id = "org.fptn.vpn.application" + implementationClass = "org.fptn.vpn.gradle.AndroidApplicationConventionPlugin" + } + register("androidApplicationCompose") { + id = "org.fptn.vpn.application.compose" + implementationClass = "org.fptn.vpn.gradle.AndroidApplicationComposeConventionPlugin" + } + register("androidApplicationKoin") { + id = "org.fptn.vpn.application.koin" + implementationClass = "org.fptn.vpn.gradle.AndroidApplicationKoinConventionPlugin" + } + register("androidLibrary") { + id = "org.fptn.vpn.library.android" + implementationClass = "org.fptn.vpn.gradle.AndroidLibraryConventionPlugin" + } + register("androidLibraryCompose") { + id = "org.fptn.vpn.library.android.compose" + implementationClass = "org.fptn.vpn.gradle.AndroidLibraryComposeConventionPlugin" + } + register("kotlinLibrary") { + id = "org.fptn.vpn.library.kotlin" + implementationClass = "org.fptn.vpn.gradle.KotlinLibraryConventionPlugin" + } + register("koinLibrary") { + id = "org.fptn.vpn.library.koin" + implementationClass = "org.fptn.vpn.gradle.KoinConventionPlugin" + } + } +} diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationComposeConventionPlugin.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationComposeConventionPlugin.kt new file mode 100644 index 00000000..30b7e945 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationComposeConventionPlugin.kt @@ -0,0 +1,19 @@ +package org.fptn.vpn.gradle + +import com.android.build.api.dsl.ApplicationExtension +import org.fptn.vpn.gradle.extensions.configureAndroidCompose +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.getByType + +class AndroidApplicationComposeConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("com.android.application") + } + val extension = extensions.getByType() + configureAndroidCompose(extension) + } + } +} diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationConventionPlugin.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationConventionPlugin.kt new file mode 100644 index 00000000..919375ca --- /dev/null +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationConventionPlugin.kt @@ -0,0 +1,35 @@ +package org.fptn.vpn.gradle + +import com.android.build.api.dsl.ApplicationExtension +import org.fptn.vpn.gradle.extensions.buildLibs +import org.fptn.vpn.gradle.extensions.configureAndroidFirebase +import org.fptn.vpn.gradle.extensions.configureKotlinAndroid +import org.fptn.vpn.gradle.extensions.implementation +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.extra +import org.gradle.kotlin.dsl.getByType + +class AndroidApplicationConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("com.android.application") + apply("org.jetbrains.kotlin.android") + apply("com.autonomousapps.dependency-analysis") + } + + extensions.configure { + configureKotlinAndroid(this) + defaultConfig.targetSdk = rootProject.extra.get("targetSdkVersion") as Int + } + val extension = extensions.getByType() + configureAndroidFirebase(extension) + dependencies { + implementation(buildLibs.timber) + } + } + } +} diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationKoinConventionPlugin.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationKoinConventionPlugin.kt new file mode 100644 index 00000000..f8465775 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationKoinConventionPlugin.kt @@ -0,0 +1,19 @@ +package org.fptn.vpn.gradle + +import com.android.build.api.dsl.ApplicationExtension +import org.fptn.vpn.gradle.extensions.configureAndroidKoin +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.getByType + +class AndroidApplicationKoinConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("com.android.application") + } + val extension = extensions.getByType() + configureAndroidKoin(extension) + } + } +} diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidLibraryComposeConventionPlugin.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidLibraryComposeConventionPlugin.kt new file mode 100644 index 00000000..728f484b --- /dev/null +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidLibraryComposeConventionPlugin.kt @@ -0,0 +1,19 @@ +package org.fptn.vpn.gradle + +import com.android.build.gradle.LibraryExtension +import org.fptn.vpn.gradle.extensions.configureAndroidCompose +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.getByType + +class AndroidLibraryComposeConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("com.android.library") + } + val extension = extensions.getByType() + configureAndroidCompose(extension) + } + } +} diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidLibraryConventionPlugin.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidLibraryConventionPlugin.kt new file mode 100644 index 00000000..53b4345a --- /dev/null +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidLibraryConventionPlugin.kt @@ -0,0 +1,32 @@ +package org.fptn.vpn.gradle + +import com.android.build.gradle.LibraryExtension +import org.fptn.vpn.gradle.extensions.configureAndroidFirebase +import org.fptn.vpn.gradle.extensions.configureKotlinAndroid +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.extra +import org.gradle.kotlin.dsl.getByType + +class AndroidLibraryConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("com.android.library") + apply("org.jetbrains.kotlin.android") + apply("com.autonomousapps.dependency-analysis") + } + + extensions.configure { + configureKotlinAndroid(this) + defaultConfig.targetSdk = rootProject.extra.get("targetSdkVersion") as Int + } + val extension = extensions.getByType() + configureAndroidFirebase(extension) + dependencies { + } + } + } +} diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/KoinConventionPlugin.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/KoinConventionPlugin.kt new file mode 100644 index 00000000..972fdf90 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/KoinConventionPlugin.kt @@ -0,0 +1,21 @@ +package org.fptn.vpn.gradle + +import org.fptn.vpn.gradle.extensions.buildLibs +import org.fptn.vpn.gradle.extensions.implementation +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies + +class KoinConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("com.google.devtools.ksp") + } + dependencies { + implementation(platform(buildLibs.koin.bom)) + implementation(buildLibs.koin.core) + } + } + } +} diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/KotlinLibraryConventionPlugin.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/KotlinLibraryConventionPlugin.kt new file mode 100644 index 00000000..f75274a8 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/KotlinLibraryConventionPlugin.kt @@ -0,0 +1,18 @@ +package org.fptn.vpn.gradle + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies + +class KotlinLibraryConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("kotlin") + apply("com.autonomousapps.dependency-analysis") + } + dependencies { + } + } + } +} diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidCompose.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidCompose.kt new file mode 100644 index 00000000..db85d5e1 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidCompose.kt @@ -0,0 +1,76 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.fptn.vpn.gradle.extensions + +import com.android.build.api.dsl.CommonExtension +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.withType +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import java.io.File + +/** + * Configure Compose-specific options + */ +internal fun Project.configureAndroidCompose(commonExtension: CommonExtension<*, *, *, *, *, *>) { + commonExtension.apply { + project.plugins.apply( + buildLibs.plugins.compose.compiler + .get() + .pluginId, + ) + buildFeatures { + compose = true + } + + dependencies { + implementation(platform(buildLibs.androidx.compose.bom)) + } + } + + tasks.withType().configureEach { + compilerOptions { + for (param in buildComposeMetricsParameters()) { + freeCompilerArgs.add(param) + } + } + } +} + +private fun Project.buildComposeMetricsParameters(): List { + val metricParameters = mutableListOf() + val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics") + val enableMetrics = enableMetricsProvider.orNull == "true" + if (enableMetrics) { + val metricsFolder = File(project.buildDir, "compose-metrics") + metricParameters.add("-P") + metricParameters.add( + "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath, + ) + } + + val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports") + val enableReports = enableReportsProvider.orNull == "true" + if (enableReports) { + val reportsFolder = File(project.buildDir, "compose-reports") + metricParameters.add("-P") + metricParameters.add( + "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath, + ) + } + return metricParameters.toList() +} diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidFirebase.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidFirebase.kt new file mode 100644 index 00000000..9faa0bdc --- /dev/null +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidFirebase.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.fptn.vpn.gradle.extensions + +import com.android.build.api.dsl.CommonExtension +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies + +/** + * Configure Firebase-specific options + */ +internal fun Project.configureAndroidFirebase(commonExtension: CommonExtension<*, *, *, *, *, *>) { + commonExtension.apply { + dependencies { + implementation(platform(buildLibs.firebase.bom)) + } + } +} diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidKoin.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidKoin.kt new file mode 100644 index 00000000..579fae7d --- /dev/null +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/extensions/AndroidKoin.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.fptn.vpn.gradle.extensions + +import com.android.build.api.dsl.CommonExtension +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies + +/** + * Configure Firebase-specific options + */ +internal fun Project.configureAndroidKoin(commonExtension: CommonExtension<*, *, *, *, *, *>) { + commonExtension.apply { + dependencies { + implementation(platform(buildLibs.koin.bom)) + implementation(buildLibs.koin.core) + } + } +} diff --git a/core/common/build.gradle.kts b/core/common/build.gradle.kts index 3c68ba6a..ad708f1d 100644 --- a/core/common/build.gradle.kts +++ b/core/common/build.gradle.kts @@ -1,6 +1,8 @@ plugins { - id("pvnclient.android.library.kotlin") + id("org.fptn.vpn.library.kotlin") + id("org.fptn.vpn.library.koin") } dependencies { + implementation(libs.kotlinx.coroutines.core) } diff --git a/core/common/src/main/kotlin/org/fptn/vpn/core/common/AgDispatchers.kt b/core/common/src/main/kotlin/org/fptn/vpn/core/common/AgDispatchers.kt new file mode 100644 index 00000000..ecb2c142 --- /dev/null +++ b/core/common/src/main/kotlin/org/fptn/vpn/core/common/AgDispatchers.kt @@ -0,0 +1,7 @@ +package org.fptn.vpn.core.common + +object AgDispatchers { + const val DISPATCHER_DEFAULT = "DispatcherDefault" + const val DISPATCHER_IO = "DispatcherIO" + const val DISPATCHER_UNCONFINED = "DispatcherUnconfined" +} diff --git a/core/common/src/main/kotlin/org/fptn/vpn/core/common/CommonModule.kt b/core/common/src/main/kotlin/org/fptn/vpn/core/common/CommonModule.kt new file mode 100644 index 00000000..41a0c699 --- /dev/null +++ b/core/common/src/main/kotlin/org/fptn/vpn/core/common/CommonModule.kt @@ -0,0 +1,20 @@ +package org.fptn.vpn.core.common + +import kotlinx.coroutines.Dispatchers +import org.fptn.vpn.core.common.AgDispatchers.DISPATCHER_DEFAULT +import org.fptn.vpn.core.common.AgDispatchers.DISPATCHER_IO +import org.fptn.vpn.core.common.AgDispatchers.DISPATCHER_UNCONFINED +import org.koin.core.qualifier.named +import org.koin.dsl.module + +val coroutineModule = + module { + single(named(DISPATCHER_DEFAULT)) { Dispatchers.Default } + single(named(DISPATCHER_IO)) { Dispatchers.IO } + single(named(DISPATCHER_UNCONFINED)) { Dispatchers.Unconfined } + } + +val commonModule = + module { + includes(coroutineModule) + } diff --git a/core/common/src/main/kotlin/org/fptn/vpn/core/common/Constants.kt b/core/common/src/main/kotlin/org/fptn/vpn/core/common/Constants.kt index cf6dca05..5bbab1fc 100644 --- a/core/common/src/main/kotlin/org/fptn/vpn/core/common/Constants.kt +++ b/core/common/src/main/kotlin/org/fptn/vpn/core/common/Constants.kt @@ -8,6 +8,7 @@ object Constants { const val MAIN_NOTIFICATION_CHANNEL_GROUP_ID = "fptnvpn-notification-main-group" const val SELECTED_SERVER: String = "fptn.selected.server" const val SELECTED_SERVER_ID_AUTO: Int = -1 + const val SPACE = " " const val MAIN_CONNECTED_NOTIFICATION_ID = 8975 const val INFO_NOTIFICATION_NOTIFICATION_ID = 8979 const val CURRENT_SNI_SHARED_PREF_KEY: String = "CURRENT_SNI" diff --git a/core/common/src/main/kotlin/org/fptn/vpn/core/common/Result.kt b/core/common/src/main/kotlin/org/fptn/vpn/core/common/Result.kt new file mode 100644 index 00000000..62bdabf8 --- /dev/null +++ b/core/common/src/main/kotlin/org/fptn/vpn/core/common/Result.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.fptn.vpn.core.common + +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.catch +import kotlinx.coroutines.flow.map +import kotlinx.coroutines.flow.onStart + +sealed interface Result { + data class Success( + val data: T, + ) : Result + + data class Error( + val exception: Throwable, + ) : Result + + data object Loading : Result +} + +fun Flow.asResult(): Flow> = + map> { Result.Success(it) } + .onStart { emit(Result.Loading) } + .catch { emit(Result.Error(it)) } diff --git a/core/designsystem/.gitignore b/core/designsystem/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/core/designsystem/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/core/designsystem/build.gradle.kts b/core/designsystem/build.gradle.kts new file mode 100644 index 00000000..6749fb7e --- /dev/null +++ b/core/designsystem/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("org.fptn.vpn.library.android") + id("org.fptn.vpn.library.android.compose") +} + +android { + namespace = "org.fptn.vpn.core.designsystem" +} + +dependencies { + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material.icons.core) + implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.ui) + implementation(libs.androidx.compose.ui.test.manifest) + + debugImplementation(libs.androidx.compose.ui.tooling) +} diff --git a/core/designsystem/proguard-rules.pro b/core/designsystem/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/core/designsystem/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/icons/PvnIcons.kt b/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/icons/PvnIcons.kt new file mode 100644 index 00000000..8120f629 --- /dev/null +++ b/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/icons/PvnIcons.kt @@ -0,0 +1,16 @@ +package org.fptn.vpn.core.designsystem.icons + +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.Home +import androidx.compose.material.icons.outlined.Settings +import androidx.compose.material.icons.rounded.Home +import androidx.compose.material.icons.rounded.Person +import androidx.compose.material.icons.rounded.Settings + +object PvnIcons { + val Home = Icons.Rounded.Home + val HomeBorder = Icons.Outlined.Home + val Person = Icons.Rounded.Person + val Settings = Icons.Rounded.Settings + val SettingsBorder = Icons.Outlined.Settings +} diff --git a/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/BackgroundTheme.kt b/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/BackgroundTheme.kt new file mode 100644 index 00000000..92776077 --- /dev/null +++ b/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/BackgroundTheme.kt @@ -0,0 +1,17 @@ +package org.fptn.vpn.core.designsystem.theme + +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.staticCompositionLocalOf +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.Dp + +@Immutable +data class BackgroundTheme( + val color: Color = Color.Unspecified, + val tonalElevation: Dp = Dp.Unspecified, +) + +/** + * A composition local for [BackgroundTheme]. + */ +val LocalBackgroundTheme = staticCompositionLocalOf { BackgroundTheme() } diff --git a/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/Color.kt b/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/Color.kt new file mode 100644 index 00000000..868da900 --- /dev/null +++ b/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/Color.kt @@ -0,0 +1,66 @@ +package org.fptn.vpn.core.designsystem.theme + +import androidx.compose.ui.graphics.Color + +@Suppress("MagicNumber") +object Color { + val md_theme_light_primary = Color(0xFF9A4525) + val md_theme_light_onPrimary = Color(0xFFFFFFFF) + val md_theme_light_primaryContainer = Color(0xFFFFDBCF) + val md_theme_light_onPrimaryContainer = Color(0xFF390C00) + val md_theme_light_secondary = Color(0xFF77574C) + val md_theme_light_onSecondary = Color(0xFFFFFFFF) + val md_theme_light_secondaryContainer = Color(0xFFFFDBCF) + val md_theme_light_onSecondaryContainer = Color(0xFF2C160E) + val md_theme_light_tertiary = Color(0xFF6A5E2F) + val md_theme_light_onTertiary = Color(0xFFFFFFFF) + val md_theme_light_tertiaryContainer = Color(0xFFF3E2A7) + val md_theme_light_onTertiaryContainer = Color(0xFF221B00) + val md_theme_light_error = Color(0xFFBA1A1A) + val md_theme_light_errorContainer = Color(0xFFFFDAD6) + val md_theme_light_onError = Color(0xFFFFFFFF) + val md_theme_light_onErrorContainer = Color(0xFF410002) + val md_theme_light_background = Color(0xFFFFFBFF) + val md_theme_light_onBackground = Color(0xFF201A18) + val md_theme_light_surface = Color(0xFFFFFBFF) + val md_theme_light_onSurface = Color(0xFF201A18) + val md_theme_light_surfaceVariant = Color(0xFFF5DED7) + val md_theme_light_onSurfaceVariant = Color(0xFF53433E) + val md_theme_light_outline = Color(0xFF85736D) + val md_theme_light_inverseOnSurface = Color(0xFFFBEEEA) + val md_theme_light_inverseSurface = Color(0xFF362F2D) + val md_theme_light_inversePrimary = Color(0xFFFFB59C) + val md_theme_light_shadow = Color(0xFF000000) + val md_theme_light_surfaceTint = Color(0xFF9A4525) + val md_theme_light_surfaceTintColor = Color(0xFF9A4525) + val seed = Color(0xFFfedbd0) + val md_theme_dark_primary = Color(0xFFFFB59C) + val md_theme_dark_onPrimary = Color(0xFF5C1900) + val md_theme_dark_primaryContainer = Color(0xFF7C2E0F) + val md_theme_dark_onPrimaryContainer = Color(0xFFFFDBCF) + val md_theme_dark_secondary = Color(0xFFE7BDB0) + val md_theme_dark_onSecondary = Color(0xFF442A21) + val md_theme_dark_secondaryContainer = Color(0xFF5D4036) + val md_theme_dark_onSecondaryContainer = Color(0xFFFFDBCF) + val md_theme_dark_tertiary = Color(0xFFD6C68D) + val md_theme_dark_onTertiary = Color(0xFF393005) + val md_theme_dark_tertiaryContainer = Color(0xFF51461A) + val md_theme_dark_onTertiaryContainer = Color(0xFFF3E2A7) + val md_theme_dark_error = Color(0xFFFFB4AB) + val md_theme_dark_errorContainer = Color(0xFF93000A) + val md_theme_dark_onError = Color(0xFF690005) + val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6) + val md_theme_dark_background = Color(0xFF201A18) + val md_theme_dark_onBackground = Color(0xFFEDE0DC) + val md_theme_dark_surface = Color(0xFF201A18) + val md_theme_dark_onSurface = Color(0xFFEDE0DC) + val md_theme_dark_surfaceVariant = Color(0xFF53433E) + val md_theme_dark_onSurfaceVariant = Color(0xFFD8C2BB) + val md_theme_dark_outline = Color(0xFFA08D87) + val md_theme_dark_inverseOnSurface = Color(0xFF201A18) + val md_theme_dark_inverseSurface = Color(0xFFEDE0DC) + val md_theme_dark_inversePrimary = Color(0xFF9A4525) + val md_theme_dark_shadow = Color(0xFF000000) + val md_theme_dark_surfaceTint = Color(0xFFFFB59C) + val md_theme_dark_surfaceTintColor = Color(0xFFFFB59C) +} diff --git a/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/PvnTheme.kt b/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/PvnTheme.kt new file mode 100644 index 00000000..b0b58b18 --- /dev/null +++ b/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/PvnTheme.kt @@ -0,0 +1,110 @@ +package org.fptn.vpn.core.designsystem.theme + +import android.app.Activity +import android.os.Build +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.dynamicDarkColorScheme +import androidx.compose.material3.dynamicLightColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.SideEffect +import androidx.compose.ui.graphics.toArgb +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalView +import androidx.core.view.WindowCompat + +private val LightColorScheme = + lightColorScheme( + primary = Color.md_theme_light_primary, + onPrimary = Color.md_theme_light_onPrimary, + primaryContainer = Color.md_theme_light_primaryContainer, + onPrimaryContainer = Color.md_theme_light_onPrimaryContainer, + secondary = Color.md_theme_light_secondary, + onSecondary = Color.md_theme_light_onSecondary, + secondaryContainer = Color.md_theme_light_secondaryContainer, + onSecondaryContainer = Color.md_theme_light_onSecondaryContainer, + tertiary = Color.md_theme_light_tertiary, + onTertiary = Color.md_theme_light_onTertiary, + tertiaryContainer = Color.md_theme_light_tertiaryContainer, + onTertiaryContainer = Color.md_theme_light_onTertiaryContainer, + background = Color.md_theme_light_background, + onBackground = Color.md_theme_light_onBackground, + surface = Color.md_theme_light_surface, + onSurface = Color.md_theme_light_onSurface, + surfaceVariant = Color.md_theme_light_surfaceVariant, + onSurfaceVariant = Color.md_theme_light_onSurfaceVariant, + surfaceTint = Color.md_theme_light_surfaceTint, + inverseSurface = Color.md_theme_light_inverseSurface, + inverseOnSurface = Color.md_theme_light_inverseOnSurface, + error = Color.md_theme_light_error, + onError = Color.md_theme_light_onError, + errorContainer = Color.md_theme_light_errorContainer, + onErrorContainer = Color.md_theme_light_onErrorContainer, + outline = Color.md_theme_light_outline, + ) +private val DarkColorScheme = + darkColorScheme( + primary = Color.md_theme_dark_primary, + onPrimary = Color.md_theme_dark_onPrimary, + primaryContainer = Color.md_theme_dark_primaryContainer, + onPrimaryContainer = Color.md_theme_dark_onPrimaryContainer, + secondary = Color.md_theme_dark_secondary, + onSecondary = Color.md_theme_dark_onSecondary, + secondaryContainer = Color.md_theme_dark_secondaryContainer, + onSecondaryContainer = Color.md_theme_dark_onSecondaryContainer, + tertiary = Color.md_theme_dark_tertiary, + onTertiary = Color.md_theme_dark_onTertiary, + tertiaryContainer = Color.md_theme_dark_tertiaryContainer, + onTertiaryContainer = Color.md_theme_dark_onTertiaryContainer, + background = Color.md_theme_dark_background, + onBackground = Color.md_theme_dark_onBackground, + surface = Color.md_theme_dark_surface, + onSurface = Color.md_theme_dark_onSurface, + surfaceVariant = Color.md_theme_dark_surfaceVariant, + onSurfaceVariant = Color.md_theme_dark_onSurfaceVariant, + surfaceTint = Color.md_theme_dark_surfaceTint, + inverseSurface = Color.md_theme_dark_inverseSurface, + inverseOnSurface = Color.md_theme_dark_inverseOnSurface, + error = Color.md_theme_dark_error, + onError = Color.md_theme_dark_onError, + errorContainer = Color.md_theme_dark_errorContainer, + onErrorContainer = Color.md_theme_dark_onErrorContainer, + outline = Color.md_theme_dark_outline, + ) + +@Composable +fun PvnTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + // Dynamic color is available on Android 12+ + dynamicColor: Boolean = false, + content: @Composable () -> Unit, +) { + val colorScheme = + when { + dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { + val context = LocalContext.current + if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) + } + darkTheme -> { + DarkColorScheme + } + else -> { + LightColorScheme + } + } + val view = LocalView.current + if (!view.isInEditMode) { + SideEffect { + val window = (view.context as Activity).window + window.statusBarColor = colorScheme.background.toArgb() + WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme + } + } + MaterialTheme( + colorScheme = colorScheme, + typography = MmTypography, + content = content, + ) +} diff --git a/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/Type.kt b/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/Type.kt new file mode 100644 index 00000000..a51ef623 --- /dev/null +++ b/core/designsystem/src/main/kotlin/org/fptn/vpn/core/designsystem/theme/Type.kt @@ -0,0 +1,118 @@ +package org.fptn.vpn.core.designsystem.theme + +import androidx.compose.material3.Typography +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +/** + * Now in Android typography. + */ +internal val MmTypography = + Typography( + displayLarge = + TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 57.sp, + lineHeight = 64.sp, + letterSpacing = (-0.25).sp, + ), + displayMedium = + TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 45.sp, + lineHeight = 52.sp, + letterSpacing = 0.sp, + ), + displaySmall = + TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 36.sp, + lineHeight = 44.sp, + letterSpacing = 0.sp, + ), + headlineLarge = + TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 32.sp, + lineHeight = 40.sp, + letterSpacing = 0.sp, + ), + headlineMedium = + TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 28.sp, + lineHeight = 36.sp, + letterSpacing = 0.sp, + ), + headlineSmall = + TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 24.sp, + lineHeight = 32.sp, + letterSpacing = 0.sp, + ), + titleLarge = + TextStyle( + fontWeight = FontWeight.Bold, + fontSize = 22.sp, + lineHeight = 28.sp, + letterSpacing = 0.sp, + ), + titleMedium = + TextStyle( + fontWeight = FontWeight.Bold, + fontSize = 18.sp, + lineHeight = 24.sp, + letterSpacing = 0.1.sp, + ), + titleSmall = + TextStyle( + fontWeight = FontWeight.Medium, + fontSize = 14.sp, + lineHeight = 20.sp, + letterSpacing = 0.1.sp, + ), + bodyLarge = + TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.5.sp, + ), + bodyMedium = + TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 14.sp, + lineHeight = 20.sp, + letterSpacing = 0.25.sp, + ), + bodySmall = + TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 12.sp, + lineHeight = 16.sp, + letterSpacing = 0.4.sp, + ), + labelLarge = + TextStyle( + fontWeight = FontWeight.Medium, + fontSize = 14.sp, + lineHeight = 20.sp, + letterSpacing = 0.1.sp, + ), + labelMedium = + TextStyle( + fontWeight = FontWeight.Medium, + fontSize = 12.sp, + lineHeight = 16.sp, + letterSpacing = 0.5.sp, + ), + labelSmall = + TextStyle( + fontWeight = FontWeight.Medium, + fontSize = 10.sp, + lineHeight = 16.sp, + letterSpacing = 0.sp, + ), + ) diff --git a/core/designsystem/src/main/res/drawable/ic_launcher_background.xml b/core/designsystem/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..07d5da9c --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_launcher_foreground.xml b/core/designsystem/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 00000000..2b068d11 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/core/designsystem/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/core/designsystem/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..6f3b755b --- /dev/null +++ b/core/designsystem/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/core/designsystem/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/core/designsystem/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..6f3b755b --- /dev/null +++ b/core/designsystem/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/core/designsystem/src/main/res/mipmap-hdpi/ic_launcher.webp b/core/designsystem/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..c209e78ecd372343283f4157dcfd918ec5165bb3 GIT binary patch literal 1404 zcmV-?1%vuhNk&F=1pok7MM6+kP&il$0000G0000-002h-06|PpNX!5L00Dqw+t%{r zzW2vH!KF=w&cMnnN@{whkTw+#mAh0SV?YL=)3MimFYCWp#fpdtz~8$hD5VPuQgtcN zXl<@<#Cme5f5yr2h%@8TWh?)bSK`O z^Z@d={gn7J{iyxL_y_%J|L>ep{dUxUP8a{byupH&!UNR*OutO~0{*T4q5R6@ApLF! z5{w?Z150gC7#>(VHFJZ-^6O@PYp{t!jH(_Z*nzTK4 zkc{fLE4Q3|mA2`CWQ3{8;gxGizgM!zccbdQoOLZc8hThi-IhN90RFT|zlxh3Ty&VG z?Fe{#9RrRnxzsu|Lg2ddugg7k%>0JeD+{XZ7>Z~{=|M+sh1MF7~ zz>To~`~LVQe1nNoR-gEzkpe{Ak^7{{ZBk2i_<+`Bq<^GB!RYG+z)h;Y3+<{zlMUYd zrd*W4w&jZ0%kBuDZ1EW&KLpyR7r2=}fF2%0VwHM4pUs}ZI2egi#DRMYZPek*^H9YK zay4Iy3WXFG(F14xYsoDA|KXgGc5%2DhmQ1gFCkrgHBm!lXG8I5h*uf{rn48Z!_@ z4Bk6TJAB2CKYqPjiX&mWoW>OPFGd$wqroa($ne7EUK;#3VYkXaew%Kh^3OrMhtjYN?XEoY`tRPQsAkH-DSL^QqyN0>^ zmC>{#F14jz4GeW{pJoRpLFa_*GI{?T93^rX7SPQgT@LbLqpNA}<@2wH;q493)G=1Y z#-sCiRNX~qf3KgiFzB3I>4Z%AfS(3$`-aMIBU+6?gbgDb!)L~A)je+;fR0jWLL-Fu z4)P{c7{B4Hp91&%??2$v9iRSFnuckHUm}or9seH6 z>%NbT+5*@L5(I9j@06@(!{ZI?U0=pKn8uwIg&L{JV14+8s2hnvbRrU|hZCd}IJu7*;;ECgO%8_*W Kmw_-CKmY()leWbG literal 0 HcmV?d00001 diff --git a/core/designsystem/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/core/designsystem/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..b2dfe3d1ba5cf3ee31b3ecc1ced89044a1f3b7a9 GIT binary patch literal 2898 zcmV-Y3$650Nk&FW3jhFDMM6+kP&il$0000G0000-002h-06|PpNWB9900E$G+qN-D z+81ABX7q?;bwx%xBg?kcwr$(C-Tex-ZCkHUw(Y9#+`E5-zuONG5fgw~E2WDng@Bc@ z24xy+R1n%~6xI#u9vJ8zREI)sb<&Il(016}Z~V1n^PU3-_H17A*Bf^o)&{_uBv}Py zulRfeE8g(g6HFhk_?o_;0@tz?1I+l+Y#Q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na!u$OoxLlE;WdrNlN)1 z7**de7-hZ!(%_ZllHBLg`Ir#|t>2$*xVOZ-ADZKTN?{(NUeLU9GbuG-+Axf*AZ-P1 z0ZZ*fx+ck4{XtFsbcc%GRStht@q!m*ImssGwuK+P@%gEK!f5dHymg<9nSCXsB6 zQ*{<`%^bxB($Z@5286^-A(tR;r+p7B%^%$N5h%lb*Vlz-?DL9x;!j<5>~kmXP$E}m zQV|7uv4SwFs0jUervsxVUm>&9Y3DBIzc1XW|CUZrUdb<&{@D5yuLe%Xniw^x&{A2s z0q1+owDSfc3Gs?ht;3jw49c#mmrViUfX-yvc_B*wY|Lo7; zGh!t2R#BHx{1wFXReX*~`NS-LpSX z#TV*miO^~B9PF%O0huw!1Zv>^d0G3$^8dsC6VI!$oKDKiXdJt{mGkyA`+Gwd4D-^1qtNTUK)`N*=NTG-6}=5k6suNfdLt*dt8D| z%H#$k)z#ZRcf|zDWB|pn<3+7Nz>?WW9WdkO5(a^m+D4WRJ9{wc>Y}IN)2Kbgn;_O? zGqdr&9~|$Y0tP=N(k7^Eu;iO*w+f%W`20BNo)=Xa@M_)+o$4LXJyiw{F?a633SC{B zl~9FH%?^Rm*LVz`lkULs)%idDX^O)SxQol(3jDRyBVR!7d`;ar+D7do)jQ}m`g$TevUD5@?*P8)voa?kEe@_hl{_h8j&5eB-5FrYW&*FHVt$ z$kRF9Nstj%KRzpjdd_9wO=4zO8ritN*NPk_9avYrsF(!4))tm{Ga#OY z(r{0buexOzu7+rw8E08Gxd`LTOID{*AC1m*6Nw@osfB%0oBF5sf<~wH1kL;sd zo)k6^VyRFU`)dt*iX^9&QtWbo6yE8XXH?`ztvpiOLgI3R+=MOBQ9=rMVgi<*CU%+d1PQQ0a1U=&b0vkF207%xU0ssI2 literal 0 HcmV?d00001 diff --git a/core/designsystem/src/main/res/mipmap-mdpi/ic_launcher.webp b/core/designsystem/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..4f0f1d64e58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{+wOsxKc>)(pMupKF!Y2HoUqQ3|Yu|8lwR=?5zZuhG6J?H`bSNk_wPoM{u zSL{c@pY7+c2kck>`^q1^^gR0QB7Y?KUD{vz-uVX~;V-rW)PDcI)$_UjgVV?S?=oLR zf4}zz{#*R_{LkiJ#0RdQLNC^2Vp%JPEUvG9ra2BVZ92(p9h7Ka@!yf9(lj#}>+|u* z;^_?KWdzkM`6gqPo9;;r6&JEa)}R3X{(CWv?NvgLeOTq$cZXqf7|sPImi-7cS8DCN zGf;DVt3Am`>hH3{4-WzH43Ftx)SofNe^-#|0HdCo<+8Qs!}TZP{HH8~z5n`ExcHuT zDL1m&|DVpIy=xsLO>8k92HcmfSKhflQ0H~9=^-{#!I1g(;+44xw~=* zxvNz35vfsQE)@)Zsp*6_GjYD};Squ83<_?^SbALb{a`j<0Gn%6JY!zhp=Fg}Ga2|8 z52e1WU%^L1}15Ex0fF$e@eCT(()_P zvV?CA%#Sy08_U6VPt4EtmVQraWJX` zh=N|WQ>LgrvF~R&qOfB$!%D3cGv?;Xh_z$z7k&s4N)$WYf*k=|*jCEkO19{h_(%W4 zPuOqbCw`SeAX*R}UUsbVsgtuG?xs(#Ikx9`JZoQFz0n*7ZG@Fv@kZk`gzO$HoA9kN z8U5{-yY zvV{`&WKU2$mZeoBmiJrEdzUZAv1sRxpePdg1)F*X^Y)zp^Y*R;;z~vOv-z&)&G)JQ{m!C9cmziu1^nHA z`#`0c>@PnQ9CJKgC5NjJD8HM3|KC(g5nnCq$n0Gsu_DXk36@ql%npEye|?%RmG)

FJ$wK}0tWNB{uH;AM~i literal 0 HcmV?d00001 diff --git a/core/designsystem/src/main/res/mipmap-xhdpi/ic_launcher.webp b/core/designsystem/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..948a3070fe34c611c42c0d3ad3013a0dce358be0 GIT binary patch literal 1900 zcmV-y2b1_xNk&Fw2LJ$9MM6+kP&il$0000G0001A003VA06|PpNH75a00DqwTbm-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JvmpTU|&q1^?^cIMn2RQ?jeSB95l}{DrEPTW{_gmU_pqTc)h@4T>~& zluq3)GM=xa(#^VU5}@FNqpc$?#SbVsX!~RH*5p0p@w z;~v{QMX0^bFT1!cXGM8K9FP+=9~-d~#TK#ZE{4umGT=;dfvWi?rYj;^l_Zxywze`W z^Cr{55U@*BalS}K%Czii_80e0#0#Zkhlij4-~I@}`-JFJ7$5{>LnoJSs??J8kWVl6|8A}RCGAu9^rAsfCE=2}tHwl93t0C?#+jMpvr7O3`2=tr{Hg$=HlnjVG^ewm|Js0J*kfPa6*GhtB>`fN!m#9J(sU!?(OSfzY*zS(FJ<-Vb zfAIg+`U)YaXv#sY(c--|X zEB+TVyZ%Ie4L$gi#Fc++`h6%vzsS$pjz9aLt+ZL(g;n$Dzy5=m=_TV(3H8^C{r0xd zp#a%}ht55dOq?yhwYPrtp-m1xXp;4X;)NhxxUpgP%XTLmO zcjaFva^}dP3$&sfFTIR_jC=2pHh9kpI@2(6V*GQo7Ws)`j)hd+tr@P~gR*2gO@+1? zG<`_tB+LJuF|SZ9tIec;h%}}6WClT`L>HSW?E{Hp1h^+mlbf_$9zA>!ug>NALJsO{ mU%z=YwVD?}XMya)Bp;vlyE5&E_6!fzx9pwrdz474!~g(M6R?N? literal 0 HcmV?d00001 diff --git a/core/designsystem/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/core/designsystem/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..1b9a6956b3acdc11f40ce2bb3f6efbd845cc243f GIT binary patch literal 3918 zcmV-U53%r4Nk&FS4*&pHMM6+kP&il$0000G0001A003VA06|PpNSy@$00HoY|G(*G z+qV7x14$dSO^Re!iqt-AAIE9iwr$(CZQJL$blA4B`>;C3fBY6Q8_YSjb2%a=fc}4E zrSzssacq<^nmW|Rs93PJni30R<8w<(bK_$LO4L?!_OxLl$}K$MUEllnMK|rg=f3;y z*?;3j|Nh>)p0JQ3A~rf(MibH2r+)3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themes.xml b/core/designsystem/src/main/res/values-night/themes.xml new file mode 100644 index 00000000..a810ac43 --- /dev/null +++ b/core/designsystem/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/core/designsystem/src/main/res/values/colors.xml b/core/designsystem/src/main/res/values/colors.xml new file mode 100644 index 00000000..f8c6127d --- /dev/null +++ b/core/designsystem/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/core/designsystem/src/main/res/values/dimens.xml b/core/designsystem/src/main/res/values/dimens.xml new file mode 100644 index 00000000..ec08bbdc --- /dev/null +++ b/core/designsystem/src/main/res/values/dimens.xml @@ -0,0 +1,8 @@ + + + 64dp + 32dp + 16dp + 8dp + 4dp + \ No newline at end of file diff --git a/core/designsystem/src/main/res/values/strings.xml b/core/designsystem/src/main/res/values/strings.xml new file mode 100644 index 00000000..c7fbb195 --- /dev/null +++ b/core/designsystem/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + designsystem + \ No newline at end of file diff --git a/core/designsystem/src/main/res/values/themes.xml b/core/designsystem/src/main/res/values/themes.xml new file mode 100644 index 00000000..400ee794 --- /dev/null +++ b/core/designsystem/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/core/model/.gitignore b/core/model/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/core/model/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/core/model/build.gradle.kts b/core/model/build.gradle.kts new file mode 100644 index 00000000..17358ddb --- /dev/null +++ b/core/model/build.gradle.kts @@ -0,0 +1,6 @@ +plugins { + id("org.fptn.vpn.library.kotlin") +} + +dependencies { +} diff --git a/core/model/proguard-rules.pro b/core/model/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/core/model/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/core/model/src/main/kotlin/org/fptn/vpn/core/model/UserData.kt b/core/model/src/main/kotlin/org/fptn/vpn/core/model/UserData.kt new file mode 100644 index 00000000..91592175 --- /dev/null +++ b/core/model/src/main/kotlin/org/fptn/vpn/core/model/UserData.kt @@ -0,0 +1,5 @@ +package org.fptn.vpn.core.model + +data class UserData( + val token: String, +) diff --git a/core/network/.gitignore b/core/network/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/core/network/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts new file mode 100644 index 00000000..e54696cb --- /dev/null +++ b/core/network/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + id("org.fptn.vpn.library.android") + id("org.fptn.vpn.library.koin") +} + +android { + namespace = "org.fptn.vpn.core.network" +} + +dependencies { + implementation(libs.androidx.tracing) + implementation(libs.koin.core) + implementation(libs.kotlinx.coroutines.core) +} diff --git a/core/network/proguard-rules.pro b/core/network/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/core/network/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/core/network/src/main/AndroidManifest.xml b/core/network/src/main/AndroidManifest.xml new file mode 100644 index 00000000..d7546021 --- /dev/null +++ b/core/network/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/core/network/src/main/kotlin/org/fptn/vpn/core/network/ConnectivityManagerNetworkMonitor.kt b/core/network/src/main/kotlin/org/fptn/vpn/core/network/ConnectivityManagerNetworkMonitor.kt new file mode 100644 index 00000000..288925c6 --- /dev/null +++ b/core/network/src/main/kotlin/org/fptn/vpn/core/network/ConnectivityManagerNetworkMonitor.kt @@ -0,0 +1,76 @@ +package org.fptn.vpn.core.network + +import android.content.Context +import android.net.ConnectivityManager +import android.net.ConnectivityManager.NetworkCallback +import android.net.Network +import android.net.NetworkCapabilities +import android.net.NetworkRequest +import android.net.NetworkRequest.Builder +import androidx.tracing.trace +import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.channels.awaitClose +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.callbackFlow +import kotlinx.coroutines.flow.conflate +import kotlinx.coroutines.flow.flowOn + +internal class ConnectivityManagerNetworkMonitor( + private val context: Context, + ioDispatcher: CoroutineDispatcher, +) : NetworkMonitor { + override val isOnline: Flow = + callbackFlow { + trace("NetworkMonitor.callbackFlow") { + val connectivityManager = context.getSystemService("ftpn.vpn") as? ConnectivityManager + if (connectivityManager == null) { + channel.trySend(false) + channel.close() + return@callbackFlow + } + + /** + * The callback's methods are invoked on changes to *any* network matching the [NetworkRequest], + * not just the active network. So we can simply track the presence (or absence) of such [Network]. + */ + val callback = + object : NetworkCallback() { + private val networks = mutableSetOf() + + override fun onAvailable(network: Network) { + networks += network + channel.trySend(true) + } + + override fun onLost(network: Network) { + networks -= network + channel.trySend(networks.isNotEmpty()) + } + } + + trace("NetworkMonitor.registerNetworkCallback") { + val request = + Builder() + .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) + .build() + connectivityManager.registerNetworkCallback(request, callback) + } + + /** + * Sends the latest connectivity status to the underlying channel. + */ + channel.trySend(connectivityManager.isCurrentlyConnected()) + + awaitClose { + connectivityManager.unregisterNetworkCallback(callback) + } + } + }.flowOn(ioDispatcher) + .conflate() + + @Suppress("DEPRECATION") + private fun ConnectivityManager.isCurrentlyConnected(): Boolean = + activeNetwork + ?.let(::getNetworkCapabilities) + ?.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) ?: false +} diff --git a/core/network/src/main/kotlin/org/fptn/vpn/core/network/NetworkModule.kt b/core/network/src/main/kotlin/org/fptn/vpn/core/network/NetworkModule.kt new file mode 100644 index 00000000..0ecad0bf --- /dev/null +++ b/core/network/src/main/kotlin/org/fptn/vpn/core/network/NetworkModule.kt @@ -0,0 +1,8 @@ +package org.fptn.vpn.core.network + +import org.koin.dsl.module + +val networkModule = + module { + single { ConnectivityManagerNetworkMonitor(get(), get()) } + } diff --git a/core/network/src/main/kotlin/org/fptn/vpn/core/network/NetworkMonitor.kt b/core/network/src/main/kotlin/org/fptn/vpn/core/network/NetworkMonitor.kt new file mode 100644 index 00000000..ffae2156 --- /dev/null +++ b/core/network/src/main/kotlin/org/fptn/vpn/core/network/NetworkMonitor.kt @@ -0,0 +1,7 @@ +package org.fptn.vpn.core.network + +import kotlinx.coroutines.flow.Flow + +interface NetworkMonitor { + val isOnline: Flow +} diff --git a/core/persistent/.gitignore b/core/persistent/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/core/persistent/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/core/persistent/build.gradle.kts b/core/persistent/build.gradle.kts new file mode 100644 index 00000000..f75e3e4c --- /dev/null +++ b/core/persistent/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + id("org.fptn.vpn.library.android") + id("org.fptn.vpn.library.koin") +} + +android { + namespace = "org.fptn.vpn.core.persistent" +} + +dependencies { + implementation(libs.datastore) + implementation(libs.koin.core) +} diff --git a/core/persistent/proguard-rules.pro b/core/persistent/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/core/persistent/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/PreferencesStore.kt b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/PreferencesStore.kt new file mode 100644 index 00000000..842006b1 --- /dev/null +++ b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/PreferencesStore.kt @@ -0,0 +1,41 @@ +package org.fptn.vpn.core.persistent + +import android.content.Context +import androidx.datastore.core.DataStore +import androidx.datastore.preferences.core.Preferences +import androidx.datastore.preferences.core.edit +import androidx.datastore.preferences.core.stringPreferencesKey +import androidx.datastore.preferences.preferencesDataStore +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.map + +private const val DATA_STORE_NAME = "PvnDataPreferencesStore" +private const val BASE_NAMESPACE = "org.fptn.vpn" +const val PREFERENCE_CLIENT_UID = BASE_NAMESPACE + "current.client.uid" +private val PREFERENCE_CLIENT_TOKEN_KEY = stringPreferencesKey(PREFERENCE_CLIENT_UID) + +val Context.dataStore: DataStore by preferencesDataStore(DATA_STORE_NAME) + +interface PreferenceStore { + val token: Flow + + suspend fun updateToken(token: String) + + suspend fun clearAllData() +} + +class PreferencesStoreImpl( + context: Context, +) : PreferenceStore { + private val dataStore: DataStore = context.dataStore + + override val token: Flow = dataStore.data.map { data -> data[PREFERENCE_CLIENT_TOKEN_KEY] } + + override suspend fun updateToken(token: String) { + dataStore.edit { preferences -> preferences[PREFERENCE_CLIENT_TOKEN_KEY] = token } + } + + override suspend fun clearAllData() { + dataStore.edit { it.clear() } + } +} diff --git a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/PersistentModule.kt b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/PersistentModule.kt new file mode 100644 index 00000000..2f557682 --- /dev/null +++ b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/PersistentModule.kt @@ -0,0 +1,10 @@ +package org.fptn.vpn.core.persistent.di + +import org.fptn.vpn.core.persistent.PreferenceStore +import org.fptn.vpn.core.persistent.PreferencesStoreImpl +import org.koin.dsl.module + +val persistentModule = + module { + single { PreferencesStoreImpl(get()) } + } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8b0b9db1..35f824a4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,10 +1,14 @@ [versions] activity = "1.10.1" +androidxComposeBom="2025.06.01" appcompat = "1.7.1" autonomousappsSorting = "0.14" autonomousappsUnused = "2.19.0" +composeConstraintLayout = "1.1.1" constraintlayout = "2.2.1" +coroutinesCore = "1.10.2" crashlytics = "3.0.5" +datastore = "1.1.7" detektPlugin = "1.23.8" firebaseBom = "33.16.0" firebaseCrashlyticsPlugin = "3.0.5" @@ -14,27 +18,49 @@ guava = "33.4.8-jre" ipaddress = "5.5.1" jacksonDatabind = "2.19.2" java = "17" +javaPoet = "1.13.0" junit = "4.13.2" junitTest = "1.2.1" +koin = "4.1.0" kotlin = "2.2.0" ksp = "2.2.0-2.0.2" lombock = "1.18.38" material = "1.12.0" monitor = "1.7.2" +navigation = "2.9.1" protobuf = "4.26.1" roomRuntime = "2.7.2" +splashScreen = "1.0.1" +timber = "5.0.1" +tracing = "1.3.0" zxing = "3.5.3" [libraries] android-gradle-plugin = { group = "com.android.tools.build", name = "gradle", version.ref = "gradlePlugin" } androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } +androidx-activity-compose = { group = "androidx.activity", name = "activity-compose" } androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidxComposeBom" } +androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" } +androidx-compose-material-icons-core = { group = "androidx.compose.material", name = "material-icons-core" } +androidx-compose-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" } +androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" } +androidx-compose-material3-window-size = { group = "androidx.compose.material3", name = "material3-window-size-class" } +androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" } +androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" } +androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } +androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" } androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } +androidx-constraintlayout-compose = { group = "androidx.constraintlayout", name = "constraintlayout-compose", version.ref = "composeConstraintLayout" } +androidx-core-splashscreen = { group = "androidx.core", name = "core-splashscreen", version.ref = "splashScreen" } androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitTest" } androidx-monitor = { group = "androidx.test", name = "monitor", version.ref = "monitor" } +androidx-navigation-runtime-android = { group = "androidx.navigation", name = "navigation-runtime-android", version.ref = "navigation" } androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "roomRuntime" } androidx-room-guava = { module = "androidx.room:room-guava", version.ref = "roomRuntime" } androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "roomRuntime" } +androidx-tracing = { group = "androidx.tracing", name = "tracing", version.ref = "tracing" } +datastore = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "datastore" } detekt = { group = "io.gitlab.arturbosch.detekt", name = "detekt-gradle-plugin", version.ref = "detektPlugin" } firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics" } firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebaseBom" } @@ -44,16 +70,27 @@ google-services = { group = "com.google.gms", name = "google-services", version. guava = { module = "com.google.guava:guava", version.ref = "guava" } ipaddress = { module = "com.github.seancfoley:ipaddress", version.ref = "ipaddress" } jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jacksonDatabind" } +java-poet = { group = "com.squareup", name = "javapoet", version.ref = "javaPoet" } junit = { group = "junit", name = "junit", version.ref = "junit" } +koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koin" } +koin-androidx-compose = { group = "io.insert-koin", name = "koin-androidx-compose" } +koin-androidx-runtime-android = { group = "io.insert-koin", name = "koin-androidx-runtime-android" } +koin-bom = { group = "io.insert-koin", name = "koin-bom", version.ref = "koin" } +koin-core = { group = "io.insert-koin", name = "koin-core" } +koin-core-viewmodel-jvm = { group = "io.insert-koin", name = "koin-core-viewmodel-jvm" } +koin-test = { group = "io.insert-koin", name = "koin-test", version.ref = "koin" } kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } kotlin-metadata-jvm = { group = "org.jetbrains.kotlin", name = "kotlin-metadata-jvm", version.ref = "kotlin" } +kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutinesCore" } ksp-gradle-plugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" } lombock = { group = "org.projectlombok", name = "lombok", version.ref = "lombock" } material = { group = "com.google.android.material", name = "material", version.ref = "material" } +navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" } +timber = { group = "com.jakewharton.timber", name = "timber", version.ref = "timber" } zxing = { module = "com.google.zxing:core", version.ref = "zxing" } [plugins] +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" } deps-sorting = { id = "com.squareup.sort-dependencies", version.ref = "autonomousappsSorting" } deps-unused = { id = "com.autonomousapps.dependency-analysis", version.ref = "autonomousappsUnused" } - diff --git a/home/data/.gitignore b/home/data/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/home/data/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/home/data/build.gradle.kts b/home/data/build.gradle.kts new file mode 100644 index 00000000..6e3edd5a --- /dev/null +++ b/home/data/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id("org.fptn.vpn.library.android") +} + +android { + namespace = "org.fptn.vpn.home.data" +} + +dependencies { +} diff --git a/home/data/proguard-rules.pro b/home/data/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/home/data/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/home/domain/.gitignore b/home/domain/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/home/domain/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/home/domain/build.gradle.kts b/home/domain/build.gradle.kts new file mode 100644 index 00000000..17358ddb --- /dev/null +++ b/home/domain/build.gradle.kts @@ -0,0 +1,6 @@ +plugins { + id("org.fptn.vpn.library.kotlin") +} + +dependencies { +} diff --git a/home/domain/proguard-rules.pro b/home/domain/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/home/domain/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/home/ui/.gitignore b/home/ui/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/home/ui/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/home/ui/build.gradle.kts b/home/ui/build.gradle.kts new file mode 100644 index 00000000..b46a22f5 --- /dev/null +++ b/home/ui/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("org.fptn.vpn.library.android") +} + +android { + namespace = "org.fptn.vpn.home.ui" +} + +dependencies { + implementation(libs.androidx.navigation.runtime.android) +} diff --git a/home/ui/proguard-rules.pro b/home/ui/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/home/ui/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/home/ui/src/main/kotlin/com/filantrop/pvnclient/home/ui/navigation/HomeNavigation.kt b/home/ui/src/main/kotlin/com/filantrop/pvnclient/home/ui/navigation/HomeNavigation.kt new file mode 100644 index 00000000..08ce863b --- /dev/null +++ b/home/ui/src/main/kotlin/com/filantrop/pvnclient/home/ui/navigation/HomeNavigation.kt @@ -0,0 +1,14 @@ +package com.filantrop.pvnclient.home.ui.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavOptions + +data object HomeRoute // route to Home screen + +const val HOME_ROUTE = "homeRoute" + +data object HomeBaseRoute // route to base navigation graph + +const val HOME_BASE_ROUTE = "homeRouteStr" + +fun NavController.navigateToHome(navOptions: NavOptions) = navigate(route = HomeRoute, navOptions) diff --git a/settings.gradle.kts b/settings.gradle.kts index 546ea2eb..9404eecb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,5 +9,18 @@ pluginManagement { } include(":app") +include(":auth:data") +include(":auth:domain") +include(":auth:ui") include(":core:common") +include(":core:designsystem") +include(":core:model") +include(":core:network") +include(":core:persistent") +include(":home:data") +include(":home:domain") +include(":home:ui") +include(":settings:data") +include(":settings:domain") +include(":settings:ui") include(":vpnclient") diff --git a/settings/data/.gitignore b/settings/data/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/settings/data/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/settings/data/build.gradle.kts b/settings/data/build.gradle.kts new file mode 100644 index 00000000..d73a179e --- /dev/null +++ b/settings/data/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id("org.fptn.vpn.library.android") +} + +android { + namespace = "org.fptn.vpn.settings.data" +} + +dependencies { +} diff --git a/settings/data/proguard-rules.pro b/settings/data/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/settings/data/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/settings/domain/.gitignore b/settings/domain/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/settings/domain/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/settings/domain/build.gradle.kts b/settings/domain/build.gradle.kts new file mode 100644 index 00000000..17358ddb --- /dev/null +++ b/settings/domain/build.gradle.kts @@ -0,0 +1,6 @@ +plugins { + id("org.fptn.vpn.library.kotlin") +} + +dependencies { +} diff --git a/settings/domain/proguard-rules.pro b/settings/domain/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/settings/domain/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/settings/ui/.gitignore b/settings/ui/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/settings/ui/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/settings/ui/build.gradle.kts b/settings/ui/build.gradle.kts new file mode 100644 index 00000000..614ffaa0 --- /dev/null +++ b/settings/ui/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("org.fptn.vpn.library.android") + id("org.fptn.vpn.library.koin") +} + +android { + namespace = "org.fptn.vpn.settings.ui" +} + +dependencies { + implementation(libs.androidx.navigation.runtime.android) +} diff --git a/settings/ui/proguard-rules.pro b/settings/ui/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/settings/ui/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/settings/ui/src/main/kotlin/com/filantrop/pvnclient/settings/ui/navigation/SettingsRoute.kt b/settings/ui/src/main/kotlin/com/filantrop/pvnclient/settings/ui/navigation/SettingsRoute.kt new file mode 100644 index 00000000..8177c477 --- /dev/null +++ b/settings/ui/src/main/kotlin/com/filantrop/pvnclient/settings/ui/navigation/SettingsRoute.kt @@ -0,0 +1,10 @@ +package com.filantrop.pvnclient.settings.ui.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavOptions + +data object SettingsRoute // route to Settings screen + +const val SETTINGS_ROUTE = "settingsRoute" + +fun NavController.navigateToSettings(navOptions: NavOptions) = navigate(route = SettingsRoute, navOptions) diff --git a/vpnclient/build.gradle.kts b/vpnclient/build.gradle.kts index 3c68ba6a..17358ddb 100644 --- a/vpnclient/build.gradle.kts +++ b/vpnclient/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("pvnclient.android.library.kotlin") + id("org.fptn.vpn.library.kotlin") } dependencies { From 7b3b11ac6df70bc52d0bb830616fb55ff1057345 Mon Sep 17 00:00:00 2001 From: d9tilov <9.tilov@gmail.com> Date: Sun, 20 Jul 2025 15:08:40 +0700 Subject: [PATCH 2/7] Fixed crash --- app/build.gradle.kts | 2 +- app/src/main/AndroidManifest.xml | 30 +++++++++---------- .../kotlin/org/fptn/vpn/ui/MainActivity.kt | 3 +- app/src/main/res/values/themes.xml | 20 ++++++++++++- 4 files changed, 37 insertions(+), 18 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c020d335..de3ad52f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -38,7 +38,7 @@ android { } else { println( "Warning: keystore.properties file not found. " + - "Release signing configuration will not be applied.", + "Release signing configuration will not be applied.", ) } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2cda1143..d2d1fcac 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -20,6 +20,7 @@ tools:node="remove" /> + android:label="@string/app_name" + android:screenOrientation="portrait" + android:theme="@style/Theme.FptnClient.Splash" + android:windowSoftInputMode="adjustResize"> + android:noHistory="true" + android:screenOrientation="portrait" /> + android:screenOrientation="portrait" /> + android:screenOrientation="portrait" /> + android:screenOrientation="portrait" /> { val context = LocalContext.current - context.startActivity(Intent(context, MainActivity::class.java)) + context.startActivity(Intent(context, HomeActivity::class.java)) } } } diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 6e890323..9ced1d09 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,4 +1,4 @@ - + + + + + + From e982994d837f1910e0036cd812ebe50f6a03db49 Mon Sep 17 00:00:00 2001 From: d9tilov <9.tilov@gmail.com> Date: Sun, 20 Jul 2025 18:06:33 +0700 Subject: [PATCH 3/7] Added token pasrsing --- .../org/fptn/vpn/viewmodel/MainViewModel.kt | 2 +- build.gradle.kts | 1 + core/model/build.gradle.kts | 2 ++ .../org/fptn/vpn/core/model/FptnToken.kt | 22 +++++++++++++++++++ gradle/libs.versions.toml | 6 +++++ 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnToken.kt diff --git a/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt b/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt index 2c5fd823..58ca21be 100644 --- a/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt +++ b/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt @@ -2,7 +2,7 @@ package org.fptn.vpn.viewmodel import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.filantrop.pvnclient.auth.domain.AuthInteractor +import org.fptn.vpn.auth.domain.AuthInteractor import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.map diff --git a/build.gradle.kts b/build.gradle.kts index a850e95d..760e5349 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -79,6 +79,7 @@ plugins { alias(libs.plugins.crashlytics) apply false alias(libs.plugins.deps.sorting) apply false alias(libs.plugins.deps.unused) apply true + alias(libs.plugins.serialization) apply false } applyPrecheckOptions() diff --git a/core/model/build.gradle.kts b/core/model/build.gradle.kts index 17358ddb..04797fb3 100644 --- a/core/model/build.gradle.kts +++ b/core/model/build.gradle.kts @@ -1,6 +1,8 @@ plugins { id("org.fptn.vpn.library.kotlin") + alias(libs.plugins.serialization) } dependencies { + implementation(libs.kotlinx.serialization.json) } diff --git a/core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnToken.kt b/core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnToken.kt new file mode 100644 index 00000000..6c937fce --- /dev/null +++ b/core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnToken.kt @@ -0,0 +1,22 @@ +package org.fptn.vpn.core.model + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class FptnToken( + @SerialName("version") val version: Int, + @SerialName("service_name") val serviceName: String, + @SerialName("username") val username: String, + @SerialName("password") val password: String, + @SerialName("servers") val servers: List = emptyList(), + @SerialName("censored_zone_servers") val censoredZoneServers: List = emptyList(), +) + +@Serializable +data class FptnServer( + @SerialName("name") val name: String, + @SerialName("host") val host: String, + @SerialName("md5_fingerprint") val md5Fingerprint: String, + @SerialName("port") val port: Int, +) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 35f824a4..ba32b731 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,10 +26,12 @@ kotlin = "2.2.0" ksp = "2.2.0-2.0.2" lombock = "1.18.38" material = "1.12.0" +mockk = "1.14.5" monitor = "1.7.2" navigation = "2.9.1" protobuf = "4.26.1" roomRuntime = "2.7.2" +serialization = "1.9.0" splashScreen = "1.0.1" timber = "5.0.1" tracing = "1.3.0" @@ -81,10 +83,13 @@ koin-core-viewmodel-jvm = { group = "io.insert-koin", name = "koin-core-viewmode koin-test = { group = "io.insert-koin", name = "koin-test", version.ref = "koin" } kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } kotlin-metadata-jvm = { group = "org.jetbrains.kotlin", name = "kotlin-metadata-jvm", version.ref = "kotlin" } +kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin" } kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutinesCore" } +kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" } ksp-gradle-plugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" } lombock = { group = "org.projectlombok", name = "lombok", version.ref = "lombock" } material = { group = "com.google.android.material", name = "material", version.ref = "material" } +mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" } navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" } timber = { group = "com.jakewharton.timber", name = "timber", version.ref = "timber" } zxing = { module = "com.google.zxing:core", version.ref = "zxing" } @@ -94,3 +99,4 @@ compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = " crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" } deps-sorting = { id = "com.squareup.sort-dependencies", version.ref = "autonomousappsSorting" } deps-unused = { id = "com.autonomousapps.dependency-analysis", version.ref = "autonomousappsUnused" } +serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "serialization" } From 64b766203a8ba3b6ecba8fdc643703ef481a35ad Mon Sep 17 00:00:00 2001 From: d9tilov <9.tilov@gmail.com> Date: Thu, 24 Jul 2025 22:39:29 +0700 Subject: [PATCH 4/7] insert servers to db --- .../main/kotlin/org/fptn/vpn/di/AppModule.kt | 2 + .../org/fptn/vpn/viewmodel/MainViewModel.kt | 2 +- config/detekt/detekt.yml | 2 + .../{AgDispatchers.kt => AppDispatchers.kt} | 2 +- .../org/fptn/vpn/core/common/CommonModule.kt | 6 +-- .../org/fptn/vpn/core/common/Constants.kt | 2 + core/model/build.gradle.kts | 2 +- .../core/model/{FptnToken.kt => FptnUser.kt} | 20 +++++++++- .../org/fptn/vpn/core/model/FptnUserDomain.kt | 17 ++++++++ .../org/fptn/vpn/core/model/UserData.kt | 5 --- .../ConnectivityManagerNetworkMonitor.kt | 1 + core/persistent/build.gradle.kts | 4 ++ .../fptn/vpn/core/persistent/AppDatabase.kt | 15 +++++++ .../vpn/core/persistent/PreferencesStore.kt | 4 +- .../vpn/core/persistent/di/DatabaseModule.kt | 18 +++++++++ .../core/persistent/model/FptnServerDao.kt | 10 +++++ .../persistent/model/FptnServerDbModel.kt | 39 +++++++++++++++++++ gradle/libs.versions.toml | 3 ++ 18 files changed, 140 insertions(+), 14 deletions(-) rename core/common/src/main/kotlin/org/fptn/vpn/core/common/{AgDispatchers.kt => AppDispatchers.kt} (89%) rename core/model/src/main/kotlin/org/fptn/vpn/core/model/{FptnToken.kt => FptnUser.kt} (60%) create mode 100644 core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnUserDomain.kt delete mode 100644 core/model/src/main/kotlin/org/fptn/vpn/core/model/UserData.kt create mode 100644 core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/AppDatabase.kt create mode 100644 core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/DatabaseModule.kt create mode 100644 core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/model/FptnServerDao.kt create mode 100644 core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/model/FptnServerDbModel.kt diff --git a/app/src/main/kotlin/org/fptn/vpn/di/AppModule.kt b/app/src/main/kotlin/org/fptn/vpn/di/AppModule.kt index 52bb93a1..0beb3df1 100644 --- a/app/src/main/kotlin/org/fptn/vpn/di/AppModule.kt +++ b/app/src/main/kotlin/org/fptn/vpn/di/AppModule.kt @@ -3,6 +3,7 @@ package org.fptn.vpn.di import com.filantrop.pvnclient.auth.ui.authModule import org.fptn.vpn.core.common.commonModule import org.fptn.vpn.core.network.networkModule +import org.fptn.vpn.core.persistent.di.databaseModule import org.fptn.vpn.core.persistent.di.persistentModule import org.fptn.vpn.viewmodel.MainViewModel import org.koin.core.module.Module @@ -20,6 +21,7 @@ val appModule: Module = authModule, commonModule, persistentModule, + databaseModule, networkModule, viewModelModule, ) diff --git a/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt b/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt index 58ca21be..5d795aba 100644 --- a/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt +++ b/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt @@ -2,11 +2,11 @@ package org.fptn.vpn.viewmodel import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import org.fptn.vpn.auth.domain.AuthInteractor import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn +import org.fptn.vpn.auth.domain.AuthInteractor import org.fptn.vpn.core.common.Result import org.fptn.vpn.core.common.asResult import org.fptn.vpn.core.model.UserData diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml index b499d432..0f516e08 100644 --- a/config/detekt/detekt.yml +++ b/config/detekt/detekt.yml @@ -129,6 +129,7 @@ complexity: LongMethod: active: true threshold: 60 + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] LongParameterList: active: false functionThreshold: 6 @@ -333,6 +334,7 @@ naming: excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] functionPattern: '[a-z][a-zA-Z0-9]*' excludeClassPattern: '$^' + ignoreAnnotated: ['Composable'] FunctionParameterNaming: active: true parameterPattern: '[a-z][A-Za-z0-9]*' diff --git a/core/common/src/main/kotlin/org/fptn/vpn/core/common/AgDispatchers.kt b/core/common/src/main/kotlin/org/fptn/vpn/core/common/AppDispatchers.kt similarity index 89% rename from core/common/src/main/kotlin/org/fptn/vpn/core/common/AgDispatchers.kt rename to core/common/src/main/kotlin/org/fptn/vpn/core/common/AppDispatchers.kt index ecb2c142..28be5249 100644 --- a/core/common/src/main/kotlin/org/fptn/vpn/core/common/AgDispatchers.kt +++ b/core/common/src/main/kotlin/org/fptn/vpn/core/common/AppDispatchers.kt @@ -1,6 +1,6 @@ package org.fptn.vpn.core.common -object AgDispatchers { +object AppDispatchers { const val DISPATCHER_DEFAULT = "DispatcherDefault" const val DISPATCHER_IO = "DispatcherIO" const val DISPATCHER_UNCONFINED = "DispatcherUnconfined" diff --git a/core/common/src/main/kotlin/org/fptn/vpn/core/common/CommonModule.kt b/core/common/src/main/kotlin/org/fptn/vpn/core/common/CommonModule.kt index 41a0c699..5f90d65c 100644 --- a/core/common/src/main/kotlin/org/fptn/vpn/core/common/CommonModule.kt +++ b/core/common/src/main/kotlin/org/fptn/vpn/core/common/CommonModule.kt @@ -1,9 +1,9 @@ package org.fptn.vpn.core.common import kotlinx.coroutines.Dispatchers -import org.fptn.vpn.core.common.AgDispatchers.DISPATCHER_DEFAULT -import org.fptn.vpn.core.common.AgDispatchers.DISPATCHER_IO -import org.fptn.vpn.core.common.AgDispatchers.DISPATCHER_UNCONFINED +import org.fptn.vpn.core.common.AppDispatchers.DISPATCHER_DEFAULT +import org.fptn.vpn.core.common.AppDispatchers.DISPATCHER_IO +import org.fptn.vpn.core.common.AppDispatchers.DISPATCHER_UNCONFINED import org.koin.core.qualifier.named import org.koin.dsl.module diff --git a/core/common/src/main/kotlin/org/fptn/vpn/core/common/Constants.kt b/core/common/src/main/kotlin/org/fptn/vpn/core/common/Constants.kt index 5bbab1fc..125d53d2 100644 --- a/core/common/src/main/kotlin/org/fptn/vpn/core/common/Constants.kt +++ b/core/common/src/main/kotlin/org/fptn/vpn/core/common/Constants.kt @@ -2,6 +2,8 @@ package org.fptn.vpn.core.common object Constants { const val APPLICATION_SHARED_PREFERENCES = "fptnvpn-shared-preferences" + const val DATABASE_NAME = "FptnDatabase" + const val DEFAULT_DATA_ID = 0 const val MAIN_NOTIFICATION_CHANNEL_ID = "fptnvpn-notification-main" const val MAIN_NOTIFICATION_CHANNEL_VERSION = "fptnvpn-notification-main-channel-version" const val MAIN_NOTIFICATION_CHANNEL_VERSION_NUM = 2 diff --git a/core/model/build.gradle.kts b/core/model/build.gradle.kts index 04797fb3..6350cade 100644 --- a/core/model/build.gradle.kts +++ b/core/model/build.gradle.kts @@ -4,5 +4,5 @@ plugins { } dependencies { - implementation(libs.kotlinx.serialization.json) + implementation(libs.kotlinx.serialization.core.jvm) } diff --git a/core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnToken.kt b/core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnUser.kt similarity index 60% rename from core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnToken.kt rename to core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnUser.kt index 6c937fce..91f48c05 100644 --- a/core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnToken.kt +++ b/core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnUser.kt @@ -4,7 +4,7 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable -data class FptnToken( +data class FptnUser( @SerialName("version") val version: Int, @SerialName("service_name") val serviceName: String, @SerialName("username") val username: String, @@ -20,3 +20,21 @@ data class FptnServer( @SerialName("md5_fingerprint") val md5Fingerprint: String, @SerialName("port") val port: Int, ) + +fun FptnUser.toDomain() = + FptnUserDomain( + version = version, + serviceName = serviceName, + username = username, + password = password, + servers = servers.map { it.toDomain() }, + censoredZoneServers = censoredZoneServers.map { it.toDomain() }, + ) + +fun FptnServer.toDomain() = + FptnServerDomain( + name = name, + host = host, + md5Fingerprint = md5Fingerprint, + port = port, + ) diff --git a/core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnUserDomain.kt b/core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnUserDomain.kt new file mode 100644 index 00000000..dc1694c3 --- /dev/null +++ b/core/model/src/main/kotlin/org/fptn/vpn/core/model/FptnUserDomain.kt @@ -0,0 +1,17 @@ +package org.fptn.vpn.core.model + +data class FptnUserDomain( + val version: Int, + val serviceName: String, + val username: String, + val password: String, + val servers: List = emptyList(), + val censoredZoneServers: List = emptyList(), +) + +data class FptnServerDomain( + val name: String, + val host: String, + val md5Fingerprint: String, + val port: Int, +) diff --git a/core/model/src/main/kotlin/org/fptn/vpn/core/model/UserData.kt b/core/model/src/main/kotlin/org/fptn/vpn/core/model/UserData.kt deleted file mode 100644 index 91592175..00000000 --- a/core/model/src/main/kotlin/org/fptn/vpn/core/model/UserData.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.fptn.vpn.core.model - -data class UserData( - val token: String, -) diff --git a/core/network/src/main/kotlin/org/fptn/vpn/core/network/ConnectivityManagerNetworkMonitor.kt b/core/network/src/main/kotlin/org/fptn/vpn/core/network/ConnectivityManagerNetworkMonitor.kt index 288925c6..942f0756 100644 --- a/core/network/src/main/kotlin/org/fptn/vpn/core/network/ConnectivityManagerNetworkMonitor.kt +++ b/core/network/src/main/kotlin/org/fptn/vpn/core/network/ConnectivityManagerNetworkMonitor.kt @@ -19,6 +19,7 @@ internal class ConnectivityManagerNetworkMonitor( private val context: Context, ioDispatcher: CoroutineDispatcher, ) : NetworkMonitor { + @Suppress("LabeledExpression") override val isOnline: Flow = callbackFlow { trace("NetworkMonitor.callbackFlow") { diff --git a/core/persistent/build.gradle.kts b/core/persistent/build.gradle.kts index f75e3e4c..a71d5a55 100644 --- a/core/persistent/build.gradle.kts +++ b/core/persistent/build.gradle.kts @@ -8,6 +8,10 @@ android { } dependencies { + implementation(project(":core:common")) + implementation(project(":core:model")) + implementation(libs.androidx.room.runtime) implementation(libs.datastore) + implementation(libs.koin.android) implementation(libs.koin.core) } diff --git a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/AppDatabase.kt b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/AppDatabase.kt new file mode 100644 index 00000000..3599dbc7 --- /dev/null +++ b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/AppDatabase.kt @@ -0,0 +1,15 @@ +package org.fptn.vpn.core.persistent + +import androidx.room.Database +import androidx.room.RoomDatabase +import org.fptn.vpn.core.persistent.AppDatabase.Companion.VERSION_NUMBER +import org.fptn.vpn.core.persistent.model.FptnServerDbModel + +@Database(entities = [FptnServerDbModel::class], version = VERSION_NUMBER, exportSchema = false) +abstract class AppDatabase : RoomDatabase() { + abstract fun serverDao(): FptnServerDbModel + + companion object { + const val VERSION_NUMBER = 10 + } +} diff --git a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/PreferencesStore.kt b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/PreferencesStore.kt index 842006b1..d3a5e2fa 100644 --- a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/PreferencesStore.kt +++ b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/PreferencesStore.kt @@ -17,7 +17,7 @@ private val PREFERENCE_CLIENT_TOKEN_KEY = stringPreferencesKey(PREFERENCE_CLIENT val Context.dataStore: DataStore by preferencesDataStore(DATA_STORE_NAME) interface PreferenceStore { - val token: Flow + val token: Flow suspend fun updateToken(token: String) @@ -29,7 +29,7 @@ class PreferencesStoreImpl( ) : PreferenceStore { private val dataStore: DataStore = context.dataStore - override val token: Flow = dataStore.data.map { data -> data[PREFERENCE_CLIENT_TOKEN_KEY] } + override val token: Flow = dataStore.data.map { data -> data[PREFERENCE_CLIENT_TOKEN_KEY].orEmpty() } override suspend fun updateToken(token: String) { dataStore.edit { preferences -> preferences[PREFERENCE_CLIENT_TOKEN_KEY] = token } diff --git a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/DatabaseModule.kt b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/DatabaseModule.kt new file mode 100644 index 00000000..f077eca2 --- /dev/null +++ b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/DatabaseModule.kt @@ -0,0 +1,18 @@ +package org.fptn.vpn.core.persistent.di + +import androidx.room.Room +import androidx.room.RoomDatabase +import org.fptn.vpn.core.common.Constants.DATABASE_NAME +import org.fptn.vpn.core.persistent.AppDatabase +import org.koin.android.ext.koin.androidContext +import org.koin.dsl.module + +val databaseModule = + module { + single { + Room + .databaseBuilder(androidContext(), AppDatabase::class.java, DATABASE_NAME) + .setJournalMode(RoomDatabase.JournalMode.TRUNCATE) + .build() + } + } diff --git a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/model/FptnServerDao.kt b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/model/FptnServerDao.kt new file mode 100644 index 00000000..a5b16a01 --- /dev/null +++ b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/model/FptnServerDao.kt @@ -0,0 +1,10 @@ +package org.fptn.vpn.core.persistent.model + +import androidx.room.Dao +import androidx.room.Upsert + +@Dao +interface FptnServerDao { + @Upsert + suspend fun insert(user: FptnServerDbModel) +} diff --git a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/model/FptnServerDbModel.kt b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/model/FptnServerDbModel.kt new file mode 100644 index 00000000..340df687 --- /dev/null +++ b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/model/FptnServerDbModel.kt @@ -0,0 +1,39 @@ +package org.fptn.vpn.core.persistent.model + +import androidx.room.ColumnInfo +import androidx.room.Entity +import androidx.room.PrimaryKey +import org.fptn.vpn.core.common.Constants.DEFAULT_DATA_ID +import org.fptn.vpn.core.model.FptnServerDomain + +@Entity(tableName = "server_table") +data class FptnServerDbModel( + @PrimaryKey(autoGenerate = true) + @ColumnInfo(name = "id") val id: Int, + @ColumnInfo(name = "isSelected") val isSelected: Boolean, + @ColumnInfo(name = "name") val name: String, + @ColumnInfo(name = "username") val username: String, + @ColumnInfo(name = "password") val password: String, + @ColumnInfo(name = "host") val host: String, + @ColumnInfo(name = "port") val port: Int, + @ColumnInfo(name = "countryCode") val countryCode: String, + @ColumnInfo(name = "md5ServerFingerprint") val md5ServerFingerprint: String, + @ColumnInfo(name = "censured") val censured: Boolean, +) + +fun FptnServerDomain.toDbModel( + username: String, + password: String, + censured: Boolean, +) = FptnServerDbModel( + id = DEFAULT_DATA_ID, + isSelected = false, + name = name, + username = username, + password = password, + host = host, + port = port, + countryCode = "US", + md5ServerFingerprint = md5Fingerprint, + censured = censured, +) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ba32b731..ba0eb5f1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,6 +22,7 @@ javaPoet = "1.13.0" junit = "4.13.2" junitTest = "1.2.1" koin = "4.1.0" +koinAnnotations = "2.1.0" kotlin = "2.2.0" ksp = "2.2.0-2.0.2" lombock = "1.18.38" @@ -77,6 +78,7 @@ junit = { group = "junit", name = "junit", version.ref = "junit" } koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koin" } koin-androidx-compose = { group = "io.insert-koin", name = "koin-androidx-compose" } koin-androidx-runtime-android = { group = "io.insert-koin", name = "koin-androidx-runtime-android" } +koin-annotations-jvm = { group = "io.insert-koin", name = "koin-annotations-jvm", version.ref = "koinAnnotations" } koin-bom = { group = "io.insert-koin", name = "koin-bom", version.ref = "koin" } koin-core = { group = "io.insert-koin", name = "koin-core" } koin-core-viewmodel-jvm = { group = "io.insert-koin", name = "koin-core-viewmodel-jvm" } @@ -86,6 +88,7 @@ kotlin-metadata-jvm = { group = "org.jetbrains.kotlin", name = "kotlin-metadata- kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin" } kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutinesCore" } kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" } +kotlinx-serialization-core-jvm = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core-jvm", version.ref = "serialization" } ksp-gradle-plugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" } lombock = { group = "org.projectlombok", name = "lombok", version.ref = "lombock" } material = { group = "com.google.android.material", name = "material", version.ref = "material" } From ef72d409e0b022fe8296cbeb10b066ae090753b6 Mon Sep 17 00:00:00 2001 From: d9tilov <9.tilov@gmail.com> Date: Fri, 25 Jul 2025 22:43:13 +0700 Subject: [PATCH 5/7] Fixed build --- app/build.gradle.kts | 2 -- .../org/fptn/vpn/viewmodel/MainViewModel.kt | 6 +++--- .../gradle/AndroidApplicationConventionPlugin.kt | 3 --- .../src/main/res/values-night/themes.xml | 16 ---------------- core/designsystem/src/main/res/values/themes.xml | 16 ---------------- gradle/libs.versions.toml | 2 +- settings/ui/build.gradle.kts | 1 - 7 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 core/designsystem/src/main/res/values-night/themes.xml delete mode 100644 core/designsystem/src/main/res/values/themes.xml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index de3ad52f..391fa2be 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -131,7 +131,6 @@ dependencies { implementation(libs.androidx.activity.compose) implementation(libs.androidx.appcompat) implementation(libs.androidx.compose.foundation) - implementation(libs.androidx.compose.material3) implementation(libs.androidx.compose.ui) implementation(libs.androidx.constraintlayout) implementation(libs.androidx.core.splashscreen) @@ -153,7 +152,6 @@ dependencies { annotationProcessor(libs.lombock) testImplementation(libs.junit) - testImplementation(libs.koin.test) androidTestImplementation(libs.androidx.junit) } diff --git a/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt b/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt index 5d795aba..2934d434 100644 --- a/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt +++ b/app/src/main/kotlin/org/fptn/vpn/viewmodel/MainViewModel.kt @@ -9,13 +9,13 @@ import kotlinx.coroutines.flow.stateIn import org.fptn.vpn.auth.domain.AuthInteractor import org.fptn.vpn.core.common.Result import org.fptn.vpn.core.common.asResult -import org.fptn.vpn.core.model.UserData +import org.fptn.vpn.core.model.FptnUserDomain class MainViewModel( authInteractor: AuthInteractor, ) : ViewModel() { val uiState: StateFlow = - authInteractor.userData + authInteractor.user .asResult() .map { result -> when (result) { @@ -40,7 +40,7 @@ sealed interface AuthActivityUiState { data object Login : AuthActivityUiState data class Main( - val userData: UserData, + val userData: FptnUserDomain, ) : AuthActivityUiState /** diff --git a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationConventionPlugin.kt b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationConventionPlugin.kt index 919375ca..0318d7be 100644 --- a/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationConventionPlugin.kt +++ b/buildSrc/src/main/kotlin/org/fptn/vpn/gradle/AndroidApplicationConventionPlugin.kt @@ -1,10 +1,8 @@ package org.fptn.vpn.gradle import com.android.build.api.dsl.ApplicationExtension -import org.fptn.vpn.gradle.extensions.buildLibs import org.fptn.vpn.gradle.extensions.configureAndroidFirebase import org.fptn.vpn.gradle.extensions.configureKotlinAndroid -import org.fptn.vpn.gradle.extensions.implementation import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure @@ -28,7 +26,6 @@ class AndroidApplicationConventionPlugin : Plugin { val extension = extensions.getByType() configureAndroidFirebase(extension) dependencies { - implementation(buildLibs.timber) } } } diff --git a/core/designsystem/src/main/res/values-night/themes.xml b/core/designsystem/src/main/res/values-night/themes.xml deleted file mode 100644 index a810ac43..00000000 --- a/core/designsystem/src/main/res/values-night/themes.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/core/designsystem/src/main/res/values/themes.xml b/core/designsystem/src/main/res/values/themes.xml deleted file mode 100644 index 400ee794..00000000 --- a/core/designsystem/src/main/res/values/themes.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ba0eb5f1..3ce627aa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -87,8 +87,8 @@ kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-p kotlin-metadata-jvm = { group = "org.jetbrains.kotlin", name = "kotlin-metadata-jvm", version.ref = "kotlin" } kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin" } kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutinesCore" } -kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" } kotlinx-serialization-core-jvm = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core-jvm", version.ref = "serialization" } +kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" } ksp-gradle-plugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" } lombock = { group = "org.projectlombok", name = "lombok", version.ref = "lombock" } material = { group = "com.google.android.material", name = "material", version.ref = "material" } diff --git a/settings/ui/build.gradle.kts b/settings/ui/build.gradle.kts index 614ffaa0..a1316926 100644 --- a/settings/ui/build.gradle.kts +++ b/settings/ui/build.gradle.kts @@ -1,6 +1,5 @@ plugins { id("org.fptn.vpn.library.android") - id("org.fptn.vpn.library.koin") } android { From 3dad9e557ae0a3105081d066d0c5d5bba323b557 Mon Sep 17 00:00:00 2001 From: d9tilov <9.tilov@gmail.com> Date: Sun, 27 Jul 2025 11:29:07 +0700 Subject: [PATCH 6/7] Fixed crash --- core/persistent/build.gradle.kts | 2 ++ .../main/kotlin/org/fptn/vpn/core/persistent/AppDatabase.kt | 3 ++- .../kotlin/org/fptn/vpn/core/persistent/di/DatabaseModule.kt | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/persistent/build.gradle.kts b/core/persistent/build.gradle.kts index a71d5a55..210c0130 100644 --- a/core/persistent/build.gradle.kts +++ b/core/persistent/build.gradle.kts @@ -14,4 +14,6 @@ dependencies { implementation(libs.datastore) implementation(libs.koin.android) implementation(libs.koin.core) + + ksp(libs.androidx.room.compiler) } diff --git a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/AppDatabase.kt b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/AppDatabase.kt index 3599dbc7..93153daf 100644 --- a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/AppDatabase.kt +++ b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/AppDatabase.kt @@ -3,11 +3,12 @@ package org.fptn.vpn.core.persistent import androidx.room.Database import androidx.room.RoomDatabase import org.fptn.vpn.core.persistent.AppDatabase.Companion.VERSION_NUMBER +import org.fptn.vpn.core.persistent.model.FptnServerDao import org.fptn.vpn.core.persistent.model.FptnServerDbModel @Database(entities = [FptnServerDbModel::class], version = VERSION_NUMBER, exportSchema = false) abstract class AppDatabase : RoomDatabase() { - abstract fun serverDao(): FptnServerDbModel + abstract fun serverDao(): FptnServerDao companion object { const val VERSION_NUMBER = 10 diff --git a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/DatabaseModule.kt b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/DatabaseModule.kt index f077eca2..12f45f5a 100644 --- a/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/DatabaseModule.kt +++ b/core/persistent/src/main/kotlin/org/fptn/vpn/core/persistent/di/DatabaseModule.kt @@ -4,6 +4,7 @@ import androidx.room.Room import androidx.room.RoomDatabase import org.fptn.vpn.core.common.Constants.DATABASE_NAME import org.fptn.vpn.core.persistent.AppDatabase +import org.fptn.vpn.core.persistent.model.FptnServerDao import org.koin.android.ext.koin.androidContext import org.koin.dsl.module @@ -15,4 +16,5 @@ val databaseModule = .setJournalMode(RoomDatabase.JournalMode.TRUNCATE) .build() } + single { get().serverDao() } } From e73c52d0a50bc96420de0bc63b8451c899c9250f Mon Sep 17 00:00:00 2001 From: d9tilov <9.tilov@gmail.com> Date: Sun, 27 Jul 2025 12:25:09 +0700 Subject: [PATCH 7/7] Fixed issue with token --- .../kotlin/org/fptn/vpn/ui/MainActivity.kt | 7 +----- .../data/token/AuthTokenNormalizerImpl.kt | 9 ++++---- .../data/token/AuthTokenNormalizerTest.kt | 18 +++++++-------- .../filantrop/pvnclient/auth/ui/AuthModule.kt | 2 +- .../filantrop/pvnclient/auth/ui/AuthScreen.kt | 23 ++++++++++--------- .../pvnclient/auth/ui/AuthViewModel.kt | 17 +++++++++++--- 6 files changed, 41 insertions(+), 35 deletions(-) diff --git a/app/src/main/kotlin/org/fptn/vpn/ui/MainActivity.kt b/app/src/main/kotlin/org/fptn/vpn/ui/MainActivity.kt index 27145256..9509f0f3 100644 --- a/app/src/main/kotlin/org/fptn/vpn/ui/MainActivity.kt +++ b/app/src/main/kotlin/org/fptn/vpn/ui/MainActivity.kt @@ -31,11 +31,7 @@ class MainActivity : ComponentActivity() { lifecycleScope.launch { lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) { - viewModel.uiState - .collect { - System.out.println("moggot state: $it") - openScreen(it) - } + viewModel.uiState.collect { openScreen(it) } } } splashScreen.setKeepOnScreenCondition { viewModel.uiState.value.shouldKeepSplashScreen() } @@ -67,7 +63,6 @@ class MainActivity : ComponentActivity() { PvnTheme(darkTheme = darkTheme) { when (state) { is AuthActivityUiState.Loading -> { - System.out.println("moggot Loading") } is AuthActivityUiState.Login -> { AuthScreen() diff --git a/auth/data/src/main/kotlin/org/fptn/vpn/auth/data/token/AuthTokenNormalizerImpl.kt b/auth/data/src/main/kotlin/org/fptn/vpn/auth/data/token/AuthTokenNormalizerImpl.kt index 825e5096..51b810eb 100644 --- a/auth/data/src/main/kotlin/org/fptn/vpn/auth/data/token/AuthTokenNormalizerImpl.kt +++ b/auth/data/src/main/kotlin/org/fptn/vpn/auth/data/token/AuthTokenNormalizerImpl.kt @@ -9,11 +9,10 @@ class AuthTokenNormalizerImpl : AuthTokenNormalizer { .replace("\\s+".toRegex(), "") .replace("fptn://", "") .replace("fptn:", "") - return when (normalizedToken.length % (OFFSET - 1)) { - 1 -> "$normalizedToken==" - 2 -> "$normalizedToken=" - else -> normalizedToken - } + val padding = (OFFSET - normalizedToken.length % OFFSET) % OFFSET + val result = StringBuilder(normalizedToken) + repeat(padding) { result.append("=") } + return result.toString() } private companion object { diff --git a/auth/data/src/test/kotlin/org/fptn/vpn/auth/data/token/AuthTokenNormalizerTest.kt b/auth/data/src/test/kotlin/org/fptn/vpn/auth/data/token/AuthTokenNormalizerTest.kt index 85904b27..7b67bbcb 100644 --- a/auth/data/src/test/kotlin/org/fptn/vpn/auth/data/token/AuthTokenNormalizerTest.kt +++ b/auth/data/src/test/kotlin/org/fptn/vpn/auth/data/token/AuthTokenNormalizerTest.kt @@ -9,8 +9,8 @@ class AuthTokenNormalizerTest { @Test fun `normalize should remove whitespaces`() { - val input = " token with spaces " - val expected = "tokenwithspaces" + val input = " token with spacess " + val expected = "tokenwithspacess" assertEquals(expected, normalizer.normalize(input)) } @@ -30,8 +30,8 @@ class AuthTokenNormalizerTest { @Test fun `normalize should handle combined cases`() { - val input = " fptn:// token with spaces " - val expected = "tokenwithspaces" + val input = " fptn:// token with spacess " + val expected = "tokenwithspacess" assertEquals(expected, normalizer.normalize(input)) } @@ -44,22 +44,22 @@ class AuthTokenNormalizerTest { @Test fun `token has no padding`() { - val input = "token1" - val expected = "token1" + val input = "token123" + val expected = "token123" assertEquals(expected, normalizer.normalize(input)) } @Test fun `token has one padding`() { val input = "token12" - val expected = "token12==" + val expected = "token12=" assertEquals(expected, normalizer.normalize(input)) } @Test fun `token has two paddings`() { - val input = "token123" - val expected = "token123=" + val input = "token1234" + val expected = "token1234===" assertEquals(expected, normalizer.normalize(input)) } } diff --git a/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthModule.kt b/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthModule.kt index d2da5586..a8d9693c 100644 --- a/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthModule.kt +++ b/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthModule.kt @@ -8,7 +8,7 @@ import org.koin.dsl.module val viewModelModule = module { - viewModel { AuthViewModel() } + viewModel { AuthViewModel(get()) } } val authModule = diff --git a/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthScreen.kt b/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthScreen.kt index 01987bf8..7ea1e618 100644 --- a/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthScreen.kt +++ b/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthScreen.kt @@ -22,9 +22,6 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.dimensionResource @@ -51,16 +48,18 @@ fun AuthScreen(viewModel: AuthViewModel = koinViewModel()) { val uiState: AuthState by viewModel.uiState.collectAsStateWithLifecycle() AuthScreen( uiState, - ) { viewModel.login(it) } + onTokenChanged = viewModel::changeToken, + onLoginClick = viewModel::login, + ) } @Composable @Suppress("UnusedParameter") fun AuthScreen( state: AuthState, - onLoginClick: (token: String) -> Unit, + onTokenChanged: (token: String) -> Unit, + onLoginClick: () -> Unit, ) { - var token by remember { mutableStateOf("") } Scaffold( modifier = Modifier.navigationBarsPadding(), ) { padding: PaddingValues -> @@ -96,16 +95,16 @@ fun AuthScreen( .padding(horizontal = 32.dp, vertical = 16.dp), ) { OutlinedTextField( - value = token, + value = state.token, modifier = Modifier.fillMaxWidth(), - maxLines = 1, - onValueChange = {}, + singleLine = true, + onValueChange = onTokenChanged, label = { Text(stringResource(R.string.enter_token_hint)) }, keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), ) } Button( - onClick = { onLoginClick(token) }, + onClick = onLoginClick, modifier = Modifier.padding(horizontal = 32.dp), ) { Text(stringResource(R.string.login)) } @@ -161,5 +160,7 @@ fun ClickableLink() { fun DefaultAuthScreen() { AuthScreen( AuthState(token = "123"), - ) {} + {}, + {}, + ) } diff --git a/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthViewModel.kt b/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthViewModel.kt index 920af7f4..6cc62599 100644 --- a/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthViewModel.kt +++ b/auth/ui/src/main/kotlin/com/filantrop/pvnclient/auth/ui/AuthViewModel.kt @@ -1,19 +1,30 @@ package com.filantrop.pvnclient.auth.ui import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch +import org.fptn.vpn.auth.domain.AuthInteractor data class AuthState( val token: String, ) -class AuthViewModel : ViewModel() { +class AuthViewModel( + private val authInteractor: AuthInteractor, +) : ViewModel() { private val _uiState = MutableStateFlow(AuthState("")) val uiState: StateFlow = _uiState.asStateFlow() - fun login(token: String) { - System.out.println("moggot login: $token") + fun changeToken(token: String) { + _uiState.update { it.copy(token = token) } } + + fun login() = + viewModelScope.launch { + authInteractor.saveToken(_uiState.value.token) + } }