Commit 67d746a6 authored by topjohnwu's avatar topjohnwu

Let build.py setup NDK

parent 2f1f68f1
...@@ -47,20 +47,21 @@ For installation issues, upload both boot image and install logs.<br> ...@@ -47,20 +47,21 @@ For installation issues, upload both boot image and install logs.<br>
For Magisk issues, upload boot logcat or dmesg.<br> For Magisk issues, upload boot logcat or dmesg.<br>
For Magisk Manager crashes, record and upload the logcat when the crash occurs. For Magisk Manager crashes, record and upload the logcat when the crash occurs.
## Building Magisk ## Building and Development
- Magisk builds on any OS Android Studio supports. Install Android Studio and do the initial setups.
- Clone sources: `git clone --recurse-submodules https://github.com/topjohnwu/Magisk.git` - Clone sources: `git clone --recurse-submodules https://github.com/topjohnwu/Magisk.git`
- Magisk builds on any OS Android Studio supports. Install Android Studio and import the project. - Install Python 3.6+. For Windows only, install Colorama with `pip install colorama` in admin shell.
- Python 3.6+. For Windows only, install Colorama with `pip install colorama` in admin shell. - Configure to use the JDK bundled in Android Studio:
- Use the JDK bundled in Android Studio:
- macOS: `export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"` - macOS: `export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"`
- Linux: `export PATH="/path/to/androidstudio/jre/bin:$PATH"` - Linux: `export PATH="/path/to/androidstudio/jre/bin:$PATH"`
- Windows: Add `C:\Path\To\Android Studio\jre\bin` to environment variable `PATH` - Windows: Add `C:\Path\To\Android Studio\jre\bin` to environment variable `PATH`
- Set environment variable `ANDROID_HOME` to the Android SDK folder - Set environment variable `ANDROID_HOME` to the Android SDK folder (can be found in Android Studio settings)
- Download / clone [FrankeNDK](https://github.com/topjohnwu/FrankeNDK) and set environment variable `ANDROID_NDK_HOME` to the folder - Run `./build.py ndk` to let the script download and install NDK for you
- Set configurations in `config.prop`. A sample file `config.prop.sample` is provided. - Set configurations in `config.prop`. A sample `config.prop.sample` is provided.
- Run `build.py` to see help messages. For each supported actions, use `-h` to access help (e.g. `./build.py all -h`) - To start building, run `build.py` to see your options. For each action, use `-h` to access help (e.g. `./build.py all -h`)
- By default, the script builds everything in debug mode. If you want to build Magisk Manager in release mode (with the `-r, --release` flag), you need a Java Keystore (only `JKS` format is supported) to sign APKs and zips. For more information, check [Google's Documentation](https://developer.android.com/studio/publish/app-signing.html#generate-key). - To start development, open the project in Android Studio. Both app (Kotlin/Java) and native (C++/C) source code can be properly developed using the IDE, but *always* use `build.py` for building.
- `build.py` builds in debug mode by default. If you want release builds (with `-r, --release`), you need a Java Keystore to sign APKs and zips. For more information, check [Google's Documentation](https://developer.android.com/studio/publish/app-signing.html#generate-key).
## Translation Contributions ## Translation Contributions
......
This diff is collapsed.
...@@ -2,6 +2,8 @@ apply plugin: 'com.android.library' ...@@ -2,6 +2,8 @@ apply plugin: 'com.android.library'
android { android {
ndkVersion '0.0.0'
externalNativeBuild { externalNativeBuild {
ndkBuild { ndkBuild {
path 'jni/Android.mk' path 'jni/Android.mk'
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment