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
5c1886c8
Commit
5c1886c8
authored
Aug 10, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update scripts
parent
afcb3d8f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
36 deletions
+32
-36
build.gradle
app/build.gradle
+1
-1
OnBootService.java
...ull/java/com/topjohnwu/magisk/services/OnBootService.java
+1
-3
utils.sh
app/src/full/res/raw/utils.sh
+9
-9
addon.d.sh
scripts/addon.d.sh
+2
-1
flash_script.sh
scripts/flash_script.sh
+2
-1
magisk_uninstaller.sh
scripts/magisk_uninstaller.sh
+5
-5
util_functions.sh
scripts/util_functions.sh
+12
-16
No files found.
app/build.gradle
View file @
5c1886c8
...
...
@@ -22,7 +22,7 @@ android {
productFlavors
{
full
{
versionCode
13
2
versionCode
13
4
versionName
"5.8.3"
javaCompileOptions
{
annotationProcessorOptions
{
...
...
app/src/full/java/com/topjohnwu/magisk/services/OnBootService.java
View file @
5c1886c8
...
...
@@ -25,9 +25,7 @@ public class OnBootService extends JobIntentService {
* Check for dtbo status every boot time, and prompt user
* to reboot if dtbo wasn't patched and patched by Magisk Manager.
* */
Shell
shell
=
Shell
.
newInstance
();
if
(
shell
.
getStatus
()
>=
Shell
.
ROOT_SHELL
&&
Boolean
.
parseBoolean
(
ShellUtils
.
fastCmd
(
shell
,
"mm_patch_dtbo"
)))
if
(
Shell
.
rootAccess
()
&&
ShellUtils
.
fastCmdResult
(
"mm_patch_dtbo"
))
NotificationMgr
.
dtboPatched
();
}
}
app/src/full/res/raw/utils.sh
View file @
5c1886c8
...
...
@@ -54,21 +54,22 @@ fix_env() {
}
direct_install
()
{
flash_boot_image
$1
$2
rm
-f
$1
rm
-rf
/data/adb/magisk/
*
2>/dev/null
mkdir
-p
/data/adb/magisk 2>/dev/null
chmod
700 /data/adb
cp
-rf
$3
/
*
/data/adb/magisk
echo
"- Flashing new boot image"
flash_image
$1
$2
rm
-f
$1
rm
-rf
$3
}
mm_patch_dtbo
()
{
if
$KEEPVERITY
;
then
echo false
return
1
else
find_dtbo_image
patch_dtbo_image
>
/dev/null 2>&1
&&
echo true
||
echo false
patch_dtbo_image
fi
}
...
...
@@ -83,12 +84,11 @@ restore_imgs() {
find_boot_image
find_dtbo_image
magisk
--unlock-blocks
2>/dev/null
if
[
-b
"
$DTBOIMAGE
"
-a
-f
$STOCKDTBO
]
;
then
gzip
-d
<
$STOCKDTBO
>
$DTBOIMAGE
if
[
-f
$STOCKDTBO
-a
-b
"
$DTBOIMAGE
"
]
;
then
flash_image
$STOCKDTBO
$DTBOIMAGE
fi
if
[
-
b
"
$BOOTIMAGE
"
-a
-f
$STOCKBOOT
]
;
then
gzip
-d
<
$STOCKBOOT
|
cat
- /dev/zero
>
$BOOTIMAGE
2>/dev/null
if
[
-
f
$STOCKBOOT
-a
-b
"
$BOOTIMAGE
"
]
;
then
flash_image
$STOCKBOOT
$BOOTIMAGE
return
0
fi
return
1
...
...
scripts/addon.d.sh
View file @
5c1886c8
...
...
@@ -64,7 +64,8 @@ installation() {
# Source the boot patcher
.
./boot_patch.sh
"
$BOOTIMAGE
"
flash_boot_image new-boot.img
"
$BOOTIMAGE
"
ui_print
"- Flashing new boot image"
flash_image new-boot.img
"
$BOOTIMAGE
"
rm
-f
new-boot.img
if
[
-f
stock_boot
*
]
;
then
...
...
scripts/flash_script.sh
View file @
5c1886c8
...
...
@@ -114,7 +114,8 @@ cd $MAGISKBIN
# Source the boot patcher
.
./boot_patch.sh
"
$BOOTIMAGE
"
flash_boot_image new-boot.img
"
$BOOTIMAGE
"
ui_print
"- Flashing new boot image"
flash_image new-boot.img
"
$BOOTIMAGE
"
rm
-f
new-boot.img
if
[
-f
stock_boot
*
]
;
then
...
...
scripts/magisk_uninstaller.sh
View file @
5c1886c8
...
...
@@ -95,17 +95,16 @@ case $? in
;;
1
)
# Magisk patched
ui_print
"- Magisk patched image detected"
./magisk
--unlock-blocks
2>/dev/null
# Find SHA1 of stock boot image
[
-z
$SHA1
]
&&
SHA1
=
`
./magiskboot
--cpio
ramdisk.cpio sha1 2>/dev/null
`
STOCKBOOT
=
/data/stock_boot_
${
SHA1
}
.img.gz
STOCKDTBO
=
/data/stock_dtbo.img.gz
if
[
-f
$STOCKBOOT
]
;
then
ui_print
"- Restoring stock boot image"
gzip
-d
<
$STOCKBOOT
|
cat
- /dev/zero
>
$BOOTIMAGE
2>/dev/null
if
[
-f
$
DTBOIMAGE
-a
-f
$STOCKDTBO
]
;
then
flash_image
$STOCKBOOT
$BOOTIMAGE
if
[
-f
$
STOCKDTBO
-a
-b
"
$DTBOIMAGE
"
]
;
then
ui_print
"- Restoring stock dtbo image"
gzip
-d
<
$STOCKDTBO
>
$DTBOIMAGE
flash_image
$STOCKDTBO
$DTBOIMAGE
fi
else
ui_print
"! Boot image backup unavailable"
...
...
@@ -114,7 +113,8 @@ case $? in
./magiskboot
--repack
$BOOTIMAGE
# Sign chromeos boot
$CHROMEOS
&&
sign_chromeos
flash_boot_image new-boot.img
$BOOTIMAGE
ui_print
"- Flashing restored boot image"
flash_image new-boot.img
$BOOTIMAGE
fi
;;
2
)
# Other patched
...
...
scripts/util_functions.sh
View file @
5c1886c8
...
...
@@ -189,29 +189,25 @@ find_boot_image() {
fi
}
flash_
boot_
image
()
{
flash_image
()
{
# Make sure all blocks are writable
$MAGISKBIN
/magisk
--unlock-blocks
2>/dev/null
case
"
$1
"
in
*
.gz
)
COM
MAND
=
"gzip -d < '
$1
'
"
;;
*
)
COM
MAND
=
"cat '
$1
'"
;;
*
.gz
)
COM
1
=
"
$MAGISKBIN
/magiskboot --decompress '
$1
' - 2>/dev/null
"
;;
*
)
COM
1
=
"cat '
$1
'"
;;
esac
if
$BOOTSIGNED
;
then
SIGNCOM
=
"
$BOOTSIGNER
-sign"
ui_print
"- Sign
boot
image with test keys"
COM2
=
"
$BOOTSIGNER
-sign"
ui_print
"- Sign image with test keys"
else
SIGNCOM
=
"cat -"
COM2
=
"cat -"
fi
if
[
-b
"
$2
"
]
;
then
eval
$COM1
|
eval
$COM2
|
cat
- /dev/zero
>
"
$2
"
2>/dev/null
else
ui_print
"- Not block device, storing image"
eval
$COM1
|
eval
$COM2
>
"
$2
"
2>/dev/null
fi
case
"
$2
"
in
/dev/block/
*
)
ui_print
"- Flashing new boot image"
eval
$COMMAND
|
eval
$SIGNCOM
|
cat
- /dev/zero 2>/dev/null |
dd
of
=
"
$2
"
bs
=
4096 2>/dev/null
;;
*
)
ui_print
"- Storing new boot image"
eval
$COMMAND
|
eval
$SIGNCOM
|
dd
of
=
"
$2
"
bs
=
4096 2>/dev/null
;;
esac
}
find_dtbo_image
()
{
...
...
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