diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Home.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Home.kt index 0fa3b34a8d4e..15389fe37a45 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Home.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Home.kt @@ -96,12 +96,7 @@ fun HomeScreen(navigator: DestinationsNavigator) { stringResource(id = R.string.grant_root_failed) ) } - val checkUpdate = - LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE) - .getBoolean("check_update", true) - if (checkUpdate) { - UpdateCard() - } + Unofficial() InfoCard() DonateCard() LearnMoreCard() @@ -432,6 +427,34 @@ private fun InfoCard() { } } +@Composable +fun Unofficial() { + val uriHandler = LocalUriHandler.current + val url = stringResource(R.string.home_unofficial_kernelsu_announce) + + ElevatedCard { + + Row(modifier = Modifier + .fillMaxWidth() + .clickable { + uriHandler.openUri(url) + } + .padding(24.dp), verticalAlignment = Alignment.CenterVertically) { + Column { + Text( + text = stringResource(R.string.home_unofficial_kernelsu), + style = MaterialTheme.typography.titleSmall + ) + Spacer(Modifier.height(4.dp)) + Text( + text = stringResource(R.string.home_unofficial_kernelsu_body), + style = MaterialTheme.typography.bodyMedium + ) + } + } + } +} + fun getManagerVersion(context: Context): Pair { val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)!! val versionCode = PackageInfoCompat.getLongVersionCode(packageInfo) @@ -459,4 +482,4 @@ private fun WarningCardPreview() { MaterialTheme.colorScheme.outlineVariant, onClick = {}) } -} \ No newline at end of file +} diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Settings.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Settings.kt index 42caaa853dd5..eb02aafc37cc 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Settings.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Settings.kt @@ -149,21 +149,6 @@ fun SettingScreen(navigator: DestinationsNavigator) { } val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE) - var checkUpdate by rememberSaveable { - mutableStateOf( - prefs.getBoolean("check_update", true) - ) - } - SwitchItem( - icon = Icons.Filled.Update, - title = stringResource(id = R.string.settings_check_update), - summary = stringResource(id = R.string.settings_check_update_summary), - checked = checkUpdate - ) { - prefs.edit().putBoolean("check_update", it).apply() - checkUpdate = it - } - var enableWebDebugging by rememberSaveable { mutableStateOf( prefs.getBoolean("enable_web_debugging", false) @@ -491,4 +476,4 @@ private fun TopBar( @Composable private fun SettingsPreview() { SettingScreen(EmptyDestinationsNavigator) -} \ No newline at end of file +} diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/util/Downloader.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/util/Downloader.kt index 954cac50da30..5d85bc63d5fe 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/util/Downloader.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/util/Downloader.kt @@ -63,7 +63,8 @@ fun download( } fun checkNewVersion(): LatestVersionInfo { - val url = "https://api.github.com/repos/tiann/KernelSU/releases/latest" + // disable updates + val url = "https://127.0.0.1/repos/tiann/KernelSU/releases/latest" // default null value if failed val defaultValue = LatestVersionInfo() runCatching { diff --git a/manager/app/src/main/res/values/strings.xml b/manager/app/src/main/res/values/strings.xml index e9d058e9e0bd..2df83a821ead 100644 --- a/manager/app/src/main/res/values/strings.xml +++ b/manager/app/src/main/res/values/strings.xml @@ -47,6 +47,9 @@ Safe mode Reboot to take effect Modules are unavailable due to a conflict with Magisk! + 🚨 Unofficial Build ⁽ˣˣ⁾ + https://github.com/tiann/KernelSU/issues/1705 + Non-GKI support ended; see announcement. Learn KernelSU https://kernelsu.org/guide/what-is-kernelsu.html Learn how to install KernelSU and use modules @@ -132,4 +135,4 @@ Flash failed Selected LKM: %s Save logs - \ No newline at end of file +