You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
manager: module migration on module system switch
This commit is contained in:
@@ -179,6 +179,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
||||
prefs.edit().putBoolean("use_overlay_fs", it).apply()
|
||||
useOverlayFs = it
|
||||
showRestartDialog = true
|
||||
moduleMigration()
|
||||
}
|
||||
|
||||
if (showRestartDialog) {
|
||||
|
||||
@@ -427,6 +427,12 @@ fun getAppProfileTemplate(id: String): String {
|
||||
.to(ArrayList(), null).exec().out.joinToString("\n")
|
||||
}
|
||||
|
||||
fun moduleMigration(): Boolean {
|
||||
val shell = getRootShell()
|
||||
// mirgate modules for module system switch
|
||||
return ShellUtils.fastCmdResult(shell, "cp -r /data/adb/modules/* /data/adb/modules_update/")
|
||||
}
|
||||
|
||||
fun setAppProfileTemplate(id: String, template: String): Boolean {
|
||||
val shell = getRootShell()
|
||||
val escapedTemplate = template.replace("\"", "\\\"")
|
||||
|
||||
Reference in New Issue
Block a user