Skip to content

Commit dd906e9

Browse files
committed
Fix crash
1 parent bae6cb7 commit dd906e9

File tree

7 files changed

+22
-11
lines changed

7 files changed

+22
-11
lines changed

android/app/proguard-rules.pro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,4 +397,6 @@
397397
-dontwarn com.android.internal.annotations.VisibleForTesting
398398
-dontwarn lombok.Generated
399399
-dontwarn android.app.ActivityManagerNative
400-
-dontwarn android.content.pm.ShortcutQueryWrapper
400+
-dontwarn android.content.pm.ShortcutQueryWrapper
401+
-dontwarn android.os.ICancellationSignal$Stub
402+
-dontwarn android.os.ICancellationSignal

android/app/src/main/java/now/fortuitous/thanos/ThanosApp.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class ThanosApp : MultipleModulesApp() {
7070
HiddenApiBypass.addHiddenApiExemptions("")
7171
}
7272

73+
XLog.w("onCreate.$this")
74+
7375
initThanos {
7476
// Init Shizuku.
7577
ThanosShizuku.init(this)

android/app/src/main/java/now/fortuitous/thanos/main/NavActivity.kt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import androidx.compose.runtime.setValue
3030
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
3131
import androidx.preference.PreferenceManager
3232
import com.anggrayudi.storage.SimpleStorageHelper
33+
import com.elvishew.xlog.XLog
3334
import dagger.hilt.android.AndroidEntryPoint
3435
import github.tornaco.android.thanos.core.app.ThanosManager
3536
import github.tornaco.android.thanos.main.blockOnCreate
@@ -53,41 +54,47 @@ class NavActivity : ComposeThemeActivity() {
5354
}
5455

5556
override fun onCreate(savedInstanceState: Bundle?) {
57+
XLog.w("onCreate.$this")
5658
val splash = installSplashScreen()
5759
super.onCreate(savedInstanceState)
5860
}
5961

6062
@Composable
6163
override fun Content() {
64+
XLog.w("Content")
6265
// OnBoarding
6366
if (!AppPreference.hasOnBoarding(this)) {
6467
OnBoardingActivity.Starter.start(this)
6568
finish()
6669
return
6770
}
68-
71+
XLog.w("CompositionLocalProvider.")
6972
CompositionLocalProvider(LocalSimpleStorageHelper provides storageHelper) {
7073
// Check if xopsed mode is running.
7174
if (ThanosManager.from(this).isServiceInstalled) {
75+
XLog.w("isServiceInstalled.")
7276
AppPreference.setAppType(this, "ask")
7377
ThanoxXposed()
7478
} else {
79+
XLog.w("isServiceInstalled false.")
7580
val sx = AppPreference.getAppType(this)
81+
XLog.w("sx: $sx")
7682
when (sx) {
77-
"thanox" -> {
78-
ThanoxXposed()
79-
}
80-
8183
"thanos" -> {
8284
ThanoxShizuku()
8385
}
86+
87+
else -> {
88+
ThanoxXposed()
89+
}
8490
}
8591
}
8692
}
8793
}
8894

8995
@Composable
9096
private fun ThanoxXposed() {
97+
XLog.w("ThanoxXposed")
9198
// Block
9299
if (blockOnCreate(this)) {
93100
finish()
@@ -99,12 +106,14 @@ class NavActivity : ComposeThemeActivity() {
99106
}
100107

101108
val applyNewHome = AppPreference.isFeatureNoticeAccepted(this, "NEW_HOME")
109+
XLog.w("applyNewHome: $applyNewHome")
102110
if (applyNewHome) AllNewNavScreen() else NavScreen()
103111
}
104112

105113
@SuppressLint("UseKtx")
106114
@Composable
107115
private fun ThanoxShizuku() {
116+
XLog.w("ThanoxShizuku")
108117
LaunchedEffect(Unit) {
109118
ShortcutInit(this@NavActivity).initOnBootThanos()
110119
}

android/app/src/main/java/now/fortuitous/thanos/settings/v2/SettingsViewModel.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ class SettingsViewModel @Inject constructor(@ApplicationContext context: Context
100100
autoConfigTemplateSelection = thanos.profileManager.autoConfigTemplateSelectionId?.let {
101101
thanos.profileManager.getConfigTemplateById(it)
102102
},
103-
allConfigTemplateSelection = thanos.profileManager.allConfigTemplates,
103+
allConfigTemplateSelection = thanos.profileManager.allConfigTemplates
104+
?: emptyList(),
104105
uiShowAppVersion = CommonPreferences.getInstance()
105106
.isAppListShowVersionEnabled(context),
106107
uiShowAppPkgName = CommonPreferences.getInstance()

android/gradle/libs.versions.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ agp = "8.10.0"
77
javapoet = "1.13.0"
88
ksp = "2.0.21-1.0.26"
99
biometric = "1.4.0-alpha04"
10-
datastore = "1.1.5"
1110
adaptive = "1.2.0-alpha06"
1211
androidx-work = "2.10.1"
1312
coil-compose = "2.7.0"
@@ -105,7 +104,6 @@ accompanist-swiperefresh = { module = "com.google.accompanist:accompanist-swiper
105104
accompanist-flowlayout = { module = "com.google.accompanist:accompanist-flowlayout", version.ref = "accompanist" }
106105

107106
androidx-adaptive = { module = "androidx.compose.material3.adaptive:adaptive-android", version.ref = "adaptive" }
108-
androidx-datastore = { module = "androidx.datastore:datastore", version.ref = "datastore" }
109107
androidx-work-runtime = { module = "androidx.work:work-runtime", version.ref = "androidx-work" }
110108
androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "androidx-work" }
111109
androidx-biometric = { module = "androidx.biometric:biometric", version.ref = "biometric" }

android/internal/Thanox-Internal

android/modules/module_common/src/main/java/github/tornaco/android/thanos/module/compose/common/ComposeThemeActivity.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import android.os.Bundle
55
import androidx.activity.SystemBarStyle
66
import androidx.activity.compose.setContent
77
import androidx.activity.enableEdgeToEdge
8-
import androidx.appcompat.app.AppCompatActivity
98
import androidx.compose.runtime.Composable
109
import androidx.compose.runtime.getValue
1110
import androidx.compose.runtime.mutableStateOf

0 commit comments

Comments
 (0)