Add su binary into Magisk

This commit is contained in:
topjohnwu 2016-12-06 04:47:26 +08:00
parent 16d7ae62bd
commit 6e3bb48574
5 changed files with 18 additions and 3 deletions

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "jni/selinux"] [submodule "jni/selinux"]
path = jni/selinux path = jni/selinux
url = https://github.com/topjohnwu/selinux.git url = https://github.com/topjohnwu/selinux.git
[submodule "jni/su"]
path = jni/su
url = https://github.com/topjohnwu/Superuser.git

View File

@ -21,7 +21,7 @@ LOCAL_MODULE := sepolicy-inject
LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_LIBRARIES := libsepol LOCAL_STATIC_LIBRARIES := libsepol
LOCAL_SRC_FILES := sepolicy-inject/sepolicy-inject.c sepolicy-inject/builtin_rules.c LOCAL_SRC_FILES := sepolicy-inject/sepolicy-inject.c sepolicy-inject/builtin_rules.c
LOCAL_C_INCLUDES := $(my_path)/selinux/libsepol/include/ LOCAL_C_INCLUDES := jni/selinux/libsepol/include/
LOCAL_CFLAGS += -std=gnu11 LOCAL_CFLAGS += -std=gnu11
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)
@ -32,4 +32,14 @@ LOCAL_SRC_FILES := resetprop/resetprop.cpp resetprop/system_properties.cpp reset
LOCAL_LDLIBS += -latomic LOCAL_LDLIBS += -latomic
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)
include $(my_path)/selinux/libsepol/Android.mk include $(CLEAR_VARS)
LOCAL_MODULE := su
LOCAL_MODULE_TAGS := eng debug optional
LOCAL_STATIC_LIBRARIES := libselinux
LOCAL_C_INCLUDES := jni/selinux/libselinux/include/ jni/selinux/libsepol/include/ jni/su/sqlite3/
LOCAL_SRC_FILES := su/su.c su/daemon.c su/activity.c su/db.c su/utils.c su/pts.c su/hacks.c su/binds.c su/sqlite3/sqlite3.c
LOCAL_CFLAGS := -DSQLITE_OMIT_LOAD_EXTENSION -std=gnu11
include $(BUILD_EXECUTABLE)
include jni/selinux/libsepol/Android.mk
include jni/selinux/libselinux/Android.mk

View File

@ -1,3 +1,4 @@
NDK_TOOLCHAIN_VERSION=4.9
APP_ABI := x86 x86_64 armeabi arm64-v8a APP_ABI := x86 x86_64 armeabi arm64-v8a
APP_PIE = true APP_PIE = true
APP_PLATFORM := android-21 APP_PLATFORM := android-21

@ -1 +1 @@
Subproject commit df7346cd5b27f8a66f84669a9ed1d9c272692b17 Subproject commit 91e9179a23435bbadada5474ce09a2aea3dadcd6

1
jni/su Submodule

@ -0,0 +1 @@
Subproject commit 1d2eb13cae13380bbccff4b0ba77c14140158ea8