Commit Graph
275 Commits
Author SHA1 Message Date
topjohnwu d22fea2906 app: remove :stub module and build integration
Remove the :stub Android application module, its build-logic task
integration, build.py stub building commands, and leftover stub hooks
in :core.

- Delete app/stub/ and its 60 tracked files (activity, networking,
  and localized string resources)
- Remove :stub from app/settings.gradle.kts
- Remove stubTask and stub.apk syncing in Setup.kt
- Remove build_stub, stub subparser, and stub APK copying in build.py
- Simplify RootUtils by removing unused stub parameter and constructor
- Remove unused -keep rule for App constructor in proguard-rules.pro
- Update README.MD to remove stub string references

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu c86a8776ce Remove stub embedding from native and scripts
Remove stub.apk and stub.xz extraction, compression,
ramdisk embedding, and daemon auto-installation from native
components (magiskinit, magiskd, scripting), installation
scripts, MagiskInstaller, and build.py.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu c275a4ea30 Embed trusted certificate in flags.rs
- Extract the signing certificate from keyStore via keytool in
  dump_flags_native() and emit TRUSTED_CERT in flags.rs (or an empty
  slice when keyStore is not configured).
- Replace dynamic certificate extraction from stub.apk in
  preserve_stub_apk() with the static TRUSTED_CERT constant.
- Move get_package_uid() out of MagiskD into a standalone function.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu 5381a1e9b8 Remove legacy apk codebase
Remove the legacy view-based APK module (:apk-legacy), along with its
subcommands, configurations, release packaging steps, and associated
unused dependencies.

Assisted-by: Gemini 3.8 Flash
2026-10-04 03:30:08 -07:00
topjohnwu 66bcdaf4e0 magiskboot: support building on host
Allow magiskboot to be built directly on host platforms (macOS and
Linux) using Cargo:
- Add a binary target to boot module with a no_main entry point that
  directly reuses the C main CLI implementation.
- Compile native C and C++ sources (base, boot, cxx, and lz4) via cc in
  base and boot build.rs when target_os is not Android.
- Platform gate Linux-specific functionality (SELinux xattrs, mount,
  namespaces) in base on Linux and Android, and provide macOS fallback
  for xsendfile.
- Move MountInfo and mount parsing from files to mount module.
- Scope Android-specific LTO rustflags in config.toml to Android
  targets.
- Ensure build.py compiles Rust modules as static libraries (--lib).

Assisted-by: Gemini 3.8 Flash
2026-10-02 17:17:48 -07:00
topjohnwu aed0261c3d Refactor adb patching and emulator setup
Add support for patching boot images directly via adb
with the build.py script.
2026-09-21 01:40:07 -07:00
topjohnwu 37063225d4 build: show progress when downloading ONDK
Wrap the HTTP response stream in setup_ndk with a ProgressStream reader
to display a dynamic terminal progress bar showing percentage and
transferred megabytes during download and decompression.

Updates are throttled to at most 10 Hz and suppressed in non-interactive
environments.

Assisted-by: Gemini 3.8 Flash
2026-09-05 08:17:11 +00:00
topjohnwu 173153fcc7 build: improve build.py and env.py scripts
Modernize build scripts and improve reliability across environments:
- Update required Java toolchain to JDK 25 across scripts and CI
- Propagate subprocess exit codes and report filesystem errors
- Fix argument parsing edge cases and dynamic linker path handling
- Anchor working directory and improve terminal output formatting

