Skip to content

Commit e15914f

Browse files
committed
manager: unofficial build
- warn and inform that this is not an official build. - also 🦆 emoji as promised - also update setup.sh for automated builds - add 'magic' on apk filename Update strings.xml
1 parent c3c7344 commit e15914f

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

kernel/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ perform_cleanup() {
3939
# Sets up or update KernelSU environment
4040
setup_kernelsu() {
4141
echo "[+] Setting up KernelSU..."
42-
test -d "$GKI_ROOT/KernelSU" || git clone https://github.com/tiann/KernelSU && echo "[+] Repository cloned."
42+
test -d "$GKI_ROOT/KernelSU" || git clone https://github.com/backslashxx/KernelSU && echo "[+] Repository cloned."
4343
cd "$GKI_ROOT/KernelSU"
4444
git stash && echo "[-] Stashed current changes."
4545
if [ "$(git status | grep -Po 'v\d+(\.\d+)*' | head -n1)" ]; then

manager/app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ android {
6868
applicationVariants.all {
6969
outputs.forEach {
7070
val output = it as BaseVariantOutputImpl
71-
output.outputFileName = "KernelSU_${managerVersionName}_${managerVersionCode}-$name.apk"
71+
output.outputFileName = "KernelSU_${managerVersionName}_${managerVersionCode}-magic-$name.apk"
7272
}
7373
kotlin.sourceSets {
7474
getByName(name) {
@@ -133,4 +133,4 @@ dependencies {
133133
implementation(libs.androidx.webkit)
134134

135135
implementation(libs.lsposed.cxx)
136-
}
136+
}

manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Home.kt

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ fun HomeScreen(navigator: DestinationsNavigator) {
9393
stringResource(id = R.string.grant_root_failed)
9494
)
9595
}
96+
Unofficial()
9697
val checkUpdate =
9798
LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
9899
.getBoolean("check_update", true)
@@ -402,7 +403,7 @@ private fun InfoCard() {
402403
val managerVersion = getManagerVersion(context)
403404
InfoCardItem(
404405
stringResource(R.string.home_manager_version),
405-
"${managerVersion.first} (${managerVersion.second})"
406+
"${managerVersion.first}-magic 🪄 (${managerVersion.second})"
406407
)
407408

408409
Spacer(Modifier.height(16.dp))
@@ -414,6 +415,34 @@ private fun InfoCard() {
414415
}
415416
}
416417

418+
@Composable
419+
fun Unofficial() {
420+
val uriHandler = LocalUriHandler.current
421+
val url = stringResource(R.string.home_unofficial_kernelsu_announce)
422+
423+
ElevatedCard {
424+
425+
Row(modifier = Modifier
426+
.fillMaxWidth()
427+
.clickable {
428+
uriHandler.openUri(url)
429+
}
430+
.padding(24.dp), verticalAlignment = Alignment.CenterVertically) {
431+
Column {
432+
Text(
433+
text = stringResource(R.string.home_unofficial_kernelsu),
434+
style = MaterialTheme.typography.titleSmall
435+
)
436+
Spacer(Modifier.height(4.dp))
437+
Text(
438+
text = stringResource(R.string.home_unofficial_kernelsu_body),
439+
style = MaterialTheme.typography.bodyMedium
440+
)
441+
}
442+
}
443+
}
444+
}
445+
417446
fun getManagerVersion(context: Context): Pair<String, Long> {
418447
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)!!
419448
val versionCode = PackageInfoCompat.getLongVersionCode(packageInfo)
@@ -441,4 +470,4 @@ private fun WarningCardPreview() {
441470
MaterialTheme.colorScheme.outlineVariant,
442471
onClick = {})
443472
}
444-
}
473+
}

manager/app/src/main/java/me/weishu/kernelsu/ui/util/Downloader.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fun download(
6363
}
6464

6565
fun checkNewVersion(): LatestVersionInfo {
66-
val url = "https://api.github.com/repos/tiann/KernelSU/releases/latest"
66+
val url = "https://api.github.com/repos/backslashxx/KernelSU/releases/latest"
6767
// default null value if failed
6868
val defaultValue = LatestVersionInfo()
6969
runCatching {

manager/app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
<string name="safe_mode">Safe mode</string>
5555
<string name="reboot_to_apply">Reboot to take effect</string>
5656
<string name="module_magisk_conflict">Modules are unavailable due to a conflict with Magisk!</string>
57+
<string name="home_unofficial_kernelsu">🦆 Unofficial Build</string>
58+
<string name="home_unofficial_kernelsu_announce">https://github.com/tiann/KernelSU/issues/1705</string>
59+
<string name="home_unofficial_kernelsu_body">Non-GKI support ended; see announcement.</string>
5760
<string name="home_learn_kernelsu">Learn KernelSU</string>
5861
<string name="home_learn_kernelsu_url">https://kernelsu.org/guide/what-is-kernelsu.html</string>
5962
<string name="home_click_to_learn_kernelsu">Learn how to install KernelSU and use modules</string>

0 commit comments

Comments
 (0)