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
08a70f03
Commit
08a70f03
authored
Apr 01, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add entrypoint to build test
Just for convenience, nothing special here
parent
1b0c36db
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
4 deletions
+21
-4
build.py
build.py
+6
-3
build.gradle
native/build.gradle
+1
-1
.gitignore
native/jni/.gitignore
+1
-0
Android.mk
native/jni/Android.mk
+13
-0
No files found.
build.py
View file @
08a70f03
...
@@ -102,7 +102,7 @@ def zip_with_msg(zip_file, source, target):
...
@@ -102,7 +102,7 @@ def zip_with_msg(zip_file, source, target):
def
collect_binary
():
def
collect_binary
():
for
arch
in
archs
+
arch64
:
for
arch
in
archs
+
arch64
:
mkdir_p
(
os
.
path
.
join
(
'native'
,
'out'
,
arch
))
mkdir_p
(
os
.
path
.
join
(
'native'
,
'out'
,
arch
))
for
bin
in
[
'magisk'
,
'magiskinit'
,
'magiskinit64'
,
'magiskboot'
,
'busybox'
]:
for
bin
in
[
'magisk'
,
'magiskinit'
,
'magiskinit64'
,
'magiskboot'
,
'busybox'
,
'test'
]:
source
=
os
.
path
.
join
(
'native'
,
'libs'
,
arch
,
bin
)
source
=
os
.
path
.
join
(
'native'
,
'libs'
,
arch
,
bin
)
target
=
os
.
path
.
join
(
'native'
,
'out'
,
arch
,
bin
)
target
=
os
.
path
.
join
(
'native'
,
'out'
,
arch
,
bin
)
mv
(
source
,
target
)
mv
(
source
,
target
)
...
@@ -183,14 +183,14 @@ def run_ndk_build(flags):
...
@@ -183,14 +183,14 @@ def run_ndk_build(flags):
def
build_binary
(
args
):
def
build_binary
(
args
):
support_targets
=
{
'magisk'
,
'magiskinit'
,
'magiskboot'
,
'busybox'
}
support_targets
=
{
'magisk'
,
'magiskinit'
,
'magiskboot'
,
'busybox'
,
'test'
}
if
args
.
target
:
if
args
.
target
:
args
.
target
=
set
(
args
.
target
)
&
support_targets
args
.
target
=
set
(
args
.
target
)
&
support_targets
if
not
args
.
target
:
if
not
args
.
target
:
return
return
else
:
else
:
# If nothing specified, build everything
# If nothing specified, build everything
args
.
target
=
support_targets
args
.
target
=
[
'magisk'
,
'magiskinit'
,
'magiskboot'
,
'busybox'
]
header
(
'* Building binaries: '
+
' '
.
join
(
args
.
target
))
header
(
'* Building binaries: '
+
' '
.
join
(
args
.
target
))
...
@@ -230,6 +230,9 @@ def build_binary(args):
...
@@ -230,6 +230,9 @@ def build_binary(args):
if
'magiskboot'
in
args
.
target
:
if
'magiskboot'
in
args
.
target
:
run_ndk_build
(
'B_BOOT=1'
)
run_ndk_build
(
'B_BOOT=1'
)
if
'test'
in
args
.
target
:
run_ndk_build
(
'B_TEST=1'
)
def
build_apk
(
args
,
module
):
def
build_apk
(
args
,
module
):
build_type
=
'Release'
if
args
.
release
else
'Debug'
build_type
=
'Release'
if
args
.
release
else
'Debug'
...
...
native/build.gradle
View file @
08a70f03
...
@@ -12,7 +12,7 @@ android {
...
@@ -12,7 +12,7 @@ android {
externalNativeBuild
{
externalNativeBuild
{
ndkBuild
{
ndkBuild
{
// Pass arguments to ndk-build.
// Pass arguments to ndk-build.
arguments
(
'B_MAGISK=1'
,
'B_INIT64=1'
,
'B_BOOT=1'
,
arguments
(
'B_MAGISK=1'
,
'B_INIT64=1'
,
'B_BOOT=1'
,
'B_TEST=1'
,
'MAGISK_DEBUG=1'
,
'MAGISK_VERSION=debug'
,
'MAGISK_VER_CODE=INT_MAX'
)
'MAGISK_DEBUG=1'
,
'MAGISK_VERSION=debug'
,
'MAGISK_VER_CODE=INT_MAX'
)
}
}
}
}
...
...
native/jni/.gitignore
0 → 100644
View file @
08a70f03
test.cpp
native/jni/Android.mk
View file @
08a70f03
...
@@ -121,6 +121,19 @@ include $(BUILD_EXECUTABLE)
...
@@ -121,6 +121,19 @@ include $(BUILD_EXECUTABLE)
endif
endif
ifdef B_TEST
include $(CLEAR_VARS)
LOCAL_MODULE := test
LOCAL_STATIC_LIBRARIES := libutils
LOCAL_C_INCLUDES := \
jni/include \
$(LIBUTILS)
LOCAL_SRC_FILES := test.cpp
include $(BUILD_EXECUTABLE)
endif
ifdef B_BB
ifdef B_BB
include jni/external/busybox/Android.mk
include jni/external/busybox/Android.mk
...
...
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