From 0f34f0033c22fabd4fd13dffabdc53cd9af0f6a7 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 11 Aug 2018 18:46:55 +0800 Subject: [PATCH] Switch to FrankeNDK for building native --- README.MD | 4 ++-- build.py | 9 +-------- native/jni/Application.mk | 10 ++++++---- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/README.MD b/README.MD index f910afc30..32f1d0406 100644 --- a/README.MD +++ b/README.MD @@ -9,10 +9,10 @@ 5. (Windows Only) Python package Colorama: Install with `pip install colorama`, used for ANSI color codes ## Building Notes and Instructions -1. Building is tested on macOS, Ubuntu, and Windows 10 using the latest stable NDK and NDK r10e. Officially released binaries were built with NDK r10e. +1. Building is supported on macOS, Linux, and Windows using the custom NDK: [FrankeNDK](https://github.com/topjohnwu/FrankeNDK). 2. Set configurations in `config.prop`. A sample file `config.prop.sample` is provided as an example. 3. Run `build.py` with argument `-h` to see the built-in help message. The `-h` option also works for each supported actions, e.g. `./build.py binary -h` -4. By default, `build.py` build binaries and Magisk Manager in debug mode. If you want to build Magisk Manager in release mode (via the `--release` flag), you need a Java Keystore file `release-key.jks` to sign Magisk Manager's APK. For more information, check out [Google's Official Documentation](https://developer.android.com/studio/publish/app-signing.html#signing-manually). +4. By default, `build.py` build binaries and Magisk Manager in debug mode. If you want to build Magisk Manager in release mode (via the `-r, --release` flag), you need a Java Keystore file `release-key.jks` (only `JKS` format is supported) to sign APKs and zips. For more information, check out [Google's Official Documentation](https://developer.android.com/studio/publish/app-signing.html#signing-manually). ## Documentation [Link to Documentation](docs/README.MD) diff --git a/build.py b/build.py index da58bfc64..707257862 100755 --- a/build.py +++ b/build.py @@ -238,15 +238,8 @@ def build_binary(args): error('Build binaries failed!') collect_binary() - new_plat = False - flags = base_flags - if 'busybox' in args.target: - flags += ' B_BB=1' - new_plat = True - - if new_plat: - proc = system('{} -C native NEW_PLAT=1 {} -j{}'.format(ndk_build, flags, cpu_count)) + proc = system('{} -C native {} B_BB=1 -j{}'.format(ndk_build, base_flags, cpu_count)) if proc.returncode != 0: error('Build binaries failed!') collect_binary() diff --git a/native/jni/Application.mk b/native/jni/Application.mk index dc65cdfaf..0d576c3bb 100644 --- a/native/jni/Application.mk +++ b/native/jni/Application.mk @@ -2,10 +2,12 @@ APP_ABI := armeabi-v7a x86 APP_CFLAGS := -std=gnu99 ${MAGISK_DEBUG} \ -DMAGISK_VERSION="${MAGISK_VERSION}" -DMAGISK_VER_CODE=${MAGISK_VER_CODE} APP_CPPFLAGS := -std=c++11 -APP_SHORT_COMMANDS := true -ifdef NEW_PLAT -APP_PLATFORM := android-21 -else APP_PLATFORM := android-16 APP_CFLAGS += -Wno-implicit-function-declaration + +# Busybox require some additional settings +ifdef B_BB +APP_SHORT_COMMANDS := true +NDK_TOOLCHAIN_VERSION := 4.9 +APP_PLATFORM := android-21 endif