Commit Graph
575 Commits
Author SHA1 Message Date
topjohnwu a4fb84b6f8 Bump to ONDK r30.2 2026-11-18 02:01:06 -08: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 1240c2e35c app: Remove app repackaging and signing
Remove app hiding repackaging, key generation, AXML patching, and
in-app APK signing components along with BouncyCastle (bcpkix).

- Delete AppMigration, Keygen, AXML, and signing package classes.
- Remove bcpkix dependency and build-logic packaging exclude.
- Remove suManager, keyStoreRaw, StringDao, and strings DB table.
- Simplify DownloadProcessor app update and SplashScreen init.
- Remove AppMigrationTest, setupAppHide/Restore, and test scripts
  references to repackaged test packages.
- Remove unused hide_app_title string across all locales.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu ea16c8141e Fix package management and user targeting on HSUM
- Use --user current for pm install, adb install, and appops set across
  install_script, adb_pm_install, and test/setup scripts.
- Skip headless user 0 in get_users() on HSUM devices.
- Use --user current in app_notify for non-app UIDs instead of calling
  content call against all users.
- Clear path buffer on each iteration in setup_magisk_env.
- Use --user current for am instrument in app migration tests.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu b43a08fdde Bump minSdk to 24 and drop API 23 workarounds
- Bump minSdk to 24 in Setup.kt, APP_PLATFORM to android-24 in
  Application.mk, and update CI AVD matrices and scripts.
- Unify SePatchStrategy::Legacy with SePatchStrategy::SelinuxFs in
  magiskinit to use MOCK_ENFORCE FIFO blocking and remove MOCK_REQPROT.
- Make APP_DATA_DIR a compile-time "/data/user_de" constant and remove
  pre-API 24 /data/user and /data/adb fallbacks.
- Remove Android 6.0 Samsung forkAndSpecialize JNI hook signature.
- Remove pre-API 24 device-protected storage wrappers, Api23Impl in
  LocaleSetting, AndroidManifest.xml stub resource workaround, and
  ServiceCompat/ProcessCompat/InlinedApi workarounds in the app.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu 3ebcc3440d Support patching Aluminium OS recovery images
Add RecoveryGptProcessor, a WholeFilePatcher for GPT disk images
such as Aluminium OS recovery_image.bin. The input is processed in a
single sequential pass: all data is copied to the output until
init_boot_a is reached, which is extracted for the standard Magisk
boot image patch. After the patched init_boot_a is written, the rest
of the input is copied. vendor_boot_b is always patched to disable
data wipe and AVB hash verification whenever it is encountered.
Subclasses can override onInitBoot and onVendorBoot to customize how
these images are handled.

The vendor_boot patching logic is implemented in app_functions.sh as
patch_al_vendor_boot, so it is also available without root access.

PatchFileClassifier now detects GPT images as RecoveryGpt, both raw
and within recovery zips. MagiskInstaller generalizes whole file
processing over WholeFilePatcher, which is now Closeable to release
resources when patching is aborted before finish.

Add testRecoveryGptProcessor in AppTest, which streams and inflates
the recovery image from a remote zip, verifies the checksums of
init_boot_a and vendor_boot_b without patching, and verifies the
output is identical to the input with streaming checksums.

Assisted-by: Claude Opus 5.5
2026-10-08 10:35:49 -07:00
topjohnwu 53d66fb847 Add unit tests for ZipExtractor
Implement AppTest with unit tests for ZipExtractor verifying
remote boot image extraction from both factory image packages
and OTA update packages using HTTP range requests.

Also add an app-test sub-command to scripts/avd.sh to run AppTest
via instrumentation on connected emulators.

Assisted-by: Gemini 3.8 Flash
2026-10-07 07:44:31 +00:00
topjohnwu 33c1f83562 Rename test class name 2026-10-07 05:05:38 +00:00
topjohnwu 43afdf16a8 Automatically re-sign ChromeOS images on repack
Instead of requiring scripts to detect ChromeOS images and sign them
after repacking, preallocate the vblock and append the kernel blob
trailer while repacking, then generate the vblock after all other
patching is done. The image is padded to its original size after
signing, same as other boot images.

The signer now only takes the kernel payload and returns the vblock,
hashing the kernel blob incrementally. The sign-chromeos action
streams its output to disk instead of building the whole signed
image in memory.

Since ChromeOS images no longer need special handling, unpack no
longer returns 2 for them, and all ChromeOS logic is removed from
the scripts.

Assisted-by: Claude Opus 5.5
2026-10-06 23:36:12 +00:00
topjohnwu da50b5586f Sign ChromeOS boot images with magiskboot
Port the `futility vbutil_kernel --pack` code path used to sign
ChromeOS boot images into magiskboot as a new `sign-chromeos` action.
The kernel keyblock and data key are embedded into the executable, and
all signing parameters previously passed in sign_chromeos are
hardcoded. The output is bit-for-bit identical to the reference tool.

Rename the existing `sign` action to `sign-avb1` to disambiguate.

Remove the prebuilt futility binary and stop shipping the chromeos
assets folder; scripts now call magiskboot directly.

Assisted-by: Claude Opus 5.5
2026-10-06 22:59:48 +00: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 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 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 42272ccac7 scripts: improve release.sh build and upload flow
- Generate an ephemeral build config inheriting only signing properties
  so local developer settings in config.prop remain untouched
- Remove gsed requirement by making in-place edits POSIX-compliant
- Add ver_to_code and code_to_ver conversion functions
- Add pre-upload validation and safe git staging
- Add command usage handling

