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
8dc9d3bc
Commit
8dc9d3bc
authored
Jul 17, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dump binaries to header at build, not at request
parent
adf95ce3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
build.py
build.py
+13
-15
No files found.
build.py
View file @
8dc9d3bc
...
@@ -119,6 +119,12 @@ def build_binary(args):
...
@@ -119,6 +119,12 @@ def build_binary(args):
if
proc
.
returncode
!=
0
:
if
proc
.
returncode
!=
0
:
error
(
'Build Magisk binary failed!'
)
error
(
'Build Magisk binary failed!'
)
collect_binary
()
collect_binary
()
# Dump the binary to header
for
arch
in
archs
:
bin_file
=
os
.
path
.
join
(
'native'
,
'out'
,
arch
,
'magisk'
)
with
open
(
os
.
path
.
join
(
'native'
,
'out'
,
arch
,
'binaries_arch_xz.h'
),
'w'
)
as
out
:
with
open
(
bin_file
,
'rb'
)
as
src
:
xz_dump
(
src
,
out
,
'magisk_xz'
)
old_plat
=
False
old_plat
=
False
flags
=
base_flags
flags
=
base_flags
...
@@ -128,22 +134,10 @@ def build_binary(args):
...
@@ -128,22 +134,10 @@ def build_binary(args):
old_plat
=
True
old_plat
=
True
if
'magiskinit'
in
targets
:
if
'magiskinit'
in
targets
:
for
arch
in
archs
:
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
'native'
,
'out'
,
'x86'
,
'binaries_arch_xz.h'
)):
bin_file
=
os
.
path
.
join
(
'native'
,
'out'
,
arch
,
'magisk'
)
if
not
os
.
path
.
exists
(
bin_file
):
error
(
'Build "magisk" before building "magiskinit"'
)
error
(
'Build "magisk" before building "magiskinit"'
)
with
open
(
os
.
path
.
join
(
'native'
,
'out'
,
arch
,
'binaries_arch_xz.h'
),
'w'
)
as
out
:
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
'native'
,
'out'
,
'binaries_xz.h'
)):
with
open
(
bin_file
,
'rb'
)
as
src
:
xz_dump
(
src
,
out
,
'magisk_xz'
)
stub_apk
=
os
.
path
.
join
(
config
[
'outdir'
],
'stub-release.apk'
)
if
not
os
.
path
.
exists
(
stub_apk
):
error
(
'Build release stub APK before building "magiskinit"'
)
error
(
'Build release stub APK before building "magiskinit"'
)
with
open
(
os
.
path
.
join
(
'native'
,
'out'
,
'binaries_xz.h'
),
'w'
)
as
out
:
with
open
(
stub_apk
,
'rb'
)
as
src
:
xz_dump
(
src
,
out
,
'manager_xz'
)
flags
+=
' B_INIT=1'
flags
+=
' B_INIT=1'
old_plat
=
True
old_plat
=
True
...
@@ -219,6 +213,10 @@ def build_apk(args):
...
@@ -219,6 +213,10 @@ def build_apk(args):
sign_apk
(
unsigned
,
release
)
sign_apk
(
unsigned
,
release
)
header
(
'Output: '
+
release
)
header
(
'Output: '
+
release
)
rm
(
unsigned
)
rm
(
unsigned
)
# Dump the stub APK to header
with
open
(
os
.
path
.
join
(
'native'
,
'out'
,
'binaries_xz.h'
),
'w'
)
as
out
:
with
open
(
release
,
'rb'
)
as
src
:
xz_dump
(
src
,
out
,
'manager_xz'
)
else
:
else
:
proc
=
subprocess
.
run
(
'{} app:assembleDebug'
.
format
(
gradlew
),
shell
=
True
,
stdout
=
STDOUT
)
proc
=
subprocess
.
run
(
'{} app:assembleDebug'
.
format
(
gradlew
),
shell
=
True
,
stdout
=
STDOUT
)
if
proc
.
returncode
!=
0
:
if
proc
.
returncode
!=
0
:
...
...
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