mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-06-12 21:27:41 +02:00
Switch over to ANDROID_HOME
Keep ANDROID_SDK_ROOT as a fallback
This commit is contained in:
10
build.py
10
build.py
@ -55,8 +55,13 @@ if is_windows:
|
||||
if not sys.version_info >= (3, 8):
|
||||
error("Requires Python 3.8+")
|
||||
|
||||
if "ANDROID_SDK_ROOT" not in os.environ:
|
||||
error("Please set Android SDK path to environment variable ANDROID_SDK_ROOT!")
|
||||
try:
|
||||
sdk_path = Path(os.environ["ANDROID_HOME"])
|
||||
except KeyError:
|
||||
try:
|
||||
sdk_path = Path(os.environ["ANDROID_SDK_ROOT"])
|
||||
except KeyError:
|
||||
error("Please set Android SDK path to environment variable ANDROID_HOME")
|
||||
|
||||
if shutil.which("sccache") is not None:
|
||||
os.environ["RUSTC_WRAPPER"] = "sccache"
|
||||
@ -80,7 +85,6 @@ default_targets = ["magisk", "magiskinit", "magiskboot", "magiskpolicy"]
|
||||
support_targets = default_targets + ["resetprop"]
|
||||
rust_targets = ["magisk", "magiskinit", "magiskboot", "magiskpolicy"]
|
||||
|
||||
sdk_path = Path(os.environ["ANDROID_SDK_ROOT"])
|
||||
ndk_root = sdk_path / "ndk"
|
||||
ndk_path = ndk_root / "magisk"
|
||||
ndk_build = ndk_path / "ndk-build"
|
||||
|
Reference in New Issue
Block a user