Commit Graph
100 Commits
Author SHA1 Message Date
topjohnwu 4623f546e3 Convert subproject AGENTS.md into skills 2026-08-26 05:42:55 +00:00
topjohnwu b910c7d915 Update .gitignore 2026-08-26 05:42:55 +00:00
topjohnwu 15062974a3 magiskboot: allow free zImage piggy payload size
Support dynamic zImage piggy payload sizes during repacking by updating
the zImage decompressor stub headers, symbol tables, and GOT entries.

Previously, magiskboot padded repacked zImage files to preserve the
exact original file size. For non-gzip compressed zImages (such as XZ),
repacking with a different payload size broke stub symbol resolution
and resulted in ununpackable or unbootable images.

Key changes:
- Encapsulate zImage parsing and patching in a dedicated struct ZImage
  in Rust with CXX FFI, new_head, and new_tail methods.
- Locate piggy_end using table references or GOT table entries bounded
  by LC0.
- Relocate LC0 table entries, LC1 table, and GOT table entries with
  4-byte padding/alignment when payload size changes.
- Relocate R_ARM_GOTPC PC-relative literal pools in decompressor .text.
- Append uncompressed size for non-gzip algorithms per size_append.
- Remove zopfli compression support across magiskboot as dynamic zImage
  piggy sizing supersedes the need for exact size matching.

Fix #9880

Assisted-by: Gemini 3.7 Flash
2026-08-25 19:09:29 +00:00
topjohnwu de60431a0d magiskboot: port find_dtb_offset to Rust
Port find_dtb_offset from C++ to Rust in dtb.rs, using the fdt crate
for header parsing and root node validation.

Key changes:
- Upgrade fdt crate to 0.2.0-alpha2 and adapt dtb.rs to updated APIs.
- Implement find_dtb_offset using Fdt::new_unaligned_fallible.
- Define MIN_NON_EMPTY_DTB_SIZE (0x48) per Linux kernel ARM zImage
  specification to ignore empty or false positive DTB headers.
- Expose find_dtb_offset to C++ via CXX bridge and clean up legacy
  structs and declarations.

Assisted-by: Gemini 3.7 Flash
2026-08-25 19:09:29 +00:00
topjohnwu c02705d969 magiskboot: migrate check_fmt to Rust
Migrate check_fmt and guess_lzma to Rust in format.rs.

Assisted-by: Gemini 3.6 Flash
2026-08-25 19:09:29 +00:00
topjohnwu 7600d3664f app: default to Monet theme and filter pre-Android S
Default to Monet (dynamic color) theme options on supported API
versions (Android S+) while hiding Monet options on unsupported
versions (< Android S).

Introduce ColorMode enum to encapsulate theme modes and UI index
mapping logic cleanly.

Assisted-by: Gemini 3.6 Flash
2026-08-23 15:42:12 +00:00
topjohnwu 8297807b8b apk-ng: refine M3 theme color schemes
Update light and dark color schemes in apk-ng to strictly align with
Material 3 Expressive color guidelines. Explicitly define surface
container tokens for improved contrast and card visibility, and
enhance primary and tertiary accents.

Assisted-by: Gemini 3.6 Flash
2026-08-23 15:42:12 +00:00
topjohnwu cc76a4e748 Update AGENTS.md 2026-08-22 23:23:55 -07:00
topjohnwu 99a6e2749f app: modernize architecture and state in apk-ng
Refactor apk-ng to adhere to modern Android and Jetpack Compose best
practices:
- Migrate VMFactory to the type-safe AndroidX viewModelFactory DSL.
- Use collectAsStateWithLifecycle across all screen composables to
  pause flow collection when backgrounded.
- Convert PolicyItem, ModuleItem, DenyAppState, and DenyProcessState
  to pure immutable data classes, removing Compose MutableState from
  ViewModels.
- Extract shell operations from UI model classes into ViewModels.
- Bridge Info.isConnected LiveData to coroutine Flow using callbackFlow
  and collect in viewModelScope without modifying :core.
- Consolidate magisk and manager version state into
  HomeViewModel.UiState.
- Add contentType to LazyColumn items for optimal list recycling.
- Restore proper localized string resolution in MainActivityDialogs.

Assisted-by: Gemini 3.7 Flash
2026-08-20 21:36:49 +00:00
topjohnwu 3aaf18038a app: improve Compose idiomaticity in apk-ng
Refactor apk-ng UI components and screens to follow idiomatic Jetpack
Compose patterns:
- Hoist state across dialogs and bottom sheets, replacing MutableState
  parameter passing with standard boolean flags and event callbacks.
