Commit Graph
7740 Commits
Author SHA1 Message Date
topjohnwu b7ec312380 app: improve Material 3 component conformance
- Replace custom dividers with VerticalDivider / HorizontalDivider
- Use standard Material 3 search styling for DenyList
- Remove redundant button / FAB shape overrides and card clip modifiers
- Convert custom warning and notice boxes to Material 3 Card
- Align PrimaryTabRow to full width in LogScreen

Assisted-by: Gemini 3.7 Flash
2026-09-02 02:08:23 -07:00
topjohnwu bc3efc03bd app: migrate to Material 3 NavigationBar
Replace the custom floating navigation bar with official Material 3
NavigationBar and NavigationBarItem components, and remove unnecessary
bottom padding workarounds across all screens.

Assisted-by: Gemini 3.7 Flash
2026-09-02 02:08:23 -07:00
topjohnwu 3612faf766 app: configure link color for MarkdownText
Explicitly set linkTextColor on the underlying TextView so Markdown
links adhere to the active Compose theme.

Assisted-by: Gemini 3.7 Flash
2026-09-01 23:04:00 -07:00
topjohnwu 81342a572f app: improve scrollbar drag handling and inertia
Override active fling inertia on touch down using
MutatePriority.UserInput and handle scroll events sequentially via a
conflated channel.

Assisted-by: Gemini 3.7 Flash
2026-09-01 23:04:00 -07:00
topjohnwu cbfd2a736f app: use full-screen dialog for install screen
Replace the install bottom sheet with a full-screen Dialog to provide
more vertical space for release notes and installation methods.

- Remove the legacy multi-step wizard logic from InstallViewModel.
- Use styled Cards with SettingsSwitch for install options and
  SettingsArrow for installation methods.
- Remove max height constraint on MarkdownText to allow release notes
  to expand naturally with full-screen scrolling.

Assisted-by: Gemini 3.7 Flash
2026-09-01 23:04:00 -07:00
topjohnwu eb1ae600e2 app: use MagiskDialog in SuRequestScreen
Refactor SuRequestScreen to use the shared MagiskDialog component,
matching standard dialog styling across the app.

Assisted-by: Gemini 3.7 Flash
2026-09-01 23:04:00 -07:00
topjohnwu b80d2b74e9 app: adjust MagiskDialog width and margins
Disable platform default width on dialogs and apply standard horizontal
padding and max-width constraints for better readability.

Assisted-by: Gemini 3.7 Flash
2026-09-01 23:04:00 -07:00
topjohnwu c6fddfbe25 app: consolidate dialogs into MagiskDialog
Add a shared MagiskDialog component to unify styling, typography,
shape, and button layouts across all dialogs in the app module.

Assisted-by: Gemini 3.7 Flash
2026-09-01 23:04:00 -07:00
topjohnwu ec3b0b8c5f Never import android.R 2026-09-01 23:04:00 -07:00
topjohnwu d3d5698001 app: use pager for tabs in logs screen
Add a HorizontalPager in LogScreen to support swiping horizontally
between the Superuser and Magisk log tabs instead of paging the outer
main navigation tabs.

Assisted-by: Gemini 3.7 Flash
2026-09-01 23:04:00 -07:00
vvb2060 4e44848a6e app: update zh-rCN translation 2026-09-01 14:56:44 -07:00
Neebe3289 93d2babf66 app: Update Indonesian translations
update and cleanup indentation space.

Change-Id: Ief761e87ae9367323f0ca6c150192817cff83c62
2026-09-01 14:56:22 -07:00
topjohnwu 8c4341e928 Prepare for v31.0 release 2026-08-31 23:46:36 -07:00
topjohnwu 7847ab6de8 app: fix navigation when flashing modules
When launching a flash intent using FLAG_ACTIVITY_CLEAR_TOP, Android
recreates MainActivity if singleTop or singleTask is not set, causing
the app to briefly display the home screen before showing the flash
screen.

Set MainActivity to singleTask, add FLAG_ACTIVITY_SINGLE_TOP to flash
intents, and default cold-start flash zip intents to the modules tab.

Assisted-by: Gemini 3.7 Flash
2026-08-31 23:46:10 -07:00
topjohnwu 3e6e4326b1 app-legacy: add webview zygote to denylist
Port WebView Zygote denylist support to the legacy app module.

Assisted-by: Gemini 3.7 Flash
2026-08-31 19:29:38 -07:00
topjohnwu a5c8861629 Promote next-gen app to production, and demote existing app to legacy 2026-08-31 15:55:14 -07:00
topjohnwu 74df51fd1b app-ng: improve uninstalled state on home screen
When Magisk is not installed:
- Display "Not Installed" in error color instead of "N/A"
- Use a prominent filled primary button for the Install action
- Dim the Magisk icon tint to outline color

Assisted-by: Gemini 3.7 Flash
2026-08-31 10:54:59 -07:00
topjohnwu e9fd6b58ab app-ng: align app card icon and title with magisk
Adjust the App card icon size to 48dp and the following spacer to 16dp
to match the Magisk card and align their titles horizontally.

Assisted-by: Gemini 3.7 Flash
2026-08-31 01:49:57 -07:00
topjohnwu 64be5dcc2e app-ng: move uninstall button to top app bar
Remove the oversized uninstall button from the home screen content and
place an uninstall action icon in the top app bar next to the reboot
button.

Assisted-by: Gemini 3.7 Flash
2026-08-31 01:49:57 -07:00
topjohnwu 99039b7e6c app-ng: improve su request dialog layout
Widen the su request dialog card to fit screen width on phones while
capping at 560dp on larger screens. Move the package name to its own
row below the app icon and title to avoid clipping and allow it to
wrap onto multiple lines when necessary. Make the dialog content
vertically scrollable to ensure all actions are visible in landscape.

