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
24164c85
Commit
24164c85
authored
Jul 30, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add busybox to source
parent
9fca7011
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
15 deletions
+25
-15
.gitmodules
.gitmodules
+3
-0
build.py
build.py
+5
-5
Android.mk
jni/Android.mk
+8
-0
Application.mk
jni/Application.mk
+0
-2
busybox
jni/busybox
+1
-0
bootstages.c
jni/daemon/bootstages.c
+7
-7
magisk.h
jni/include/magisk.h
+1
-1
No files found.
.gitmodules
View file @
24164c85
...
@@ -13,3 +13,6 @@
...
@@ -13,3 +13,6 @@
[submodule "MagiskManager"]
[submodule "MagiskManager"]
path = MagiskManager
path = MagiskManager
url = https://github.com/topjohnwu/MagiskManager.git
url = https://github.com/topjohnwu/MagiskManager.git
[submodule "jni/busybox"]
path = jni/busybox
url = https://github.com/topjohnwu/ndk-busybox.git
build.py
View file @
24164c85
...
@@ -58,7 +58,7 @@ def build_binary(args):
...
@@ -58,7 +58,7 @@ def build_binary(args):
header
(
'* Building Magisk binaries'
)
header
(
'* Building Magisk binaries'
)
ndk_build
=
os
.
path
.
join
(
os
.
environ
[
'ANDROID_HOME'
],
'ndk-bundle'
,
'ndk-build'
)
ndk_build
=
os
.
path
.
join
(
os
.
environ
[
'ANDROID_HOME'
],
'ndk-bundle'
,
'ndk-build'
)
debug_flag
=
''
if
args
.
release
else
'-DDEBUG'
debug_flag
=
''
if
args
.
release
else
'-D
MAGISK_
DEBUG'
proc
=
subprocess
.
run
(
'{} APP_CFLAGS=
\"
-DMAGISK_VERSION=
\\\"
{}
\\\"
-DMAGISK_VER_CODE={} {}
\"
-j{}'
.
format
(
proc
=
subprocess
.
run
(
'{} APP_CFLAGS=
\"
-DMAGISK_VERSION=
\\\"
{}
\\\"
-DMAGISK_VER_CODE={} {}
\"
-j{}'
.
format
(
ndk_build
,
args
.
versionString
,
args
.
versionCode
,
debug_flag
,
multiprocessing
.
cpu_count
()),
shell
=
True
)
ndk_build
,
args
.
versionString
,
args
.
versionCode
,
debug_flag
,
multiprocessing
.
cpu_count
()),
shell
=
True
)
if
proc
.
returncode
!=
0
:
if
proc
.
returncode
!=
0
:
...
...
jni/Android.mk
View file @
24164c85
...
@@ -39,6 +39,7 @@ LOCAL_SRC_FILES := \
...
@@ -39,6 +39,7 @@ LOCAL_SRC_FILES := \
su/su_socket.c
su/su_socket.c
LOCAL_CFLAGS := -Wno-implicit-exception-spec-mismatch
LOCAL_CFLAGS := -Wno-implicit-exception-spec-mismatch
LOCAL_CPPFLAGS := -std=c++11
LOCAL_LDLIBS := -llog
LOCAL_LDLIBS := -llog
include $(BUILD_EXECUTABLE)
include $(BUILD_EXECUTABLE)
...
@@ -51,3 +52,10 @@ include jni/selinux/libsepol/Android.mk
...
@@ -51,3 +52,10 @@ include jni/selinux/libsepol/Android.mk
# Build magiskboot
# Build magiskboot
include jni/magiskboot/Android.mk
include jni/magiskboot/Android.mk
# Build busybox (32-bit only)
ifneq ($(TARGET_ARCH_ABI), x86_64)
ifneq ($(TARGET_ARCH_ABI), arm64-v8a)
include jni/busybox/Android.mk
endif
endif
jni/Application.mk
View file @
24164c85
APP_ABI := x86 x86_64 armeabi-v7a arm64-v8a
APP_ABI := x86 x86_64 armeabi-v7a arm64-v8a
APP_PLATFORM := android-21
APP_PLATFORM := android-21
APP_UNIFIED_HEADERS := true
APP_CPPFLAGS += -std=c++11
busybox
@
2178671c
Subproject commit 2178671c6ef5322f2695cb0ee56df4195d8218ae
jni/daemon/bootstages.c
View file @
24164c85
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
static
char
*
buf
,
*
buf2
;
static
char
*
buf
,
*
buf2
;
static
struct
vector
module_list
;
static
struct
vector
module_list
;
#ifdef DEBUG
#ifdef
MAGISK_
DEBUG
static
int
debug_log_pid
,
debug_log_fd
;
static
int
debug_log_pid
,
debug_log_fd
;
#endif
#endif
...
@@ -484,7 +484,7 @@ void post_fs_data(int client) {
...
@@ -484,7 +484,7 @@ void post_fs_data(int client) {
if
(
!
check_data
())
if
(
!
check_data
())
goto
unblock
;
goto
unblock
;
#ifdef DEBUG
#ifdef
MAGISK_
DEBUG
// Start debug logs in new process
// Start debug logs in new process
debug_log_fd
=
xopen
(
DEBUG_LOG
,
O_WRONLY
|
O_CREAT
|
O_CLOEXEC
|
O_TRUNC
,
0644
);
debug_log_fd
=
xopen
(
DEBUG_LOG
,
O_WRONLY
|
O_CREAT
|
O_CLOEXEC
|
O_TRUNC
,
0644
);
char
*
const
command
[]
=
{
"logcat"
,
"-v"
,
"brief"
,
NULL
};
char
*
const
command
[]
=
{
"logcat"
,
"-v"
,
"brief"
,
NULL
};
...
@@ -773,7 +773,7 @@ void late_start(int client) {
...
@@ -773,7 +773,7 @@ void late_start(int client) {
buf
=
buf2
=
NULL
;
buf
=
buf2
=
NULL
;
vec_deep_destroy
(
&
module_list
);
vec_deep_destroy
(
&
module_list
);
#ifdef DEBUG
#ifdef
MAGISK_
DEBUG
// Stop recording the boot logcat after every boot task is done
// Stop recording the boot logcat after every boot task is done
kill
(
debug_log_pid
,
SIGTERM
);
kill
(
debug_log_pid
,
SIGTERM
);
waitpid
(
debug_log_pid
,
NULL
,
0
);
waitpid
(
debug_log_pid
,
NULL
,
0
);
...
...
jni/include/magisk.h
View file @
24164c85
...
@@ -58,7 +58,7 @@ static inline void do_nothing() {}
...
@@ -58,7 +58,7 @@ static inline void do_nothing() {}
// Dummy function to depress debug message
// Dummy function to depress debug message
static
inline
void
stub
(
const
char
*
fmt
,
...)
{}
static
inline
void
stub
(
const
char
*
fmt
,
...)
{}
#ifdef DEBUG
#ifdef
MAGISK_
DEBUG
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#else
#else
#define LOGD(...) stub(__VA_ARGS__)
#define LOGD(...) stub(__VA_ARGS__)
...
...
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