Support PATCHVBMETAFLAG env variable

This commit is contained in:
vvb2060
2021-12-15 03:37:52 +08:00
committed by John Wu
parent b2cd24ed1b
commit fd7bf2bc3a
9 changed files with 39 additions and 7 deletions
@@ -9,6 +9,8 @@
<import type="com.topjohnwu.magisk.core.Config" />
<import type="android.os.Build" />
<variable
name="viewModel"
type="com.topjohnwu.magisk.ui.install.InstallViewModel" />
@@ -34,7 +36,7 @@
<com.google.android.material.card.MaterialCardView
style="@style/WidgetFoundation.Card"
gone="@{viewModel.skipOptions}"
gone="@{viewModel.skipOptions || Info.isEmulator}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
@@ -108,6 +110,15 @@
android:text="@string/keep_force_encryption"
app:tint="?colorPrimary" />
<CheckBox
style="@style/WidgetFoundation.Checkbox"
goneUnless="@{!Info.vbmeta &amp;&amp; Build.VERSION.SDK_INT >= 30}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="@={Config.patchVbmeta}"
android:text="@string/patch_vbmeta"
app:tint="?colorPrimary" />
<CheckBox
style="@style/WidgetFoundation.Checkbox"
gone="@{Info.ramdisk}"
+7
View File
@@ -179,6 +179,12 @@ check_encryption() {
fi
}
check_vbmeta_partition() {
if [ -e /dev/block/by-name/vbmeta_a ] || [ -e /dev/block/by-name/vbmeta ]; then
VBMETAEXIST=true
fi
}
##########################
# Non-root util_functions
##########################
@@ -211,6 +217,7 @@ app_init() {
SHA1=$(grep_prop SHA1 $MAGISKTMP/config)
check_boot_ramdisk && RAMDISKEXIST=true || RAMDISKEXIST=false
check_encryption
check_vbmeta_partition
# Make sure RECOVERYMODE has value
[ -z $RECOVERYMODE ] && RECOVERYMODE=false
}
+1
View File
@@ -36,6 +36,7 @@
<!--Install-->
<string name="keep_force_encryption">Preserve force encryption</string>
<string name="keep_dm_verity">Preserve AVB 2.0/dm-verity</string>
<string name="patch_vbmeta">Patch vbmeta in boot image</string>
<string name="recovery_mode">Recovery Mode</string>
<string name="install_options_title">Options</string>
<string name="install_method_title">Method</string>