Assisted-by: Gemini 3.8 Flash
2026-09-05 08:17:11 +00:00
topjohnwu a5c8861629 Promote next-gen app to production, and demote existing app to legacy 2026-08-31 15:55:14 -07:00
topjohnwu 87192bd469 Fix compilation database generation when sccache is enabled 2026-04-20 01:17:00 -07:00
topjohnwu fb8e5b569e Extract environment setup into its own script
This simplifies environment setup for shell operations
2026-04-08 05:29:57 +00:00
topjohnwu 9035a94804 Make build.py generate flags.prop for app projects
Reduce logic duplication in build.py and app/buildSrc. The ground truth
is always build.py, so dump all information into a file so the gradle
projects are always in sync with the rest of the project.
2026-03-18 01:49:38 -07:00
topjohnwu 5cb025e7cc Setup CI for app-ng 2026-03-17 20:04:47 -07:00
topjohnwu 62c6ab8c0a Move apk module to apk-ng
In preparation to preserve the existing old apk module codebase so
that the old implementation can live side-by-side the next generation.
2026-03-16 03:25:47 -07:00
topjohnwu 6bb48df712 Go through rustup proxy if possible 2026-03-11 00:43:18 -07:00
topjohnwu 9ee6a6b3d7 Update to ONDK r29.5 2026-02-06 16:32:25 -08:00
topjohnwu 0bbc736051 Properly set abiList with config.prop for APK 2025-12-16 02:38:27 -08:00
topjohnwu 8734423cb0 Update to ONDK r29.4 2025-12-12 11:42:45 -08:00
topjohnwu 3a60ef2039 Update to ONDK r29.3 2025-11-21 13:28:46 -08:00
topjohnwu f9a8052583 Improve build.py
Close #8988
2025-09-26 17:00:58 -07:00
topjohnwu 3903f42cf6 Support specify ABI for clippy 2025-09-08 02:23:49 -07:00
topjohnwu 484d53ef7e Update to ONDK r29.2 2025-08-28 16:15:59 -07:00
topjohnwu 690a5ac033 Update to ONDK r28.5 2025-06-30 12:15:43 -07:00
topjohnwu 1460317ebd Cleanup C++ headers 2025-06-16 02:25:38 -07:00
topjohnwu a834e72b71 Use sccache for clippy 2025-05-30 11:11:45 -07:00
topjohnwu 8c79d66b7b Update ONDK r28.4 2025-05-30 01:53:26 -07:00
topjohnwu 8b7fb6cdde Improve scripts 2025-05-15 02:56:36 -07:00
topjohnwu 0a86916d3a Fix cleanup 2025-05-14 01:23:54 -07:00
topjohnwu 5a762f0a8e Move all gradle files into folder app
Decouple java and native projects
2025-05-13 17:04:41 -07:00
topjohnwu 5dd7a7d804 Better ABI support for build.py 2025-05-13 14:35:57 -07:00
topjohnwu 00c1b36837 Support generating files for C++ IDE 2025-05-07 22:18:44 -07:00
topjohnwu 1fa318dc8c Use Rust elf-cleaner implementation 2025-04-01 18:32:54 -07:00
topjohnwu 1523ed9f78 Always go through rustup proxies 2025-04-01 10:01:35 -07:00
topjohnwu a396abf565 Minor changes
[skip ci]
2025-03-22 01:16:51 -07:00
topjohnwu 28d86a3454 Update rustup_wrapper
[skip ci]
2025-03-06 16:12:35 -08:00
topjohnwu 2b47d47215 Also run clippy with release mode
[skip ci]
2025-03-02 23:14:46 -08:00
topjohnwu 494615d9a0 Support ./build.py emulator with an APK argument 2025-02-28 17:17:24 -08:00
topjohnwu 18cb659ff3 Run clippy through build.py 2025-02-17 01:31:59 -08:00
topjohnwu 7098248c64 Add more functionality into Rust 2025-01-11 00:11:48 +08:00
topjohnwu 32faa4ced6 Redesign test APK architecture
The test APK and the main APK share the same process and classloader,
and in the non-hidden case, the test APK's classes take precedence over
the ones in the main APK. This causes issues because the test APK and
main APK share some dependencies, but don't always use the same
version. This is especially problematic for the Kotlin stdlib and
AndroidX dependencies.

The solution here is to rely on R8's obfuscation feature and repackage
all potentially conflicting classes into a separate package in the test
APK. To ensure that the test classes are always using the same classes
as the main APK, we have to directly implement all tests inside the main
APK, making the test APK purely a "test runner with test dependencies".

As a result, the test APK can only be used when built in release mode,
because R8 no longer allow class obfuscation to be enabled when building
for debug versions.
2024-12-25 20:17:57 -08:00
topjohnwu 9112a3a4f5 Introduce instrumentation tests 2024-12-13 12:07:42 -08:00
topjohnwu 4c14ae33f5 Properly configure Rust builds 2024-08-03 01:28:53 -07:00
topjohnwu d4a9ef7b7f Cleanup build.py 2024-08-03 00:05:49 -07:00
topjohnwu 1539cfe888 Support setting custom ABI list
Also stop building riscv64 by default
2024-08-01 14:33:08 -07:00
topjohnwu 9093be1329 Run commands through shell on Windows 2024-07-31 17:21:18 -07:00
topjohnwu 606d076251 Build debug with thin lto 2024-07-31 17:00:01 -07:00
topjohnwu 33aebb5976 Stop embedding executables 2024-07-24 22:49:48 -07:00
topjohnwu 9c03514eb1 Create :app:clean task 2024-07-24 16:46:47 -07:00
topjohnwu eb74b266e1 Do not modify args
Close #8242
2024-07-24 16:37:22 -07:00
topjohnwu b26db8cee6 Switch over to ANDROID_HOME
Keep ANDROID_SDK_ROOT as a fallback
2024-07-21 00:53:13 -07:00