diff --git a/README.MD b/README.MD index 425607e99..31802191e 100644 --- a/README.MD +++ b/README.MD @@ -56,7 +56,7 @@ For Magisk Manager crashes, record and upload the logcat when the crash occurs. - macOS: `export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"` - Linux: `export PATH="/path/to/androidstudio/jre/bin:$PATH"` - Windows: Add `C:\Path\To\Android Studio\jre\bin` to environment variable `PATH` -- Set environment variable `ANDROID_HOME` to the Android SDK folder (can be found in Android Studio settings) +- Set environment variable `ANDROID_SDK_ROOT` to the Android SDK folder (can be found in Android Studio settings) - Run `./build.py ndk` to let the script download and install NDK for you - Set configurations in `config.prop`. A sample `config.prop.sample` is provided. - To start building, run `build.py` to see your options. \ diff --git a/build.gradle.kts b/build.gradle.kts index 03ed4b8e2..690dd525f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -64,7 +64,7 @@ subprojects { android.apply { compileSdkVersion(30) buildToolsVersion = "30.0.2" - ndkPath = "${System.getenv("ANDROID_HOME")}/ndk/magisk" + ndkPath = "${System.getenv("ANDROID_SDK_ROOT")}/ndk/magisk" defaultConfig { if (minSdkVersion == null) diff --git a/build.py b/build.py index 733b13abc..259635ed2 100755 --- a/build.py +++ b/build.py @@ -27,8 +27,8 @@ def vprint(str): if not sys.version_info >= (3, 6): error('Requires Python 3.6+') -if 'ANDROID_HOME' not in os.environ: - error('Please add Android SDK path to ANDROID_HOME environment variable!') +if 'ANDROID_SDK_ROOT' not in os.environ: + error('Please add Android SDK path to ANDROID_SDK_ROOT environment variable!') try: subprocess.run(['javac', '-version'], @@ -58,7 +58,7 @@ default_targets = ['magisk', 'magiskinit', 'magiskboot', 'busybox'] ndk_ver = '21d' ndk_ver_full = '21.3.6528147' -ndk_root = op.join(os.environ['ANDROID_HOME'], 'ndk') +ndk_root = op.join(os.environ['ANDROID_SDK_ROOT'], 'ndk') ndk_path = op.join(ndk_root, 'magisk') ndk_build = op.join(ndk_path, 'ndk-build') gradlew = op.join('.', 'gradlew' + ('.bat' if is_windows else ''))