You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Support PATCHVBMETAFLAG env variable
This commit is contained in:
@@ -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 && 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}"
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user