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
edaf8787
Commit
edaf8787
authored
Jul 30, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide external files to Magisk Manager with build script
parent
24164c85
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
24 deletions
+58
-24
README.MD
README.MD
+24
-19
build.py
build.py
+34
-5
private.key.pk8
ziptools/private.key.pk8
+0
-0
public.certificate.x509.pem
ziptools/public.certificate.x509.pem
+0
-0
No files found.
README.MD
View file @
edaf8787
...
@@ -68,11 +68,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
...
@@ -68,11 +68,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
**SELinux**
(
`jni/selinux`
)
**SELinux**
(
`jni/selinux`
)
*
Makefile for NDK: Copyright 2016-2017, John Wu (@topjohnwu)
*
Makefile for NDK: Copyright 2016-2017, John Wu (@topjohnwu)
*
It is maintained by many developers in SELinux project, copyright belongs to them
*
Maintained by many developers in SELinux project
**ndk-compression**
(
`jni/ndk-compression`
)
**ndk-compression**
(
`jni/ndk-compression`
)
*
Makefile for NDK: Copyright 2017, John Wu (@topjohnwu)
*
Makefile for NDK: Copyright 2017, John Wu (@topjohnwu)
*
Each library has its own copyright message in each directories
*
Each library has its own copyright message in corresponding directories
**ndk-busybox**
(
`jni/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**
*
Copyright 2016-2017, John Wu (@topjohnwu)
*
Copyright 2016-2017, John Wu (@topjohnwu)
build.py
View file @
edaf8787
...
@@ -34,6 +34,7 @@ import multiprocessing
...
@@ -34,6 +34,7 @@ import multiprocessing
import
zipfile
import
zipfile
import
datetime
import
datetime
import
errno
import
errno
import
shutil
def
silentremove
(
file
):
def
silentremove
(
file
):
try
:
try
:
...
@@ -45,7 +46,7 @@ def silentremove(file):
...
@@ -45,7 +46,7 @@ def silentremove(file):
def
zip_with_msg
(
zipfile
,
source
,
target
):
def
zip_with_msg
(
zipfile
,
source
,
target
):
if
not
os
.
path
.
exists
(
source
):
if
not
os
.
path
.
exists
(
source
):
error
(
'{} does not exist! Try build
\'
binary
\'
and
\'
apk
\'
before zipping!'
.
format
(
source
))
error
(
'{} does not exist! Try build
\'
binary
\'
and
\'
apk
\'
before zipping!'
.
format
(
source
))
print
(
'zip:
'
+
source
+
' -> '
+
target
)
print
(
'zip:
{} -> {}'
.
format
(
source
,
target
)
)
zipfile
.
write
(
source
,
target
)
zipfile
.
write
(
source
,
target
)
def
build_all
(
args
):
def
build_all
(
args
):
...
@@ -67,6 +68,34 @@ def build_binary(args):
...
@@ -67,6 +68,34 @@ def build_binary(args):
def
build_apk
(
args
):
def
build_apk
(
args
):
header
(
'* Building Magisk Manager'
)
header
(
'* Building Magisk Manager'
)
for
arch
in
[
'armeabi-v7a'
,
'x86'
]:
source
=
os
.
path
.
join
(
'libs'
,
arch
,
'busybox'
)
target
=
os
.
path
.
join
(
'MagiskManager'
,
'app'
,
'src'
,
'main'
,
'jniLibs'
,
arch
)
if
not
os
.
path
.
exists
(
source
):
error
(
'{} does not exist! Please build
\'
binary
\'
before building apk'
.
format
(
source
))
if
not
os
.
path
.
exists
(
target
):
os
.
makedirs
(
target
)
target
=
os
.
path
.
join
(
target
,
'libbusybox.so'
)
print
(
'cp: {} -> {}'
.
format
(
source
,
target
))
shutil
.
copyfile
(
source
,
target
)
for
key
in
[
'public.certificate.x509.pem'
,
'private.key.pk8'
]:
source
=
os
.
path
.
join
(
'ziptools'
,
key
)
target
=
os
.
path
.
join
(
'MagiskManager'
,
'app'
,
'src'
,
'main'
,
'assets'
,
key
)
print
(
'cp: {} -> {}'
.
format
(
source
,
target
))
shutil
.
copyfile
(
source
,
target
)
for
script
in
[
'magisk_uninstaller.sh'
,
'util_functions.sh'
]:
source
=
os
.
path
.
join
(
'scripts'
,
script
)
target
=
os
.
path
.
join
(
'MagiskManager'
,
'app'
,
'src'
,
'main'
,
'assets'
,
script
)
print
(
'cp: {} -> {}'
.
format
(
source
,
target
))
with
open
(
source
,
'r'
)
as
file
:
script_cont
=
file
.
read
()
.
replace
(
'MAGISK_VERSION_STUB'
,
''
)
with
open
(
target
,
'w'
)
as
file
:
file
.
write
(
script_cont
)
print
(
''
)
os
.
chdir
(
'MagiskManager'
)
os
.
chdir
(
'MagiskManager'
)
if
args
.
release
:
if
args
.
release
:
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
'..'
,
'release_signature.jks'
)):
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
'..'
,
'release_signature.jks'
)):
...
@@ -114,8 +143,8 @@ def sign_adjust_zip(unsigned, output):
...
@@ -114,8 +143,8 @@ def sign_adjust_zip(unsigned, output):
# Unsigned->signed
# Unsigned->signed
proc
=
subprocess
.
run
([
'java'
,
'-jar'
,
os
.
path
.
join
(
'ziptools'
,
'signapk.jar'
),
proc
=
subprocess
.
run
([
'java'
,
'-jar'
,
os
.
path
.
join
(
'ziptools'
,
'signapk.jar'
),
os
.
path
.
join
(
'ziptools'
,
'
test
.certificate.x509.pem'
),
os
.
path
.
join
(
'ziptools'
,
'
public
.certificate.x509.pem'
),
os
.
path
.
join
(
'ziptools'
,
'
test
.key.pk8'
),
unsigned
,
'tmp_signed.zip'
])
os
.
path
.
join
(
'ziptools'
,
'
private
.key.pk8'
),
unsigned
,
'tmp_signed.zip'
])
if
proc
.
returncode
!=
0
:
if
proc
.
returncode
!=
0
:
error
(
'First sign flashable zip failed!'
)
error
(
'First sign flashable zip failed!'
)
...
@@ -132,8 +161,8 @@ def sign_adjust_zip(unsigned, output):
...
@@ -132,8 +161,8 @@ def sign_adjust_zip(unsigned, output):
# Adjusted -> output
# Adjusted -> output
proc
=
subprocess
.
run
([
'java'
,
'-jar'
,
os
.
path
.
join
(
'ziptools'
,
'minsignapk.jar'
),
proc
=
subprocess
.
run
([
'java'
,
'-jar'
,
os
.
path
.
join
(
'ziptools'
,
'minsignapk.jar'
),
os
.
path
.
join
(
'ziptools'
,
'
test
.certificate.x509.pem'
),
os
.
path
.
join
(
'ziptools'
,
'
public
.certificate.x509.pem'
),
os
.
path
.
join
(
'ziptools'
,
'
test
.key.pk8'
),
'tmp_adjusted.zip'
,
output
])
os
.
path
.
join
(
'ziptools'
,
'
private
.key.pk8'
),
'tmp_adjusted.zip'
,
output
])
if
proc
.
returncode
!=
0
:
if
proc
.
returncode
!=
0
:
error
(
'Second sign flashable zip failed!'
)
error
(
'Second sign flashable zip failed!'
)
...
...
ziptools/
test
.key.pk8
→
ziptools/
private
.key.pk8
View file @
edaf8787
File moved
ziptools/
test
.certificate.x509.pem
→
ziptools/
public
.certificate.x509.pem
View file @
edaf8787
File moved
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