- Add modifier parameter to all UI composables and apply proper modifier
  chaining.
- Decouple screen composables from MainActivity host casting by
  providing explicit authentication and permission callbacks.
- Scope SuperuserViewModel to MainActivity and share across MainScreen
  and SuperuserDetailScreen.
- Unify loose mutable states in SuRequestViewModel into an immutable
  UiState StateFlow.
- Fix dynamic loop remember allocations in MainActivity dialogs.
- Provide stable item keys for LazyColumn in MagiskLogTab.

Assisted-by: Gemini 3.7 Flash
2026-08-20 21:36:49 +00:00
topjohnwu c578a9632b app: reload tabs when selected in apk-ng
Because HorizontalPager pre-renders all tab composables, LaunchedEffect
with a Unit key was only executing once on initial creation. As a result,
changes to configuration (e.g. update channel) calling resetUpdate()
did not trigger a reload when returning to the Home tab, causing the
install/reinstall dialog to display an empty changelog.

Trigger startLoading() whenever a tab becomes active (isCurrentPage).

Assisted-by: Gemini 3.7 Flash
2026-08-20 21:36:49 +00:00
topjohnwu 5262ecdf82 Fix default channel shown in UI 2026-08-20 21:36:49 +00:00
topjohnwu 999bda3bc4 app: adopt Material 3 Expressive UI in apk-ng
Update apk-ng components and screens to adhere to Material 3 Expressive
design guidelines:
- Define expressive Shapes and Typography scales in MagiskTheme.
- Add active pill indicators with spring animations to floating nav bar.
- Update card surfaces to 20dp-24dp rounded containers with tonal depth.
- Modernize action buttons and search bar to expressive pill shapes.
- Enhance dialogs and su request screens with rounded surfaces.

Assisted-by: Gemini 3.7 Flash
2026-08-18 17:56:10 +00:00
topjohnwu 6177c7c52b app: improve Material 3 colors in apk-ng
Improve Material 3 color system compliance and legibility across apk-ng:
- Add custom Magisk-branded light and dark fallback color schemes.
- Fix button color token pairings and remove custom alpha blending.
- Fix surface/background tokens in dialogs and markdown views.
- Harmonize badges and warnings with semantic M3 color roles.
- Remove redundant TopAppBar icon tint overrides.

Assisted-by: Gemini 3.7 Flash
2026-08-18 17:56:10 +00:00
topjohnwu fa6867b6a7 Remove unused resources 2026-08-18 17:56:10 +00:00
topjohnwu 47a112edd0 Update gradle dependencies 2026-08-18 17:56:10 +00:00
topjohnwu 599a572d41 app: add scrollbar to screens in apk-ng
Add interactive, draggable scrollbars to all scrollable screens and
components in apk-ng so users can fast-scroll through long content.

Assisted-by: Gemini 3.7 Flash
2026-08-18 17:56:10 +00:00
topjohnwu 8cc4d3a5c1 docs: update AGENTS.md in subdirectories
Update subproject AGENTS.md guidelines to always include the top-level
AGENTS.md.

Assisted-by: Gemini 3.7 Flash
2026-08-18 17:56:10 +00:00
topjohnwu d04ab3fbff app: resize LogLevelBadge using Material 3 Badge
Replace custom padded Box in LogLevelBadge with Material 3's Badge
component to make log level indicators more compact and consistent
with the rest of the application's badge styling.

Assisted-by: Gemini 3.7 Flash
2026-08-18 17:56:10 +00:00
topjohnwu f6af844a00 Update live_setup.sh
[skip ci]
2026-08-18 17:56:10 +00:00
topjohnwu 3bdffe695d Generate shorty in comments and reorder jni_hooks 2026-08-12 23:49:37 +00:00
topjohnwu 43954973dd Update avd.sh
- Fix API level parsing
- Fix -l argument
2026-08-12 22:44:35 +00:00
topjohnwu 290200b990 Handle empty matrix.type correctly
[skip ci]
2026-08-11 01:20:15 +00:00
topjohnwu a65e492e3d Update build-logic
- Prevent gradle from crashing when flags.prop does not exist
- Fix ndk version

