Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
21505a74
Commit
21505a74
authored
Jan 12, 2022
by
topjohnwu
Committed by
John Wu
Jan 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update scripts for PATCHVBMETAFLAG
parent
ba6e6cc1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
manager.sh
app/src/main/res/raw/manager.sh
+8
-7
util_functions.sh
scripts/util_functions.sh
+8
-3
No files found.
app/src/main/res/raw/manager.sh
View file @
21505a74
...
@@ -179,12 +179,6 @@ check_encryption() {
...
@@ -179,12 +179,6 @@ check_encryption() {
fi
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
# Non-root util_functions
##########################
##########################
...
@@ -199,6 +193,14 @@ get_flags() {
...
@@ -199,6 +193,14 @@ get_flags() {
KEEPVERITY
=
$SYSTEM_ROOT
KEEPVERITY
=
$SYSTEM_ROOT
[
"
$(
getprop ro.crypto.state
)
"
=
"encrypted"
]
&&
ISENCRYPTED
=
true
||
ISENCRYPTED
=
false
[
"
$(
getprop ro.crypto.state
)
"
=
"encrypted"
]
&&
ISENCRYPTED
=
true
||
ISENCRYPTED
=
false
KEEPFORCEENCRYPT
=
$ISENCRYPTED
KEEPFORCEENCRYPT
=
$ISENCRYPTED
# Although this most certainly won't work without root, keep it just in case
if
[
-e
/dev/block/by-name/vbmeta_a
]
||
[
-e
/dev/block/by-name/vbmeta
]
;
then
VBMETAEXIST
=
true
else
VBMETAEXIST
=
false
fi
# Preset PATCHVBMETAFLAG to false in the non-root case
PATCHVBMETAFLAG
=
false
# Do NOT preset RECOVERYMODE here
# Do NOT preset RECOVERYMODE here
}
}
...
@@ -217,7 +219,6 @@ app_init() {
...
@@ -217,7 +219,6 @@ app_init() {
SHA1
=
$(
grep_prop SHA1
$MAGISKTMP
/config
)
SHA1
=
$(
grep_prop SHA1
$MAGISKTMP
/config
)
check_boot_ramdisk
&&
RAMDISKEXIST
=
true
||
RAMDISKEXIST
=
false
check_boot_ramdisk
&&
RAMDISKEXIST
=
true
||
RAMDISKEXIST
=
false
check_encryption
check_encryption
check_vbmeta_partition
# Make sure RECOVERYMODE has value
# Make sure RECOVERYMODE has value
[
-z
$RECOVERYMODE
]
&&
RECOVERYMODE
=
false
[
-z
$RECOVERYMODE
]
&&
RECOVERYMODE
=
false
}
}
...
...
scripts/util_functions.sh
View file @
21505a74
...
@@ -377,8 +377,10 @@ umount_apex() {
...
@@ -377,8 +377,10 @@ umount_apex() {
unset
BOOTCLASSPATH
unset
BOOTCLASSPATH
}
}
# After calling this method, the following variables will be set:
# KEEPVERITY, KEEPFORCEENCRYPT, RECOVERYMODE, PATCHVBMETAFLAG,
# ISENCRYPTED, VBMETAEXIST
get_flags
()
{
get_flags
()
{
# override variables
getvar KEEPVERITY
getvar KEEPVERITY
getvar KEEPFORCEENCRYPT
getvar KEEPFORCEENCRYPT
getvar RECOVERYMODE
getvar RECOVERYMODE
...
@@ -403,12 +405,15 @@ get_flags() {
...
@@ -403,12 +405,15 @@ get_flags() {
KEEPFORCEENCRYPT
=
false
KEEPFORCEENCRYPT
=
false
fi
fi
fi
fi
VBMETAEXIST
=
false
local
VBMETAIMG
=
$(
find_block vbmeta vbmeta_a
)
[
-n
"
$VBMETAIMG
"
]
&&
VBMETAEXIST
=
true
if
[
-z
$PATCHVBMETAFLAG
]
;
then
if
[
-z
$PATCHVBMETAFLAG
]
;
then
if
[
-e
/dev/block/by-name/vbmeta_a
]
||
[
-e
/dev/block/by-name/vbmeta
]
;
then
if
$VBMETAEXIST
;
then
PATCHVBMETAFLAG
=
false
PATCHVBMETAFLAG
=
false
else
else
PATCHVBMETAFLAG
=
true
PATCHVBMETAFLAG
=
true
ui_print
"-
Not found vbmeta partition, patch vbmetaflag
"
ui_print
"-
Cannot find vbmeta partition, patch vbmeta in boot image
"
fi
fi
fi
fi
[
-z
$RECOVERYMODE
]
&&
RECOVERYMODE
=
false
[
-z
$RECOVERYMODE
]
&&
RECOVERYMODE
=
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment