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
a8311108
Commit
a8311108
authored
Oct 31, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add boot signing to installation
parent
e97bdb53
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
25 deletions
+19
-25
README.MD
README.MD
+7
-21
java
java
+1
-1
flash_script.sh
scripts/flash_script.sh
+5
-1
util_functions.sh
scripts/util_functions.sh
+6
-2
No files found.
README.MD
View file @
a8311108
...
...
@@ -2,11 +2,7 @@
## How to build Magisk
#### Building has been tested on 3 major platforms:
**macOS 10.12**
**Ubuntu 17.04 x64**
**Windows 10 x64**
#### Building has been tested on 3 major platforms: macOS, Ubuntu, Windows 10
#### Environment Requirements
...
...
@@ -14,8 +10,8 @@
2.
Python 3.5+: to run the build script
3.
Java Development Kit (JDK) 8: To compile Magisk Manager and sign zips
4.
C compiler (Unix only): To build
`zipadjust`
. Windows users can use the pre-built
`zipadjust.exe`
5.
Android SDK:
`ANDROID_HOME`
environment variable should point to the Android SDK folder
6.
Android NDK: Install NDK via
`sdkmanager`
, or via Android SDK Manager in Android Studio
5.
Latest
Android SDK:
`ANDROID_HOME`
environment variable should point to the Android SDK folder
6.
Latest
Android NDK: Install NDK via
`sdkmanager`
, or via Android SDK Manager in Android Studio
#### Instructions and Notes
...
...
@@ -29,7 +25,7 @@
## License
```
Magisk, including all
subprojects (git submodule) is
free software:
Magisk, including all
git submodules are
free software:
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.
...
...
@@ -67,29 +63,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
**MagiskHide**
(
`jni/magiskhide`
)
*
Copyright 2016-2017, John Wu (@topjohnwu)
*
Copyright 2016, Pierre-Hugues Husson (phh@phh.me)
(original hidesu)
*
Copyright 2016, Pierre-Hugues Husson (phh@phh.me)
**resetprop**
(
`jni/resetprop`
)
*
Copyright 2016-2017 John Wu (@topjohnwu)
*
Copyright 2016 nkk71 (nkk71x@gmail.com)
**SELinux**
(
`jni/selinux`
)
*
Makefile for NDK: Copyright 2016-2017, John Wu (@topjohnwu)
*
Maintained by many developers in SELinux project
**ndk-compression**
(
`jni/ndk-compression`
)
*
Makefile for NDK: Copyright 2017, John Wu (@topjohnwu)
*
Each library has its own copyright message in corresponding directories
**ndk-busybox**
(
`jni/busybox`
)
**ndk-busybox**
(
`jni/external/busybox`
)
*
Makefile for NDK, generated by
[
ndk-busybox-kitchen
](
https://github.com/topjohnwu/ndk-busybox-kitchen
)
: Copyright 2017, John Wu (@topjohnwu)
*
Patches for NDK: Many contributors along the way, all placed in
[
osm0sis/android-busybox-ndk
](
https://github.com/osm0sis/android-busybox-ndk
)
*
The copyright message for busybox should be included in its own directory
**Others Not Mentioned**
**Others Not Mentioned**
(exclude
`jni/external`
)
*
Copyright 2016-2017, John Wu (@topjohnwu)
java
@
fdd700f3
Subproject commit
05f41928cd0f72ddab557c8db6c2fc11c3fd08e6
Subproject commit
fdd700f3e5c2f9d7688d2434d4dbee8c12524411
scripts/flash_script.sh
View file @
a8311108
...
...
@@ -22,6 +22,7 @@ TMPDIR=/dev/tmp
INSTALLER
=
$TMPDIR
/install
COMMONDIR
=
$INSTALLER
/common
APK
=
$COMMONDIR
/magisk.apk
CHROMEDIR
=
$INSTALLER
/chromeos
COREDIR
=
/magisk/.core
...
...
@@ -109,7 +110,10 @@ $BOOTMODE || recovery_actions
find_boot_image
[
-z
$BOOTIMAGE
]
&&
abort
"! Unable to detect boot image"
ui_print
"- Found Boot Image:
$BOOTIMAGE
"
ui_print
"- Found boot image:
$BOOTIMAGE
"
eval
$BOOTSIGNER
-verify
<
$BOOTIMAGE
&&
BOOTSIGNED
=
true
$BOOTSIGNED
&&
ui_print
"- Signed boot image detected"
SOURCEDMODE
=
true
cd
$MAGISKBIN
...
...
scripts/util_functions.sh
View file @
a8311108
...
...
@@ -13,6 +13,9 @@ SCRIPT_VERSION=$MAGISK_VER_CODE
# Default location, will override if needed
MAGISKBIN
=
/data/magisk
BOOTSIGNER
=
"/system/bin/dalvikvm -Xnodex2oat -Xnoimage-dex2oat -cp
\$
APK com.topjohnwu.magisk.utils.BootSigner"
BOOTSIGNED
=
false
get_outfd
()
{
readlink
/proc/
$$
/fd/
$OUTFD
2>/dev/null |
grep
/tmp
>
/dev/null
if
[
"
$?
"
-eq
"0"
]
;
then
...
...
@@ -137,14 +140,15 @@ flash_boot_image() {
*
.gz
)
COMMAND
=
"gzip -d <
\"
$1
\"
"
;;
*
)
COMMAND
=
"cat
\"
$1
\"
"
;;
esac
$BOOTSIGNED
&&
SIGNCOM
=
"
$BOOTSIGNER
-sign"
||
SIGNCOM
=
"cat -"
case
"
$2
"
in
/dev/block/
*
)
ui_print
"- Flashing new boot image"
eval
$COMMAND
|
cat
- /dev/zero |
dd
of
=
"
$2
"
bs
=
4096
>
/dev/null 2>&1
eval
$COMMAND
|
eval
$SIGNCOM
|
cat
- /dev/zero |
dd
of
=
"
$2
"
bs
=
4096
>
/dev/null 2>&1
;;
*
)
ui_print
"- Storing new boot image"
eval
$COMMAND
|
dd
of
=
"
$2
"
bs
=
4096
>
/dev/null 2>&1
eval
$COMMAND
|
eval
$SIGNCOM
|
dd
of
=
"
$2
"
bs
=
4096
>
/dev/null 2>&1
;;
esac
}
...
...
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