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
9522255e
Commit
9522255e
authored
Aug 16, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper magisk manual injection support
parent
2a22fa69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
boot_patch.sh
scripts/boot_patch.sh
+4
-5
update_binary.sh
scripts/update_binary.sh
+13
-5
No files found.
scripts/boot_patch.sh
View file @
9522255e
...
@@ -91,15 +91,14 @@ cpio_mkdir() {
...
@@ -91,15 +91,14 @@ cpio_mkdir() {
# Initialization
# Initialization
##########################################################################################
##########################################################################################
[
-z
$1
]
&&
abort_wrap
"This script requires a boot image as a parameter"
CWD
=
`
pwd
`
CWD
=
`
pwd
`
cd
"
`
dirname_wrap
$1
`
"
cd
"
`
dirname_wrap
$1
`
"
BOOTIMAGE
=
"
`
pwd
`
/
`
basename_wrap
$1
`
"
BOOTIMAGE
=
"
`
pwd
`
/
`
basename_wrap
$1
`
"
cd
"
$CWD
"
cd
"
$CWD
"
if
[
-z
"
$BOOTIMAGE
"
]
;
then
[
-e
"
$BOOTIMAGE
"
]
||
abort_wrap
"
$BOOTIMAGE
does not exist!"
ui_print_wrap
"This script requires a boot image as a parameter"
exit
1
fi
# Presets
# Presets
[
-z
$KEEPVERITY
]
&&
KEEPVERITY
=
false
[
-z
$KEEPVERITY
]
&&
KEEPVERITY
=
false
...
@@ -115,11 +114,11 @@ chmod +x ./*
...
@@ -115,11 +114,11 @@ chmod +x ./*
##########################################################################################
##########################################################################################
# Unpack
# Unpack
##########################################################################################
##########################################################################################
CHROMEOS
=
false
ui_print_wrap
"- Unpacking boot image"
ui_print_wrap
"- Unpacking boot image"
./magiskboot
--unpack
"
$BOOTIMAGE
"
./magiskboot
--unpack
"
$BOOTIMAGE
"
CHROMEOS
=
false
case
$?
in
case
$?
in
1
)
1
)
abort_wrap
"! Unable to unpack boot image"
abort_wrap
"! Unable to unpack boot image"
...
...
scripts/update_binary.sh
View file @
9522255e
# EX_ARM, EX_X86, BB_ARM, and BB_X86 should be generated in build.py
# EX_ARM, EX_X86, BB_ARM, and BB_X86 should be generated in build.py
TMPDIR
=
/dev/tmp
;
INSTALLER
=
$TMPDIR
/install
;
BBDIR
=
$TMPDIR
/bin
[
"
$1
"
=
"indep"
]
&&
INDEP
=
true
||
INDEP
=
false
$INDEP
&&
TMPDIR
=
/data/local/tmp
||
TMPDIR
=
/dev/tmp
INSTALLER
=
$TMPDIR
/install
;
BBDIR
=
$TMPDIR
/bin
EXBIN
=
$BBDIR
/b64xz
;
BBBIN
=
$BBDIR
/busybox
EXBIN
=
$BBDIR
/b64xz
;
BBBIN
=
$BBDIR
/busybox
rm
-rf
$TMPDIR
2>/dev/null
;
mkdir
-p
$BBDIR
$INDEP
||
rm
-rf
$TMPDIR
2>/dev/null
;
mkdir
-p
$BBDIR
2>/dev/null
touch
$EXBIN
$BBBIN
;
chmod
755
$EXBIN
$BBBIN
touch
$EXBIN
$BBBIN
;
chmod
755
$EXBIN
$BBBIN
echo
-ne
$EX_ARM
>
$EXBIN
echo
-ne
$EX_ARM
>
$EXBIN
if
$EXBIN
--test
2>/dev/null
;
then
if
$EXBIN
--test
2>/dev/null
;
then
...
@@ -12,6 +15,11 @@ else
...
@@ -12,6 +15,11 @@ else
fi
fi
$BBBIN
--install
-s
$TMPDIR
/bin
$BBBIN
--install
-s
$TMPDIR
/bin
export
PATH
=
$BBDIR
:
$PATH
export
PATH
=
$BBDIR
:
$PATH
mkdir
-p
$INSTALLER
if
$INDEP
;
then
unzip
-o
"
$3
"
-d
$INSTALLER
shift
exec
sh
$INSTALLER
/META-INF/com/google/android/updater-script
$@
exec
sh
$@
else
mkdir
-p
$INSTALLER
unzip
-o
"
$3
"
-d
$INSTALLER
exec
sh
$INSTALLER
/META-INF/com/google/android/updater-script
$@
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