Update several scripts

- Update backup format as we might be patching multiple partitions
- Update uninstaller to remove files in persist (sepolicy.rule)
- Better handling for dtb/dtbo partition patching
This commit is contained in:
topjohnwu
2020-01-01 14:02:44 +08:00
parent 2db1e5cb74
commit 3049a81c3b
9 changed files with 129 additions and 101 deletions

View File

@@ -287,8 +287,10 @@ abstract class MagiskInstaller {
protected fun flashBoot(): Boolean {
if (!"direct_install $installDir $srcBoot".sh().isSuccess)
return false
if (!Info.keepVerity)
"patch_dtbo_image".sh()
arrayOf(
"(KEEPVERITY=${Info.keepVerity} patch_dtb_partitions)",
"run_migrations"
).sh()
return true
}

View File

@@ -49,7 +49,7 @@ open class SplashActivity : Activity() {
// Setup shortcuts
Shortcuts.setup(this)
Shell.su("mm_patch_dtbo").submit {
Shell.su("mm_patch_dtb").submit {
if (it.isSuccess)
Notifications.dtboPatched(this)
}

View File

@@ -29,11 +29,12 @@ class RootInit : Shell.Initializer() {
job.add(context.rawResource(R.raw.nonroot_utils))
}
job.add("mount_partitions",
"get_flags",
"run_migrations",
"export BOOTMODE=true")
.exec()
job.add(
"mount_partitions",
"get_flags",
"run_migrations",
"export BOOTMODE=true"
).exec()
Info.keepVerity = ShellUtils.fastCmd("echo \$KEEPVERITY").toBoolean()
Info.keepEnc = ShellUtils.fastCmd("echo \$KEEPFORCEENCRYPT").toBoolean()