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

@@ -86,21 +86,22 @@ jobs:
uses: actions/download-artifact@v4
with:
name: ksud_overlayfs-aarch64-linux-android
path: .
path: ksud_overlayfs
- name: Copy ksud_overlayfs to app jniLibs
run: |
cp -f ksud_overlayfs-aarch64-linux-android/aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud_overlayfs.so
cp -f ksud_overlayfs/aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud_overlayfs.so
- name: Download arm64 ksud_magic
uses: actions/download-artifact@v4
with:
name: ksud_magic-aarch64-linux-android
path: .
path: ksud_magic
- name: Copy ksud_magic to app jniLibs
run: |
cp -f ksud_magic-aarch64-linux-android/aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud_magic.so
cp -f ksud_magic/aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud_magic.so
- name: Build with Gradle
run: |

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