[skip ci]
2026-08-11 01:09:03 +00:00
topjohnwu ede844bdaa Reduce the amount of tests to run
[skip ci]
2026-08-05 11:24:59 -07:00
topjohnwu 0b0ee5611e Update libcxx 2026-08-03 19:22:52 -07:00
topjohnwu fd0cb66b6b Cargo fmt 2026-07-31 22:57:41 -07:00
topjohnwu a581038608 Update cargo dependencies 2026-07-31 22:57:41 -07:00
topjohnwu bffc9108bc Address new clippy warnings 2026-07-31 22:57:41 -07:00
topjohnwu b32ff20b79 Update ONDK to r30.1 2026-07-31 22:57:41 -07:00
topjohnwu d04635478a Fix clippy warnings across native codebase
Address clippy warnings including collapsible match statements in
bootstages, daemon, su daemon, and db modules, as well as iterator
loops in files.rs.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu 05099cce89 sepolicy: use pure token-based xperm parsing
Update extract_token to only split hyphens when preceding a valid
hex xperm. Revert parse_xperm and parse_xperms to pure token-based
AST parsing without inspecting ID strings.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu 9d4befe06d sepolicy: add unit tests for statement parsing
Add unit tests covering all PolicyStatement variants, brace set
expansion, xperm ranges/complements, spacing corner cases, and error
cases.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu 896b78cdd5 sepolicy: parse statements into PolicyStatement enum
Parse tokens into intermediate PolicyStatement enums with meaningful
field names before executing them on SePolicy.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu dfd9fe00d3 docs: update native AGENTS.md guidelines
Document native build pipeline, FFI mechanics, and Rust code
conventions in native/AGENTS.md.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu cfd195b514 docs: update AGENTS.md guidelines for AI models
- Expand top-level AGENTS.md with environment execution rules and AI guidelines.
- Add app/AGENTS.md for app subproject architecture and maintenance mode rules.
- Add native/AGENTS.md for native C/C++/Rust build target requirements.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu 5c82406ee6 Disable cuttlefish test
AOSP is no longer up-to-date

