Skip to content

Commit

Permalink
Add unofficial banner
Browse files Browse the repository at this point in the history
Co-Authored-By: backslashxx <118538522+backslashxx@users.noreply.github.com>
  • Loading branch information
silvzr and backslashxx committed Nov 1, 2024
1 parent 0c14673 commit 1f0e41a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Home.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ fun HomeScreen(navigator: DestinationsNavigator) {
if (checkUpdate) {
UpdateCard()
}
Unofficial()
InfoCard()
DonateCard()
LearnMoreCard()
Expand Down Expand Up @@ -432,6 +433,32 @@ 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<String, Long> {
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)!!
val versionCode = PackageInfoCompat.getLongVersionCode(packageInfo)
Expand Down
3 changes: 3 additions & 0 deletions manager/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<string name="safe_mode">Safe mode</string>
<string name="reboot_to_apply">Reboot to take effect</string>
<string name="module_magisk_conflict">Modules are unavailable due to a conflict with Magisk!</string>
<string name="home_unofficial_kernelsu">Unofficial Build</string>
<string name="home_unofficial_kernelsu_announce">https://github.com/tiann/KernelSU/issues/1705</string>
<string name="home_unofficial_kernelsu_body">Non-GKI support ended with v0.9.5; see announcement.</string>
<string name="home_learn_kernelsu">Learn KernelSU</string>
<string name="home_learn_kernelsu_url">https://kernelsu.org/guide/what-is-kernelsu.html</string>
<string name="home_click_to_learn_kernelsu">Learn how to install KernelSU and use modules</string>
Expand Down

0 comments on commit 1f0e41a

Please sign in to comment.