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
e5c31830
Commit
e5c31830
authored
Jan 01, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update scripts
parent
930c8231
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
36 deletions
+31
-36
app
app
+1
-1
daemon.c
core/jni/core/daemon.c
+0
-5
addon.d.sh
scripts/addon.d.sh
+0
-10
boot_patch.sh
scripts/boot_patch.sh
+0
-2
flash_script.sh
scripts/flash_script.sh
+2
-8
magisk_uninstaller.sh
scripts/magisk_uninstaller.sh
+1
-5
util_functions.sh
scripts/util_functions.sh
+27
-5
No files found.
app
@
836d9afe
Subproject commit
1adf331268476405f22725518335ef49f6999fd9
Subproject commit
836d9afe1756070971731198d39e69c78cf3b527
core/jni/core/daemon.c
View file @
e5c31830
...
...
@@ -129,11 +129,6 @@ void daemon_init() {
unlink
(
"/data/magisk_debug.log"
);
chmod
(
"/data/adb"
,
0700
);
// Use shell glob to match files
exec_command_sync
(
"sh"
,
"-c"
,
"mv -f /data/adb/magisk/stock_*.img.gz /data;"
"rm -f /data/user*/*/magisk.db;"
,
NULL
);
LOGI
(
"* Creating /sbin overlay"
);
DIR
*
dir
;
struct
dirent
*
entry
;
...
...
scripts/addon.d.sh
View file @
e5c31830
...
...
@@ -13,8 +13,6 @@
main
()
{
# Magisk binaries
MAGISKBIN
=
/data/adb/magisk
# This script always runs in recovery
BOOTMODE
=
false
mount /data 2>/dev/null
...
...
@@ -41,7 +39,6 @@ main() {
remove_system_su
find_boot_image
[
-z
$BOOTIMAGE
]
&&
abort
"! Unable to detect boot image"
ui_print
"- Found boot image:
$BOOTIMAGE
"
...
...
@@ -59,13 +56,6 @@ main() {
mv
stock_boot
*
/data
fi
patch_dtbo_image
if
[
-f
stock_dtbo
*
]
;
then
rm
-f
/data/stock_dtbo
*
2>/dev/null
mv
stock_dtbo
*
/data
fi
cd
/
recovery_cleanup
...
...
scripts/boot_patch.sh
View file @
e5c31830
...
...
@@ -83,8 +83,6 @@ chmod -R 755 .
# Unpack
##########################################################################################
migrate_boot_backup
CHROMEOS
=
false
ui_print
"- Unpacking boot image"
...
...
scripts/flash_script.sh
View file @
e5c31830
...
...
@@ -13,10 +13,6 @@
# Preparation
##########################################################################################
# Detect whether in boot mode
ps |
grep
zygote |
grep
-v
grep
>
/dev/null
&&
BOOTMODE
=
true
||
BOOTMODE
=
false
$BOOTMODE
||
ps
-A
2>/dev/null |
grep
zygote |
grep
-v
grep
>
/dev/null
&&
BOOTMODE
=
true
# This path should work in any cases
TMPDIR
=
/dev/tmp
...
...
@@ -24,7 +20,6 @@ INSTALLER=$TMPDIR/install
COMMONDIR
=
$INSTALLER
/common
APK
=
$COMMONDIR
/magisk.apk
CHROMEDIR
=
$INSTALLER
/chromeos
COREDIR
=
/magisk/.core
# Default permissions
umask
022
...
...
@@ -83,8 +78,8 @@ if is_mounted /data; then
chmod
700 /data/adb 2>/dev/null
# Some legacy migration
mv
/data/magisk/stock_boot
*
/data 2>/dev/null
[
-L
/data/magisk.img
]
||
mv
/data/magisk.img /data/adb/magisk.img
run_migrations
[
-L
/data/magisk.img
]
||
mv
/data/magisk.img /data/adb/magisk.img
2>/dev/null
else
MAGISKBIN
=
/cache/data_bin
fi
...
...
@@ -113,7 +108,6 @@ $BOOTMODE || recovery_actions
[
-z
$BOOTIMAGE
]
&&
abort
"! Unable to detect boot image"
ui_print
"- Found boot image:
$BOOTIMAGE
"
find_dtbo_image
if
[
!
-z
$DTBOIMAGE
]
;
then
ui_print
"- Found dtbo image:
$DTBOIMAGE
"
# Disable dtbo patch by default
...
...
scripts/magisk_uninstaller.sh
View file @
e5c31830
...
...
@@ -34,20 +34,16 @@ fi
if
$BOOTMODE
;
then
# Load utility functions
.
$MAGISKBIN
/util_functions.sh
BOOTMODE
=
true
boot_actions
mount_partitions
fi
cd
$MAGISKBIN
# Find the boot image
find_boot_image
[
-z
$BOOTIMAGE
]
&&
abort
"! Unable to detect boot image"
ui_print
"- Found Boot Image:
$BOOTIMAGE
"
migrate_boot_backup
ui_print
"- Unpacking boot image"
./magiskboot
--unpack
"
$BOOTIMAGE
"
CHROMEOS
=
false
...
...
scripts/util_functions.sh
View file @
e5c31830
...
...
@@ -10,6 +10,11 @@
#MAGISK_VERSION_STUB
SCRIPT_VERSION
=
$MAGISK_VER_CODE
# Detect whether in boot mode
ps |
grep
zygote |
grep
-v
grep
>
/dev/null
&&
BOOTMODE
=
true
||
BOOTMODE
=
false
$BOOTMODE
||
ps
-A
2>/dev/null |
grep
zygote |
grep
-v
grep
>
/dev/null
&&
BOOTMODE
=
true
$BOOTMODE
||
id
|
grep
-q
'uid=0'
||
BOOTMODE
=
true
# Default location, will override if needed
MAGISKBIN
=
/data/adb/magisk
[
-z
$MOUNTPATH
]
&&
MOUNTPATH
=
/sbin/.core/img
...
...
@@ -47,7 +52,12 @@ mount_partitions() {
SLOT
=
_
`
getprop ro.boot.slot
`
[
$SLOT
=
"_"
]
&&
SLOT
=
fi
# Check the boot image to make sure the slot actually make sense
find_boot_image
find_dtbo_image
[
-z
$SLOT
]
||
ui_print
"- A/B partition detected, current slot:
$SLOT
"
ui_print
"- Mounting /system, /vendor"
is_mounted /system
||
[
-f
/system/build.prop
]
||
mount
-o
ro /system 2>/dev/null
if
!
is_mounted /system
&&
!
[
-f
/system/build.prop
]
;
then
...
...
@@ -105,7 +115,10 @@ find_boot_image() {
BOOTIMAGE
=
if
[
!
-z
$SLOT
]
;
then
BOOTIMAGE
=
`
find /dev/block
-iname
boot
$SLOT
|
head
-n
1
`
2>/dev/null
else
fi
if
[
-z
"
$BOOTIMAGE
"
]
;
then
# The slot info is incorrect...
SLOT
=
for
BLOCK
in
boot_a kern-a android_boot kernel boot lnx bootimg
;
do
BOOTIMAGE
=
`
find /dev/block
-iname
$BLOCK
|
head
-n
1
`
2>/dev/null
[
!
-z
$BOOTIMAGE
]
&&
break
...
...
@@ -118,10 +131,10 @@ find_boot_image() {
[
!
-z
$BOOTIMAGE
]
&&
break
done
fi
BOOTIMAGE
=
`
resolve_link
$BOOTIMAGE
`
[
!
-z
"
$BOOTIMAGE
"
]
&&
BOOTIMAGE
=
`
resolve_link
$BOOTIMAGE
`
}
migrate_boot_backup
()
{
run_migrations
()
{
# Update the broken boot backup
if
[
-f
/data/stock_boot_.img.gz
]
;
then
$MAGISKBIN
/magiskboot
--decompress
/data/stock_boot_.img.gz /data/stock_boot.img
...
...
@@ -134,8 +147,17 @@ migrate_boot_backup() {
mv
/data/stock_boot.img
$STOCKDUMP
$MAGISKBIN
/magiskboot
--compress
$STOCKDUMP
fi
mv
/data/magisk/stock_boot
*
/data 2>/dev/null
mv
/data/magisk/adb/stock_boot
*
/data 2>/dev/null
# Move the stock backups
if
[
-f
/data/magisk/stock_boot
*
]
;
then
rm
-rf
/data/stock_boot
*
mv
/data/magisk/stock_boot
*
/data 2>/dev/null
fi
if
[
-f
/data/adb/magisk/stock_boot
*
]
;
then
rm
-rf
/data/stock_boot
*
mv
/data/adb/magisk/stock_boot
*
/data 2>/dev/null
fi
# Remove old dbs
rm
-f
/data/user
*
/
*
/magisk.db
}
flash_boot_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