From 79dfdb29e791b19717171b87bb3bc8e79696ff6b Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 11 Jan 2021 19:47:36 -0800 Subject: [PATCH] Minor tweaks for patching tar files --- .../com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt b/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt index e61e529ca..64426933e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt @@ -191,9 +191,10 @@ abstract class MagiskInstallImpl : KoinComponent { if (rawData.size < 256) continue - // Patch flags to AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED + // Patch flags to AVB_VBMETA_IMAGE_FLAGS_HASHTREE_DISABLED | + // AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED console.add("-- Patching: vbmeta.img") - ByteBuffer.wrap(rawData).putInt(120, 2) + ByteBuffer.wrap(rawData).putInt(120, 3) tarOut.putNextEntry(newEntry("vbmeta.img", rawData.size.toLong())) tarOut.write(rawData) } else { @@ -204,7 +205,7 @@ abstract class MagiskInstallImpl : KoinComponent { } val boot = SuFile.open(installDir, "boot.img") val recovery = SuFile.open(installDir, "recovery.img") - if (recovery.exists() && boot.exists()) { + if (Config.recovery && recovery.exists() && boot.exists()) { // Install Magisk to recovery srcBoot = recovery.path // Repack boot image to prevent restore