diff --git a/build.py b/build.py index b299532c2..2ca597159 100755 --- a/build.py +++ b/build.py @@ -88,8 +88,8 @@ def build_all(args): def build_binary(args): header('* Building Magisk binaries') - # Force update Android.mk timestamp to trigger recompilation - os.utime(os.path.join('core', 'jni', 'Android.mk')) + # Force update logging.h timestamp to trigger recompilation + os.utime(os.path.join('core', 'jni', 'include', 'logging.h')) debug_flag = '' if args.release else '-DMAGISK_DEBUG' cflag = 'MAGISK_FLAGS=\"-DMAGISK_VERSION=\\\"{}\\\" -DMAGISK_VER_CODE={} {}\"'.format(args.versionString, args.versionCode, debug_flag) @@ -385,7 +385,8 @@ def cleanup(args): if 'binary' in args.target: header('* Cleaning binaries') - subprocess.run(ndk_build + ' -C core COMPILEALL=true clean', shell=True) + subprocess.run(ndk_build + ' -C core PRECOMPILE=true clean', shell=True) + subprocess.run(ndk_build + ' -C core clean', shell=True) for arch in ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']: shutil.rmtree(os.path.join('out', arch), ignore_errors=True) diff --git a/core/build.gradle b/core/build.gradle index 6fb33987b..351873f4f 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -13,7 +13,7 @@ android { externalNativeBuild { ndkBuild { // Passes an optional argument to ndk-build. - arguments "COMPILEALL=true" + arguments "GRADLE=true" } } } diff --git a/core/jni/Android.mk b/core/jni/Android.mk index 8f5d728cd..666ef4ec1 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -14,7 +14,7 @@ LIBFDT := $(EXT_PATH)/dtc/libfdt # Binaries ######################## -ifneq "$(or $(PRECOMPILE), $(COMPILEALL))" "" +ifneq "$(or $(PRECOMPILE), $(GRADLE))" "" # magisk main binary include $(CLEAR_VARS) @@ -115,6 +115,7 @@ LOCAL_LDLIBS := -lz include $(BUILD_EXECUTABLE) # 32-bit static binaries +ifndef GRADLE # Do not run gradle sync on these binaries ifneq ($(TARGET_ARCH_ABI), x86_64) ifneq ($(TARGET_ARCH_ABI), arm64-v8a) # b64xz @@ -129,6 +130,7 @@ include $(BUILD_EXECUTABLE) include jni/external/busybox/Android.mk endif endif +endif # Precompile endif diff --git a/core/jni/core/magisk.c b/core/jni/core/magisk.c index 584fd5a85..5ddbfc503 100644 --- a/core/jni/core/magisk.c +++ b/core/jni/core/magisk.c @@ -40,7 +40,7 @@ static void usage() { " -c print current binary version\n" " -v print running daemon version\n" " -V print running daemon version code\n" - " --list list all availible applets\n" + " --list list all available applets\n" " --install [SOURCE] DIR symlink all applets to DIR. SOURCE is optional\n" " --createimg IMG SIZE create ext4 image. SIZE is interpreted in MB\n" " --imgsize IMG report ext4 image used/total size\n"