mirror of
https://github.com/tiann/KernelSU.git
synced 2025-02-20 11:43:32 +08:00
manager: fix ksud installation failed at first boot.
This commit is contained in:
parent
f6c249bd77
commit
76c88a72c6
@ -3,7 +3,6 @@ package me.weishu.kernelsu
|
||||
import android.app.Application
|
||||
import coil.Coil
|
||||
import coil.ImageLoader
|
||||
import me.weishu.kernelsu.ui.util.install
|
||||
import me.zhanghai.android.appiconloader.coil.AppIconFetcher
|
||||
import me.zhanghai.android.appiconloader.coil.AppIconKeyer
|
||||
|
||||
@ -25,8 +24,6 @@ class KernelSUApplication : Application() {
|
||||
}
|
||||
.build()
|
||||
)
|
||||
|
||||
install()
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,6 +36,7 @@ import me.weishu.kernelsu.ui.screen.destinations.SettingScreenDestination
|
||||
import me.weishu.kernelsu.ui.util.LocalSnackbarHost
|
||||
import me.weishu.kernelsu.ui.util.reboot
|
||||
import me.weishu.kernelsu.ui.util.getSELinuxStatus
|
||||
import me.weishu.kernelsu.ui.util.install
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@RootNavGraph(start = true)
|
||||
@ -58,6 +59,9 @@ fun HomeScreen(navigator: DestinationsNavigator) {
|
||||
) {
|
||||
val kernelVersion = getKernelVersion()
|
||||
val isManager = Natives.becomeManager(ksuApp.packageName)
|
||||
SideEffect {
|
||||
if (isManager) install()
|
||||
}
|
||||
val ksuVersion = if (isManager) Natives.getVersion() else null
|
||||
|
||||
StatusCard(kernelVersion, ksuVersion)
|
||||
|
@ -27,6 +27,7 @@ fun createRootShell(): Shell {
|
||||
return try {
|
||||
builder.build(getKsuDaemonPath(), "debug", "su")
|
||||
} catch (e: Throwable) {
|
||||
Log.e(TAG, "su failed: ", e)
|
||||
builder.build("sh")
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user