[skip ci]
2026-07-28 18:44:47 -07:00
topjohnwu e67be65bb2 Fix API 37.0 CI 2026-07-28 18:37:25 -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 ffadcfd163 Update gradle dependencies 2026-07-28 10:52:47 -07:00
topjohnwu f5907f2577 Update CI versions 2026-07-27 18:54:36 -07:00
topjohnwu 9d0b5298af Update to ONDK r30.0 2026-04-20 01:36:36 -07:00
topjohnwu 87192bd469 Fix compilation database generation when sccache is enabled 2026-04-20 01:17:00 -07:00
topjohnwu 36511c6d79 Run CI on API 37.0 2026-04-19 19:27:47 -07:00
topjohnwu 75f60d6e63 Update avd.sh 2026-04-19 19:27:47 -07:00
topjohnwu ee3ce37ae4 Build against API 37 2026-04-19 19:27:47 -07:00
topjohnwu 42fa348357 Address several lint issues 2026-04-15 15:54:19 +00:00
topjohnwu 80e2849f3f Move InstallBottomSheet into its own file
Assist-by: Gemini
2026-04-15 15:54:19 +00:00
topjohnwu 859ba80e43 Port new download feature to apk-ng
Assist-by: Gemini
2026-04-15 15:54:19 +00:00
topjohnwu 77ea982963 Update gradle dependencies 2026-04-15 15:54:19 +00:00
topjohnwu 7976897ace Switch over to use Wire
Assisted-by: Gemini
2026-04-14 10:24:16 +00:00
topjohnwu 7d5942a3bc Remove unused code 2026-04-14 07:16:59 +00:00
topjohnwu 81413b0f10 Remove hardcoded strings in apk-ng 2026-04-14 07:16:59 +00:00
topjohnwu 2f4bb0149e Update cargo dependencies 2026-04-08 05:29:57 +00:00
topjohnwu 8a0dfb383e Update gradle dependencies 2026-04-08 05:29:57 +00:00
topjohnwu 9c696d6ff8 Add basic AGENTS.md for application code 2026-04-08 05:29:57 +00:00
topjohnwu 240b6db1cc Move stub resources into its own module
Stop relying on internal AGP intermediate paths in the build directory.
Use standard AGP classes to achieve the same result
2026-04-08 05:29:57 +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 da512b9b1f Delete previously generated component classes in stub 2026-04-08 05:29:57 +00:00
topjohnwu d95918dc15 Cleanup PreferenceConfig 2026-04-08 05:29:57 +00:00
topjohnwu fd1f403bac Use tools:sdk-common for build-logic 2026-04-08 05:29:57 +00:00
topjohnwu 122a0a3349 Fix Gradle dependencies cache restore 2026-03-27 08:40:46 +00:00
topjohnwu 3cb18d6c1e Disable Kotlin for stub
We need to do it after switching to built-in Kotlin
2026-03-27 08:40:46 +00:00
topjohnwu d5476e1321 Switch over to use composite build-logic
Using buildSrc comes with too many caveats, switch over to a composite
build-logic solves a lot of buildSrc's issue.
2026-03-27 08:40:46 +00:00
topjohnwu 6f93f74f80 app-ng: Fix several compile warnings 2026-03-21 06:57:09 +00:00
topjohnwu 3021ef46ee Redesign status card
Assist-by: Gemini
2026-03-20 19:38:34 +00:00
topjohnwu 945c83f4af Update gradle dependencies 2026-03-20 19:38:34 +00:00
topjohnwu b9d64bfdf9 Remove all legacy themes and AppCompatActivity 2026-03-20 19:38:34 +00:00
topjohnwu a59e651269 Manual UI tweaking 2026-03-20 19:38:34 +00:00
topjohnwu 4eba69c892 Redesign the home screen
Assist-by: Gemini
2026-03-20 19:38:34 +00:00
topjohnwu e2a437ebfc Switch to Google Material 3 library
Made-with: Gemini
2026-03-20 19:38:34 +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 2be3caa7c3 Update GitHub actions 2026-03-17 20:13:53 -07:00
topjohnwu 5cb025e7cc Setup CI for app-ng 2026-03-17 20:04:47 -07:00
topjohnwu e4f4239f5c Re-integrate old app implementation into project 2026-03-16 03:36:43 -07:00
topjohnwu debf1800d8 Merge next generation app impl into master 2026-03-16 03:35:08 -07:00
topjohnwu 7008c563e8 Rename apk to preserve history after future merge 2026-03-16 03:34:32 -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 6242a605f5 Optimize imports 2026-03-16 02:56:03 -07:00
topjohnwu 925ed577e7 Move plugins to its own section in version catalog 2026-03-16 02:46:57 -07:00
topjohnwu 6bb48df712 Go through rustup proxy if possible 2026-03-11 00:43:18 -07:00
topjohnwu e8a58776f1 Release Magisk v30.7
[skip ci]
2026-02-23 00:02:33 -08:00
topjohnwu 07e92948c8 Add CI tests for Android 17 2026-02-22 23:26:10 -08:00
topjohnwu 74ead75ce8 Update cargo dependencies 2026-02-22 14:39:46 -08:00
topjohnwu bb082e703c Update app dependencies 2026-02-22 14:22:54 -08:00
topjohnwu 9ee6a6b3d7 Update to ONDK r29.5 2026-02-06 16:32:25 -08:00
topjohnwu dd3798905f Update libsepol to upstream Android 16 QPR2 2026-02-05 12:51:21 -08:00
topjohnwu 4dd6e3c252 Minor changes for app 2026-02-05 00:56:10 -08:00
topjohnwu 18c1347bd3 Update to AGP 9.0 2026-01-19 23:29:02 +08:00
topjohnwu 0bbc736051 Properly set abiList with config.prop for APK 2025-12-16 02:38:27 -08:00
topjohnwu 01cb75eaef Code cleanup 2025-12-13 22:12:30 -08:00
topjohnwu 33eaa7c5eb Update cargo dependencies 2025-12-12 11:42:45 -08:00
topjohnwu 8734423cb0 Update to ONDK r29.4 2025-12-12 11:42:45 -08:00
topjohnwu da9e72b2a2 Update gradle dependencies 2025-12-12 11:42:45 -08:00
topjohnwu ff4ca74cfe Ban all unwrap usage in codebase 2025-12-08 23:31:04 -08:00
topjohnwu 200665c48a Make jni_hooks.hpp a normal C++ header
[skip ci]
2025-12-07 02:44:19 -08:00
topjohnwu dd42aa99ea Refactor gen_jni_hooks.py
[skip ci]
2025-12-07 02:25:50 -08:00
topjohnwu 871643dce2 Enable CI for API 36.1 2025-12-07 00:18:50 -08:00
topjohnwu a510554b21 Disable Zygisk upon incomplete JNI hook
Do not enable Zygisk unless ALL replacements are hooked properly.
This allow Zygisk tests to fail when new signature is introduced.
2025-12-07 00:18:50 -08:00
topjohnwu 64752f38e8 Do not unwrap when getting decoder and encoder
Or else things will crash mysteriously when unexpected input occurs
2025-12-05 03:40:18 -08:00