mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-08-26 14:37:31 +00:00
Support building individual applets
This commit is contained in:
@@ -56,6 +56,30 @@ include $(BUILD_EXECUTABLE)
|
||||
|
||||
endif
|
||||
|
||||
ifdef B_POLICY
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := magiskpolicy
|
||||
LOCAL_STATIC_LIBRARIES := libsepol libutils
|
||||
LOCAL_C_INCLUDES := \
|
||||
jni/include \
|
||||
$(LIBSEPOL) \
|
||||
$(LIBUTILS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
core/applet_stub.cpp \
|
||||
magiskpolicy/api.cpp \
|
||||
magiskpolicy/magiskpolicy.cpp \
|
||||
magiskpolicy/rules.cpp \
|
||||
magiskpolicy/policydb.cpp \
|
||||
magiskpolicy/sepolicy.c
|
||||
|
||||
LOCAL_CFLAGS := -DAPPLET_STUB_MAIN=magiskpolicy_main
|
||||
LOCAL_LDFLAGS := -static
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
endif
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
ifdef B_INIT
|
||||
|
9
native/jni/core/applet_stub.cpp
Normal file
9
native/jni/core/applet_stub.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <magisk.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
umask(0);
|
||||
cmdline_logging();
|
||||
return APPLET_STUB_MAIN(argc, argv);
|
||||
}
|
Reference in New Issue
Block a user