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
f7b49356
Commit
f7b49356
authored
Dec 21, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add recommend KEEPVERITY and KEEPFORCEENCRYPT flags
parent
a3c49de6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
10 deletions
+24
-10
app
app
+1
-1
boot_patch.sh
scripts/boot_patch.sh
+12
-4
flash_script.sh
scripts/flash_script.sh
+7
-0
magisk_uninstaller.sh
scripts/magisk_uninstaller.sh
+3
-3
util_functions.sh
scripts/util_functions.sh
+1
-2
No files found.
app
@
2df351d3
Subproject commit
91337218b314c853ad441aa38947394a68afcb08
Subproject commit
2df351d378c0d3f674db43a3b86b59fc23ab5f6a
scripts/boot_patch.sh
View file @
f7b49356
...
@@ -63,9 +63,17 @@ BOOTIMAGE="$1"
...
@@ -63,9 +63,17 @@ BOOTIMAGE="$1"
# Presets
# Presets
[
-z
$KEEPVERITY
]
&&
KEEPVERITY
=
false
[
-z
$KEEPVERITY
]
&&
KEEPVERITY
=
false
[
-z
$KEEPFORCEENCRYPT
]
&&
KEEPFORCEENCRYPT
=
false
[
-z
$HIGHCOMP
]
&&
HIGHCOMP
=
false
[
-z
$HIGHCOMP
]
&&
HIGHCOMP
=
false
if
[
-z
$KEEPFORCEENCRYPT
]
;
then
if
[
"
`
getprop ro.crypto.state
`
"
=
"encrypted"
]
;
then
KEEPFORCEENCRYPT
=
true
ui_print
"- Encrypted data detected"
else
KEEPFORCEENCRYPT
=
false
fi
fi
chmod
-R
755
.
chmod
-R
755
.
# Extract magisk if doesn't exist
# Extract magisk if doesn't exist
...
@@ -113,7 +121,7 @@ ui_print "- Checking ramdisk status"
...
@@ -113,7 +121,7 @@ ui_print "- Checking ramdisk status"
./magiskboot
--cpio
ramdisk.cpio
test
./magiskboot
--cpio
ramdisk.cpio
test
case
$?
in
case
$?
in
0
)
# Stock boot
0
)
# Stock boot
ui_print
"- Stock boot image detected
!
"
ui_print
"- Stock boot image detected"
ui_print
"- Backing up stock boot image"
ui_print
"- Backing up stock boot image"
SHA1
=
`
./magiskboot
--sha1
"
$BOOTIMAGE
"
2>/dev/null
`
SHA1
=
`
./magiskboot
--sha1
"
$BOOTIMAGE
"
2>/dev/null
`
STOCKDUMP
=
stock_boot_
${
SHA1
}
.img.gz
STOCKDUMP
=
stock_boot_
${
SHA1
}
.img.gz
...
@@ -121,14 +129,14 @@ case $? in
...
@@ -121,14 +129,14 @@ case $? in
cp
-af
ramdisk.cpio ramdisk.cpio.orig
cp
-af
ramdisk.cpio ramdisk.cpio.orig
;;
;;
1
)
# Magisk patched
1
)
# Magisk patched
ui_print
"- Magisk patched image detected
!
"
ui_print
"- Magisk patched image detected"
# Find SHA1 of stock boot image
# Find SHA1 of stock boot image
[
-z
$SHA1
]
&&
SHA1
=
`
./magiskboot
--cpio
ramdisk.cpio sha1 2>/dev/null
`
[
-z
$SHA1
]
&&
SHA1
=
`
./magiskboot
--cpio
ramdisk.cpio sha1 2>/dev/null
`
./magiskboot
--cpio
ramdisk.cpio restore
./magiskboot
--cpio
ramdisk.cpio restore
cp
-af
ramdisk.cpio ramdisk.cpio.orig
cp
-af
ramdisk.cpio ramdisk.cpio.orig
;;
;;
2
)
# Other patched
2
)
# Other patched
ui_print
"! Boot image patched by other programs
!
"
ui_print
"! Boot image patched by other programs"
abort
"! Please restore stock boot image"
abort
"! Please restore stock boot image"
;;
;;
esac
esac
...
...
scripts/flash_script.sh
View file @
f7b49356
...
@@ -113,6 +113,13 @@ $BOOTMODE || recovery_actions
...
@@ -113,6 +113,13 @@ $BOOTMODE || recovery_actions
[
-z
$BOOTIMAGE
]
&&
abort
"! Unable to detect boot image"
[
-z
$BOOTIMAGE
]
&&
abort
"! Unable to detect boot image"
ui_print
"- Found boot image:
$BOOTIMAGE
"
ui_print
"- Found boot image:
$BOOTIMAGE
"
find_dtbo_image
if
[
!
-z
$DTBOIMAGE
]
;
then
ui_print
"- Found dtbo image:
$DTBOIMAGE
"
# Disable dtbo patch by default
[
-z
$KEEPVERITY
]
&&
KEEPVERITY
=
true
fi
eval
$BOOTSIGNER
-verify
<
$BOOTIMAGE
&&
BOOTSIGNED
=
true
eval
$BOOTSIGNER
-verify
<
$BOOTIMAGE
&&
BOOTSIGNED
=
true
$BOOTSIGNED
&&
ui_print
"- Signed boot image detected"
$BOOTSIGNED
&&
ui_print
"- Signed boot image detected"
...
...
scripts/magisk_uninstaller.sh
View file @
f7b49356
...
@@ -74,11 +74,11 @@ ui_print "- Checking ramdisk status"
...
@@ -74,11 +74,11 @@ ui_print "- Checking ramdisk status"
./magiskboot
--cpio
ramdisk.cpio
test
./magiskboot
--cpio
ramdisk.cpio
test
case
$?
in
case
$?
in
0
)
# Stock boot
0
)
# Stock boot
ui_print
"- Stock boot image detected
!
"
ui_print
"- Stock boot image detected"
abort
"! Magisk is not installed!"
abort
"! Magisk is not installed!"
;;
;;
1
)
# Magisk patched
1
)
# Magisk patched
ui_print
"- Magisk patched image detected
!
"
ui_print
"- Magisk patched image detected"
# Find SHA1 of stock boot image
# Find SHA1 of stock boot image
[
-z
$SHA1
]
&&
SHA1
=
`
./magiskboot
--cpio
ramdisk.cpio sha1 2>/dev/null
`
[
-z
$SHA1
]
&&
SHA1
=
`
./magiskboot
--cpio
ramdisk.cpio sha1 2>/dev/null
`
OK
=
false
OK
=
false
...
@@ -94,7 +94,7 @@ case $? in
...
@@ -94,7 +94,7 @@ case $? in
fi
fi
;;
;;
2
)
# Other patched
2
)
# Other patched
ui_print
"! Boot image patched by other programs
!
"
ui_print
"! Boot image patched by other programs"
abort
"! Cannot uninstall"
abort
"! Cannot uninstall"
;;
;;
esac
esac
...
...
scripts/util_functions.sh
View file @
f7b49356
...
@@ -133,6 +133,7 @@ migrate_boot_backup() {
...
@@ -133,6 +133,7 @@ migrate_boot_backup() {
$MAGISKBIN
/magiskboot
--compress
$STOCKDUMP
$MAGISKBIN
/magiskboot
--compress
$STOCKDUMP
fi
fi
mv
/data/magisk/stock_boot
*
/data 2>/dev/null
mv
/data/magisk/stock_boot
*
/data 2>/dev/null
mv
/data/magisk/adb/stock_boot
*
/data 2>/dev/null
}
}
flash_boot_image
()
{
flash_boot_image
()
{
...
@@ -161,9 +162,7 @@ find_dtbo_image() {
...
@@ -161,9 +162,7 @@ find_dtbo_image() {
}
}
patch_dtbo_image
()
{
patch_dtbo_image
()
{
find_dtbo_image
if
[
!
-z
$DTBOIMAGE
]
;
then
if
[
!
-z
$DTBOIMAGE
]
;
then
ui_print
"- Found dtbo image:
$DTBOIMAGE
"
if
$MAGISKBIN
/magiskboot
--dtb-test
$DTBOIMAGE
;
then
if
$MAGISKBIN
/magiskboot
--dtb-test
$DTBOIMAGE
;
then
ui_print
"- Backing up stock dtbo image"
ui_print
"- Backing up stock dtbo image"
$MAGISKBIN
/magiskboot
--compress
$DTBOIMAGE
$MAGISKBIN
/stock_dtbo.img.gz
$MAGISKBIN
/magiskboot
--compress
$DTBOIMAGE
$MAGISKBIN
/stock_dtbo.img.gz
...
...
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