mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
Support building standalone resetprop
This commit is contained in:
parent
c3e77b1ec1
commit
b13a35057a
5
build.py
5
build.py
@ -56,7 +56,7 @@ cpu_count = multiprocessing.cpu_count()
|
|||||||
gradlew = os.path.join('.', 'gradlew' + ('.bat' if is_windows else ''))
|
gradlew = os.path.join('.', 'gradlew' + ('.bat' if is_windows else ''))
|
||||||
archs = ['armeabi-v7a', 'x86']
|
archs = ['armeabi-v7a', 'x86']
|
||||||
arch64 = ['arm64-v8a', 'x86_64']
|
arch64 = ['arm64-v8a', 'x86_64']
|
||||||
support_targets = ['magisk', 'magiskinit', 'magiskboot', 'magiskpolicy', 'busybox', 'test']
|
support_targets = ['magisk', 'magiskinit', 'magiskboot', 'magiskpolicy', 'resetprop', 'busybox', 'test']
|
||||||
default_targets = ['magisk', 'magiskinit', 'magiskboot', 'busybox']
|
default_targets = ['magisk', 'magiskinit', 'magiskboot', 'busybox']
|
||||||
build_tools = os.path.join(os.environ['ANDROID_HOME'], 'build-tools', '29.0.2')
|
build_tools = os.path.join(os.environ['ANDROID_HOME'], 'build-tools', '29.0.2')
|
||||||
|
|
||||||
@ -286,6 +286,9 @@ def build_binary(args):
|
|||||||
if 'magiskpolicy' in args.target:
|
if 'magiskpolicy' in args.target:
|
||||||
run_ndk_build('B_POLICY=1')
|
run_ndk_build('B_POLICY=1')
|
||||||
|
|
||||||
|
if 'resetprop' in args.target:
|
||||||
|
run_ndk_build('B_PROP=1')
|
||||||
|
|
||||||
if 'magiskboot' in args.target:
|
if 'magiskboot' in args.target:
|
||||||
run_ndk_build('B_BOOT=1')
|
run_ndk_build('B_BOOT=1')
|
||||||
|
|
||||||
|
@ -57,31 +57,6 @@ include $(BUILD_EXECUTABLE)
|
|||||||
|
|
||||||
endif
|
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/statement.cpp \
|
|
||||||
magiskpolicy/sepolicy.c
|
|
||||||
|
|
||||||
LOCAL_CFLAGS := -DAPPLET_STUB_MAIN=magiskpolicy_main
|
|
||||||
LOCAL_LDFLAGS := -static
|
|
||||||
include $(BUILD_EXECUTABLE)
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
ifdef B_INIT
|
ifdef B_INIT
|
||||||
@ -152,6 +127,55 @@ include $(BUILD_EXECUTABLE)
|
|||||||
|
|
||||||
endif
|
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/statement.cpp \
|
||||||
|
magiskpolicy/sepolicy.c
|
||||||
|
|
||||||
|
LOCAL_CFLAGS := -DAPPLET_STUB_MAIN=magiskpolicy_main
|
||||||
|
LOCAL_LDFLAGS := -static
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef B_PROP
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := resetprop
|
||||||
|
LOCAL_STATIC_LIBRARIES := libnanopb libsystemproperties libutils
|
||||||
|
LOCAL_C_INCLUDES := \
|
||||||
|
jni/include \
|
||||||
|
$(LIBNANOPB) \
|
||||||
|
$(LIBSYSTEMPROPERTIES) \
|
||||||
|
$(LIBUTILS)
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
core/applet_stub.cpp \
|
||||||
|
resetprop/persist_properties.cpp \
|
||||||
|
resetprop/resetprop.cpp \
|
||||||
|
resetprop/system_property_api.cpp \
|
||||||
|
resetprop/system_property_set.cpp
|
||||||
|
|
||||||
|
LOCAL_CFLAGS := -DAPPLET_STUB_MAIN=resetprop_main
|
||||||
|
LOCAL_LDFLAGS := -static
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef B_TEST
|
ifdef B_TEST
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user