Assisted-by: Gemini 3.8 Flash
2026-09-02 21:03:19 -07:00
topjohnwu 4b0a2d5046 scripts: verify APK signatures in release.sh
Add signature verification to release.sh using apksigner from the
latest Android SDK build-tools to ensure all built APKs match the
expected certificate fingerprint.

Assisted-by: Gemini 3.8 Flash
2026-09-02 19:57:45 -07:00
topjohnwu 8c4341e928 Prepare for v31.0 release 2026-08-31 23:46:36 -07:00
topjohnwu 5480fc41c3 app: inject prebuilt bootctl into jniLibs
Download updated multi-arch prebuilt bootctl binaries built from
Android 14 (android-14.0.0_r1) and package them into jniLibs alongside
busybox instead of bundling a single binary in assets.

The new bootctl binaries support AIDL Boot HAL implementations on
Android 14+ (API 31+), fixing OTA slot switching issues on newer
devices like Pixels.

Update post-OTA install logic in the app and shell scripts to use the
native bootctl executable from MAGISKBIN.

Fixes #8824
2026-08-27 03:29:31 +00:00
topjohnwu 2fc7a6d284 avd.sh: improve boot waiting and error handling
Update wait_for_boot to monitor the background emulator process and
fail immediately if it crashes, avoiding indefinite blocking on
adb wait-for-device. Implement timeout handling directly in the
polling loop without relying on subshell timeout wrappers.

In run_main, capture emulator stdout/stderr to a temporary log and
dump its contents on failure for easier debugging. Temporarily disable
tracing within wait_for_boot during polling to keep test logs clean
while preserving the caller's shell tracing state.

Assisted-by: Gemini 3.7 Flash
2026-08-26 05:42:55 +00:00
topjohnwu e7e5469100 Update avd.sh to accept ABI
Also update to use Android CLI
2026-08-26 05:42:55 +00:00
topjohnwu f6af844a00 Update live_setup.sh
[skip ci]
2026-08-18 17:56:10 +00:00
topjohnwu 43954973dd Update avd.sh
- Fix API level parsing
- Fix -l argument
2026-08-12 22:44:35 +00:00
topjohnwu b32ff20b79 Update ONDK to r30.1 2026-07-31 22:57:41 -07:00
topjohnwu 0f59f1f345 Setup userspace Magisk tests
The existing test infrastructure relies on the full Magisk setup before
it can test any functionality. However for most of the time, we just
want to test the core Magisk functionality without the need of involving
MagiskInit.
2026-07-28 17:23:35 -07:00
topjohnwu 9d0b5298af Update to ONDK r30.0 2026-04-20 01:36:36 -07:00
topjohnwu 75f60d6e63 Update avd.sh 2026-04-19 19:27:47 -07:00
Doddddd 4a1a069ad2 Fix gradlew path resolution in env.py 2026-04-10 04:13:15 +00: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 5cb025e7cc Setup CI for app-ng 2026-03-17 20:04:47 -07:00
topjohnwu 07e92948c8 Add CI tests for Android 17 2026-02-22 23:26:10 -08:00
osm0sis 8495a03947 Fix A-only addon.d retaining PREINITDEVICE on 30300+
- broken after https://github.com/topjohnwu/Magisk/commit/742913ebcb10cf819a54699497359535047874f7 so use get_flags to be more futureproof
2026-01-31 13:52:44 -08:00
topjohnwu 505053f9b4 Properly support AVD with minor SDK version 2025-12-04 20:55:46 -08:00
topjohnwu 84f7d75d30 Update release.sh
Strip out all canary build logic
2025-12-01 15:27:01 -08:00
topjohnwu aac52176ed Support API level as floating point 2025-10-02 04:10:22 -07:00
LoveSy d42ec5da9a Fix pattern matching for CANARY version 2025-09-29 01:18:52 -07:00
topjohnwu 742913ebcb Support installing Magisk on vendor_boot
Close #9238, fix #8835
2025-09-28 01:10:11 -07:00
topjohnwu ea72666df8 Only specify ADB port for tests 2025-08-25 15:34:04 -07:00
topjohnwu 1333d3b986 Fix canary emulator 2025-08-18 11:25:47 -07:00
残页 335146a6a2 Update supported API levels 2025-08-17 23:58:43 -07:00
topjohnwu eaf9527971 Use AOSP ATD for API 36
[skip ci]
2025-08-15 17:25:41 -07:00
topjohnwu 959430e030 Fix systemless hosts installation 2025-08-05 09:44:51 -07:00
topjohnwu cd9851a1fe Add regression test for #9179 2025-07-18 17:58:29 -07:00
topjohnwu 4cf525c588 Add Android canary builds into CI tests 2025-07-11 00:16:39 -07:00
南宫雪珊 23ea28de6f scripts: fix modules_update dir context 2025-07-10 10:59:39 -07:00
topjohnwu 7124db98e3 Stop involving JSON in release script 2025-06-20 00:59:38 -07:00
topjohnwu 0860e859f7 Stop updating README for each release 2025-06-20 00:32:11 -07:00
topjohnwu 48d9fc24eb Update release.sh 2025-06-05 11:00:27 -07:00
topjohnwu 8b7fb6cdde Improve scripts 2025-05-15 02:56:36 -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 608786e8f3 Print verbose logs in avd_test.sh and cuttlefish.sh 2025-05-11 02:18:36 -07:00
Howard Wu ddf5474917 apt-get update before install to fix ci 2025-04-28 11:16:14 -07:00