Assisted-by: Gemini 3.7 Flash
2026-08-31 01:49:57 -07:00
Wang Han 6833e56398 Don't kill webview zygote on denylist change
It won't restart and make webview unusable.
2026-08-30 20:52:34 +00:00
Wang Han b2d86c79c2 Add webview zygote as umount target
https://github.com/tiann/KernelSU/commit/4521784328352c54334beb29e05c74360b60d7cb
2026-08-30 02:59:46 -07:00
topjohnwu faa5f85b15 Fix legacy app launch 2026-08-29 23:34:16 -07:00
topjohnwu a6ea7cefea Update links, icons, and developer 2026-08-29 23:34:16 -07:00
Wang Han 4145e5205a Bump MIN_NON_EMPTY_DTB_SIZE to 0x84 2026-08-30 05:03:41 +00:00
topjohnwu f38e0c8bc6 su: Enable logging and notify by default
When a UID makes a root request for the first time, no row exists in
the policies table. Previously, RootSettings derived Default, which
initialized log and notify to false. As a result, connect_app() skipped
calling app_log() or app_notify() immediately after user approval on
the initial su request.

Explicitly implement Default for RootSettings with log and notify set
to true by default.

Assisted-by: Gemini 3.7 Flash
2026-08-30 00:03:52 +00:00
topjohnwu b8b140fafa app-ng: center align empty state placeholder text
Set textAlign = TextAlign.Center on the empty state placeholder text in
SuperuserScreen and ModuleScreen so multi-line messages are centered
horizontally instead of left-aligned.

Assisted-by: Gemini 3.7 Flash
2026-08-30 00:03:52 +00:00
topjohnwu a2affbb415 app-ng: support horizontal scrolling in terminal
Increase the terminal buffer columns to prevent text lines from wrapping
at the screen boundary, and enable bidirectional scrolling in
TerminalScreen.

Track the maximum used column across terminal lines dynamically to
constrain horizontal scrolling to actual content, and add a horizontal
scrollbar component matching the vertical scrollbar.

Assisted-by: Gemini 3.7 Flash
2026-08-30 00:03:52 +00:00
topjohnwu cbe497e196 app-ng: improve Magisk log parsing and UI
Magisk daemon internal logs skip the TAG field, outputting directly
after the priority level. Update MagiskLogParser to treat logcat tags
as part of the message and strip leading delimiters for internal logs.

Also adjust the Magisk log card UI layout to format PID/TID clearly and
remove the duplicate key generation in LazyColumn that caused crashes.

Assisted-by: Gemini 3.7 Flash
2026-08-27 17:19:55 +00:00
topjohnwu 227e3cee0a Update lsposed for testing 2026-08-27 17:19:55 +00:00
topjohnwu ce404d1951 Update gradle dependencies 2026-08-27 17:19:55 +00:00
xAstroBoy 8903cf7f22 zygisk: make built-in Zygisk work on Meta Quest (lazy per-trust partition zygotes)
Meta Quest (Horizon OS) does not start the zygote the normal way: ro.zygote=
zygote64_stub32 launches /system/bin/stub_zygote, which forks a separate
app_process64 zygote PER security partition (system/trusted vs untrusted-app),
driven by hzos_security_zygote_partitioning_policy. The untrusted-app partition
zygote -- the one that forks 3rd-party apps and the Magisk manager -- is spawned
LAZILY, after boot-complete.

magiskd sets ro.dalvik.vm.native.bridge=libzygisk.so during boot but clears it
again at boot-complete (ZygiskState::reset). On a normal device every zygote has
already started by then, so clearing it is harmless. On Quest the untrusted-app
partition zygote reads the (now cleared) property when it finally execve's
app_process64, never loads libzygisk.so, so 3rd-party apps + the Magisk manager
are never injected -> "Zygisk: N/A".

Fix (daemon.rs): on the boot-complete reset(restore=true) path, reset the crash
counter but KEEP native.bridge set (set_prop) instead of clearing it
(restore_prop); only the >3-crash rollback path still clears. The lazily-spawned
partition zygotes then load the loader when they start.

Also (hook.cpp), robustness fixes the loader needs on this device:
 - Wrap hook_zygote_jni()'s JNI locals in PushLocalFrame(64)/PopLocalFrame so
   leaking locals can't trip ART's "non-empty local reference table" abort, and
   bail if GetEnv returns no env.
 - Make the strdup(ZygoteInit) trigger a substring match + add an idempotency
   guard so the zygote hooks install exactly once per process.

Verified on Quest 3 (Android 14): system_server + every app fork is intercepted
and LSPosed loads end-to-end.
2026-08-27 05:38:45 +00:00
Wang Han 5a28d2fcfc Backup original sepolicy db for LD_PRELOAD strategy 2026-08-27 05:38:01 +00: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 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
Bela Schaum 3c411abc34 Fix slice copy range for 'want' in dtb.rs 2026-08-25 21:09:16 +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
Michael Jauregui a19666d884 magiskboot: Lower the compression presets for XZ & LZMA
magiskboot: Lower the compression presets for XZ & LZMA

The compression routine always uses the maximum compression preset for all formats.
This is problematic with XZ and LZMA because they use far more memory than the other formats, while just providing a very marginal advantage in the resulting file size.
The compression preset was changed from 9 to 6, which is often the default value and provides more than enough compression.
Tested on Samsung Galaxy Fame (512MB RAM, perfect for this).
2026-08-23 21:46:25 +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