Opt device disabling logic in HomeScreen

This commit is contained in:
ShirkNeko
2025-04-14 19:30:30 +08:00
parent 182028d9ea
commit 378b8458f2

View File

@@ -96,8 +96,10 @@ fun HomeScreen(navigator: DestinationsNavigator) {
val isManager = Natives.becomeManager(ksuApp.packageName)
val ksuVersion = if (isManager) Natives.version else null
if (kernelVersion.isGKI()) {
if (ksuVersion != null) {
if (deviceModel == "一加 Ace 5 Pro" && managerVersion > ksuVersion + 1) {
val pattern = "一.*加.*A.*c.*e.*5.*P.*r.*o".toRegex()
if (pattern.matches(deviceModel) && managerVersion > ksuVersion + 3) {
isDisabled = true
}
}
@@ -108,6 +110,7 @@ fun HomeScreen(navigator: DestinationsNavigator) {
reboot()
}
}
}
Scaffold(
topBar = {