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
5921d3a4
Commit
5921d3a4
authored
Nov 13, 2016
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update scripts
parent
dbbc8571
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
20 deletions
+12
-20
flash_script.sh
scripts/flash_script.sh
+2
-9
magic_mask.sh
scripts/magic_mask.sh
+10
-11
No files found.
scripts/flash_script.sh
View file @
5921d3a4
...
@@ -249,6 +249,7 @@ fi
...
@@ -249,6 +249,7 @@ fi
ui_print
"- Device platform:
$ARCH
"
ui_print
"- Device platform:
$ARCH
"
BINDIR
=
$INSTALLER
/
$ARCH
BINDIR
=
$INSTALLER
/
$ARCH
chmod
-R
755
$CHROMEDIR
/futility
$BINDIR
find_boot_image
find_boot_image
if
[
-z
"
$BOOTIMAGE
"
]
;
then
if
[
-z
"
$BOOTIMAGE
"
]
;
then
...
@@ -267,13 +268,11 @@ if (is_mounted /data); then
...
@@ -267,13 +268,11 @@ if (is_mounted /data); then
mkdir
-p
/data/busybox
mkdir
-p
/data/busybox
cp
-af
$BINDIR
/data/magisk
cp
-af
$BINDIR
/data/magisk
cp
-af
$INSTALLER
/common/init.magisk.rc
$INSTALLER
/common/magic_mask.sh /data/magisk
cp
-af
$INSTALLER
/common/init.magisk.rc
$INSTALLER
/common/magic_mask.sh /data/magisk
chmod
-R
755 /data/magisk
chcon
-R
"u:object_r:system_file:s0"
/data/magisk
/data/magisk/busybox
--install
-s
/data/busybox
/data/magisk/busybox
--install
-s
/data/busybox
ln
-s
/data/magisk/busybox /data/busybox/busybox
ln
-s
/data/magisk/busybox /data/busybox/busybox
# Prevent issues
# Prevent issues
rm
-f
/data/busybox/su /data/busybox/sh
rm
-f
/data/busybox/su /data/busybox/sh
chcon
-R
"u:object_r:system_file:s0"
/data/magisk /data/busybox
chcon
-
h
R
"u:object_r:system_file:s0"
/data/magisk /data/busybox
chmod
-R
755 /data/magisk /data/busybox
chmod
-R
755 /data/magisk /data/busybox
PATH
=
/data/busybox:
$PATH
PATH
=
/data/busybox:
$PATH
else
else
...
@@ -314,10 +313,6 @@ MAGISKLOOP=$LOOPDEVICE
...
@@ -314,10 +313,6 @@ MAGISKLOOP=$LOOPDEVICE
mkdir
-p
/magisk/.core/magiskhide 2>/dev/null
mkdir
-p
/magisk/.core/magiskhide 2>/dev/null
cp
-af
$INSTALLER
/common/magiskhide/. /magisk/.core/magiskhide
cp
-af
$INSTALLER
/common/magiskhide/. /magisk/.core/magiskhide
# Remove legacy SuperSU module
mkdir
-p
/magisk/zzsupersu
touch
/magisk/zzsupersu/remove
##########################################################################################
##########################################################################################
# Boot image patch
# Boot image patch
##########################################################################################
##########################################################################################
...
@@ -332,8 +327,6 @@ NEWBOOT=$TMPDIR/boottmp/new-boot.img
...
@@ -332,8 +327,6 @@ NEWBOOT=$TMPDIR/boottmp/new-boot.img
UNPACKDIR
=
$TMPDIR
/boottmp/bootunpack
UNPACKDIR
=
$TMPDIR
/boottmp/bootunpack
RAMDISK
=
$TMPDIR
/boottmp/ramdisk
RAMDISK
=
$TMPDIR
/boottmp/ramdisk
chmod
777
$CHROMEDIR
/futility
$BINDIR
/
*
ORIGBOOT
=
$BOOTIMAGE
ORIGBOOT
=
$BOOTIMAGE
ui_print
"- Unpacking boot image"
ui_print
"- Unpacking boot image"
...
...
scripts/magic_mask.sh
View file @
5921d3a4
...
@@ -237,20 +237,19 @@ case $1 in
...
@@ -237,20 +237,19 @@ case $1 in
log_print
"** Magisk post-fs mode running..."
log_print
"** Magisk post-fs mode running..."
# Cleanup previous stuffs...
# Cleanup previous
version
stuffs...
rm
-rf
/cache/magisk /cache/magisk_merge /cache/magiskhide.log
rm
-rf
/cache/magisk /cache/magisk_merge /cache/magiskhide.log
if
[
-d
"/cache/magisk_
bootanim
"
]
;
then
if
[
-d
"/cache/magisk_
mount
"
]
;
then
log_print
"Mounting c
ustom Boot Animation
"
log_print
"Mounting c
ache files
"
find /cache/magisk_
bootanim
-type
f 2>/dev/null |
while
read
ITEM
;
do
find /cache/magisk_
mount
-type
f 2>/dev/null |
while
read
ITEM
;
do
chmod
644
"
$ITEM
"
chmod
644
"
$ITEM
"
chcon
"u:object_r:system_file:s0"
"
$ITEM
"
chcon
"u:object_r:system_file:s0"
"
$ITEM
"
TARGET
=
"
${
ITEM
#/cache/magisk_
bootanim
}
"
TARGET
=
"
${
ITEM
#/cache/magisk_
mount
}
"
bind_mount
"
$ITEM
"
"
$TARGET
"
bind_mount
"
$ITEM
"
"
$TARGET
"
done
done
fi
fi
unblock
unblock
;;
;;
...
@@ -290,7 +289,7 @@ case $1 in
...
@@ -290,7 +289,7 @@ case $1 in
mv
/cache/stock_boot.img /data 2>/dev/null
mv
/cache/stock_boot.img /data 2>/dev/null
chcon
-R
"u:object_r:system_file:s0"
$BINPATH
$TOOLPATH
chcon
-
h
R
"u:object_r:system_file:s0"
$BINPATH
$TOOLPATH
chmod
-R
755
$BINPATH
$TOOLPATH
chmod
-R
755
$BINPATH
$TOOLPATH
# Image merging
# Image merging
...
@@ -318,7 +317,7 @@ case $1 in
...
@@ -318,7 +317,7 @@ case $1 in
# Remove modules
# Remove modules
for
MOD
in
$MOUNTPOINT
/
*
;
do
for
MOD
in
$MOUNTPOINT
/
*
;
do
if
[
-f
"
$MOD
/remove"
]
;
then
if
[
-f
"
$MOD
/remove"
]
||
[
"
$MOD
"
=
"zzsupersu"
]
;
then
log_print
"Remove module:
$MOD
"
log_print
"Remove module:
$MOD
"
rm
-rf
$MOD
rm
-rf
$MOD
fi
fi
...
@@ -377,7 +376,7 @@ case $1 in
...
@@ -377,7 +376,7 @@ case $1 in
done
done
# Proper permissions for generated items
# Proper permissions for generated items
chcon
-R
"u:object_r:system_file:s0"
$TMPDIR
chcon
-
h
R
"u:object_r:system_file:s0"
$TMPDIR
# Stage 2
# Stage 2
log_print
"Bind mount module items"
log_print
"Bind mount module items"
...
@@ -402,8 +401,8 @@ case $1 in
...
@@ -402,8 +401,8 @@ case $1 in
log_print
"Enabling BusyBox"
log_print
"Enabling BusyBox"
$TOOLPATH
/cp
-afc
/data/busybox/.
$COREDIR
/busybox
$TOOLPATH
/cp
-afc
/data/busybox/.
$COREDIR
/busybox
$TOOLPATH
/cp
-afc
/system/xbin/.
$COREDIR
/busybox
$TOOLPATH
/cp
-afc
/system/xbin/.
$COREDIR
/busybox
chmod
755
$COREDIR
/busybox
chmod
-R
755
$COREDIR
/busybox
chcon
"u:object_r:system_file:s0"
$COREDIR
/busybox
chcon
-hR
"u:object_r:system_file:s0"
$COREDIR
/busybox
bind_mount
$COREDIR
/busybox /system/xbin
bind_mount
$COREDIR
/busybox /system/xbin
fi
fi
...
...
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