diff --git a/kernel/setup.sh b/kernel/setup.sh index e688dbaf3ae5..fa35377026b0 100755 --- a/kernel/setup.sh +++ b/kernel/setup.sh @@ -39,7 +39,7 @@ perform_cleanup() { # Sets up or update KernelSU environment setup_kernelsu() { echo "[+] Setting up KernelSU..." - test -d "$GKI_ROOT/KernelSU" || git clone https://github.com/tiann/KernelSU && echo "[+] Repository cloned." + test -d "$GKI_ROOT/KernelSU" || git clone https://github.com/backslashxx/KernelSU && echo "[+] Repository cloned." cd "$GKI_ROOT/KernelSU" git stash && echo "[-] Stashed current changes." if [ "$(git status | grep -Po 'v\d+(\.\d+)*' | head -n1)" ]; then diff --git a/manager/app/build.gradle.kts b/manager/app/build.gradle.kts index 1f98e4a1ba62..215cd89ee268 100644 --- a/manager/app/build.gradle.kts +++ b/manager/app/build.gradle.kts @@ -68,7 +68,7 @@ android { applicationVariants.all { outputs.forEach { val output = it as BaseVariantOutputImpl - output.outputFileName = "KernelSU_${managerVersionName}_${managerVersionCode}-$name.apk" + output.outputFileName = "KernelSU_${managerVersionName}_${managerVersionCode}-legacy-$name.apk" } kotlin.sourceSets { getByName(name) { @@ -133,4 +133,4 @@ dependencies { implementation(libs.androidx.webkit) implementation(libs.lsposed.cxx) -} \ No newline at end of file +} 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 71ddc63d3e57..68755dd921ac 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() @@ -405,7 +400,7 @@ private fun InfoCard() { val managerVersion = getManagerVersion(context) InfoCardItem( stringResource(R.string.home_manager_version), - "${managerVersion.first} (${managerVersion.second})" + "${managerVersion.first}-legacy (${managerVersion.second})" ) Spacer(Modifier.height(16.dp)) @@ -417,6 +412,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) @@ -444,4 +467,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 fe6b8786f335..827f0daf6d72 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 @@ -172,21 +172,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) @@ -483,4 +468,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 bdf8496633fd..6991897ea855 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 @@ -62,7 +62,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 ac9b19e4f5ea..89b47749f3c0 100644 --- a/manager/app/src/main/res/values/strings.xml +++ b/manager/app/src/main/res/values/strings.xml @@ -49,6 +49,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 @@ -135,4 +138,4 @@ Selected LKM: %s Save logs Logs saved - \ No newline at end of file +