manager: module migration on module system switch

This commit is contained in:
Rifat Azad
2025-01-07 22:21:55 +06:00
parent 2d18a1f371
commit b0a64ca882
3 changed files with 15 additions and 7 deletions

View File

@@ -179,6 +179,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
prefs.edit().putBoolean("use_overlay_fs", it).apply()
useOverlayFs = it
showRestartDialog = true
moduleMigration()
}
if (showRestartDialog) {

View File

@@ -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("\"", "\\\"")