diff --git a/app/src/main/java/icu/nullptr/hidemyapplist/ui/fragment/AppSettingsFragment.kt b/app/src/main/java/icu/nullptr/hidemyapplist/ui/fragment/AppSettingsFragment.kt index 2e159b38..f3dadc08 100644 --- a/app/src/main/java/icu/nullptr/hidemyapplist/ui/fragment/AppSettingsFragment.kt +++ b/app/src/main/java/icu/nullptr/hidemyapplist/ui/fragment/AppSettingsFragment.kt @@ -32,12 +32,26 @@ class AppSettingsFragment : Fragment(R.layout.fragment_settings) { AppSettingsViewModel.Factory(pack) } - private fun onBack() { + private fun saveConfig() { if (!viewModel.pack.enabled) ConfigManager.setAppConfig(viewModel.pack.app, null) else ConfigManager.setAppConfig(viewModel.pack.app, viewModel.pack.config) + } + + private fun onBack() { + saveConfig() navController.navigateUp() } + override fun onPause() { + super.onPause() + saveConfig() + } + + override fun onDestroyView() { + super.onDestroyView() + saveConfig() + } + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner) { onBack() } setupToolbar( diff --git a/app/src/main/java/icu/nullptr/hidemyapplist/ui/fragment/SettingsFragment.kt b/app/src/main/java/icu/nullptr/hidemyapplist/ui/fragment/SettingsFragment.kt index 4a4e1054..57f30aa0 100644 --- a/app/src/main/java/icu/nullptr/hidemyapplist/ui/fragment/SettingsFragment.kt +++ b/app/src/main/java/icu/nullptr/hidemyapplist/ui/fragment/SettingsFragment.kt @@ -115,7 +115,7 @@ class SettingsFragment : Fragment(R.layout.fragment_settings), PreferenceFragmen findPreference("appDataIsolation")?.let { it.setOnPreferenceChangeListener { _, newValue -> val value = if (newValue as Boolean) 1 else 0 - val result = SuUtils.execPrivileged("resetprop ${Constants.ANDROID_APP_DATA_ISOLATION_ENABLED_PROPERTY} $value") + val result = SuUtils.execPrivileged("setprop ${Constants.ANDROID_APP_DATA_ISOLATION_ENABLED_PROPERTY} $value") if (result) makeToast(R.string.settings_need_reboot) else makeToast(R.string.settings_permission_denied) it.isChecked = CommonUtils.isAppDataIsolationEnabled @@ -126,7 +126,7 @@ class SettingsFragment : Fragment(R.layout.fragment_settings), PreferenceFragmen findPreference("voldAppDataIsolation")?.let { it.setOnPreferenceChangeListener { _, newValue -> val value = if (newValue as Boolean) 1 else 0 - val result = SuUtils.execPrivileged("resetprop ${Constants.ANDROID_VOLD_APP_DATA_ISOLATION_ENABLED_PROPERTY} $value") + val result = SuUtils.execPrivileged("setprop ${Constants.ANDROID_VOLD_APP_DATA_ISOLATION_ENABLED_PROPERTY} $value") if (result) makeToast(R.string.settings_need_reboot) else makeToast(R.string.settings_permission_denied) it.isChecked = CommonUtils.isVoldAppDataIsolationEnabled diff --git a/common/src/main/java/icu/nullptr/hidemyapplist/common/JsonConfig.kt b/common/src/main/java/icu/nullptr/hidemyapplist/common/JsonConfig.kt index 214190ca..b02051fd 100644 --- a/common/src/main/java/icu/nullptr/hidemyapplist/common/JsonConfig.kt +++ b/common/src/main/java/icu/nullptr/hidemyapplist/common/JsonConfig.kt @@ -30,7 +30,7 @@ data class JsonConfig( @Serializable data class AppConfig( var useWhitelist: Boolean = false, - var excludeSystemApps: Boolean = false, + var excludeSystemApps: Boolean = true, var applyTemplates: MutableSet = mutableSetOf(), var extraAppList: MutableSet = mutableSetOf() ) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c75a84df..8a3de206 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] -agp = "8.7.0" -kotlin = "2.0.20" -rxhttp = "3.3.0" +agp = "8.7.2" +kotlin = "2.1.0" +rxhttp = "3.3.1" hidden-api = "4.3.3" [plugins] @@ -9,16 +9,16 @@ agp-app = { id = "com.android.application", version.ref = "agp" } agp-lib = { id = "com.android.library", version.ref = "agp" } kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } -ksp = { id = "com.google.devtools.ksp", version = "2.0.20-1.0.25" } +ksp = { id = "com.google.devtools.ksp", version = "2.1.0-1.0.29" } gms = { id = "com.google.gms.google-services", version = "4.4.2" } -nav-safeargs-kotlin = { id = "androidx.navigation.safeargs.kotlin", version = "2.8.2" } +nav-safeargs-kotlin = { id = "androidx.navigation.safeargs.kotlin", version = "2.8.4" } autoresconfig = { id = "dev.rikka.tools.autoresconfig", version = "1.2.2" } materialthemebuilder = { id = "dev.rikka.tools.materialthemebuilder", version = "1.5.1" } refine = { id = "dev.rikka.tools.refine", version = "4.4.0" } [libraries] -androidx-navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version = "2.8.2" } -androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version = "2.8.2" } +androidx-navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version = "2.8.4" } +androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version = "2.8.4" } androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version = "1.2.1" } androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version = "1.1.0" } com-android-tools-build-apksig = { module = "com.android.tools.build:apksig", version.ref = "agp" } @@ -31,8 +31,8 @@ com-github-liujingxing-rxhttp-compiler = { module = "com.github.liujingxing.rxht com-github-liujingxing-rxhttp-converter-serialization = { module = "com.github.liujingxing.rxhttp:converter-serialization", version.ref = "rxhttp" } com-github-topjohnwu-libsu-core = { module = "com.github.topjohnwu.libsu:core", version = "6.0.0" } com-google-android-material = { module = "com.google.android.material:material", version = "1.12.0" } -com-google-android-gms-play-services-ads = { module = "com.google.android.gms:play-services-ads", version = "23.4.0" } -com-google-firebase-bom = { module = "com.google.firebase:firebase-bom", version = "33.4.0" } +com-google-android-gms-play-services-ads = { module = "com.google.android.gms:play-services-ads", version = "23.5.0" } +com-google-firebase-bom = { module = "com.google.firebase:firebase-bom", version = "33.6.0" } com-google-firebase-analytics-ktx = { module = "com.google.firebase:firebase-analytics-ktx" } com-squareup-okhttp3 = { module = "com.squareup.okhttp3:okhttp", version = "4.12.0" } de-robv-android-xposed-api = { module = "de.robv.android.xposed:api", version = "82" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72b..e2847c82 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME