diff --git a/app/build-logic/src/main/java/Setup.kt b/app/build-logic/src/main/java/Setup.kt index 910e9369d..395a5b9db 100644 --- a/app/build-logic/src/main/java/Setup.kt +++ b/app/build-logic/src/main/java/Setup.kt @@ -49,7 +49,7 @@ fun Project.setupCommon() { } buildToolsVersion = "37.0.0" ndkPath = "${androidComponents.sdkComponents.sdkDirectory.get().asFile}/ndk/magisk" - ndkVersion = "30.0.15729638" + ndkVersion = "30.0.16248370" defaultConfig.apply { minSdk = 24 diff --git a/build.py b/build.py index 08b66c4e1..85893412e 100755 --- a/build.py +++ b/build.py @@ -573,7 +573,7 @@ class ProgressStream: def setup_ndk(): - url = f"https://github.com/topjohnwu/ondk/releases/download/{ondk_version}/ondk-{ondk_version}-{os_name}.tar.xz" + url = f"https://github.com/topjohnwu/ondk/releases/download/{ondk_version}/ondk-{ondk_version}-{os_name}-{arch_name}.tar.xz" ndk_archive = url.split("/")[-1] ondk_path = paths().ndk.parent / f"ondk-{ondk_version}" diff --git a/native/src/boot/format.rs b/native/src/boot/format.rs index 9477a93b2..a28a30f0c 100644 --- a/native/src/boot/format.rs +++ b/native/src/boot/format.rs @@ -226,9 +226,10 @@ fn is_raw_arm32(buf: &[u8]) -> bool { if sample.len() < 64 { return false; } - let words = sample.chunks_exact(4); + let (words, _) = sample.as_chunks::<4>(); let count = words.len(); let arm_cond_count = words + .iter() .filter(|chunk| { let top_nibble = chunk[3] >> 4; top_nibble == 0xE || top_nibble == 0xF diff --git a/scripts/env.py b/scripts/env.py index 73809ac96..2ebebb9d5 100755 --- a/scripts/env.py +++ b/scripts/env.py @@ -22,13 +22,14 @@ __all__ = [ "ensure_cargo", "ensure_jdk", "os_name", + "arch_name", "is_windows", "EXE_EXT", "no_color", "cpu_count", ] -ondk_version = "r30.1" +ondk_version = "r30.2" def color_print(code, msg): @@ -170,6 +171,8 @@ if os_name != "linux" and os_name != "darwin": # It's possible we're using MSYS/Cygwin/MinGW, treat them all as Windows is_windows = True os_name = "windows" +raw_arch = platform.machine().lower() +arch_name = {"arm64": "aarch64", "amd64": "x86_64"}.get(raw_arch, raw_arch) EXE_EXT = ".exe" if is_windows else "" no_color = "NO_COLOR" in os.environ or not sys.stdout.isatty() diff --git a/tools/elf-cleaner/src/main.rs b/tools/elf-cleaner/src/main.rs index 21ff21ceb..1a87174be 100644 --- a/tools/elf-cleaner/src/main.rs +++ b/tools/elf-cleaner/src/main.rs @@ -57,18 +57,18 @@ fn process_elf(path: &str) -> anyhow::Result<()> { }); // Remove unsupported flags for entry in entries.iter_mut() { - if let Dynamic::Integer { tag, val } = entry { - if *tag == elf::DT_FLAGS_1 { - let new_flags = *val & SUPPORTED_DT_FLAGS as u64; - if new_flags != *val { - println!( - "Replacing unsupported DT_FLAGS_1 {:#x} with {:#x} in '{}'", - *val, new_flags, path - ); - *val = new_flags; - } - break; + if let Dynamic::Integer { tag, val } = entry + && *tag == elf::DT_FLAGS_1 + { + let new_flags = *val & SUPPORTED_DT_FLAGS as u64; + if new_flags != *val { + println!( + "Replacing unsupported DT_FLAGS_1 {:#x} with {:#x} in '{}'", + *val, new_flags, path + ); + *val = new_flags; } + break; } } }