On Headless System User Mode (HSUM) devices, user 0 is headless while
human users operate under secondary user IDs. Eliminate residual
assumptions in core native components where user 0 was presumed to be
the sole or active manager user:
- In setup_magisk_env, scan all existing users via get_users() to check
if the app-local binary install directory exists.
- In ensure_manager, check all users before falling back to stub install
so an already-installed manager on a secondary user is recognized.
- Pass --user all to pm install, pm uninstall, and appops set in package
management scripts to handle manager lifecycle device-wide.
Assisted-by: Gemini 3.8 Flash
Consolidate su notification and logging IPC calls into a single notify
action on the native side, passing all logging parameters along with an
explicit "log" boolean key.
On the application side, retain the existing "log" action entry point
for backwards compatibility with older daemons, and update the "notify"
handler to dispatch to either logging or notification based on the
boolean values.
Assisted-by: Gemini 3.8 Flash
On Headless System User Mode (HSUM) devices (e.g. Android Automotive
OS and shared tablets), user 0 is strictly a non-interactive background
system user while human users operate as secondary users (user 10+).
- Check ro.fw.mu.headless_system_user in daemon_entry and store it on
MagiskD.
- Enforce MultiuserMode::User on HSUM devices and seed the setting in
magisk.db during post-fs-data, avoiding duplicate override logic.
- For non-app UIDs (< AID_APP_START), scan all discovered users from
/data/user_de to resolve the manager package/UID and broadcast su
usage notifications across all users.
- Include system UIDs (< 10000) in PolicyDao.fetchAll() so ADB shell
(UID 2000) policies can be loaded on secondary users.
- Hide the Multiuser Mode setting in the app on HSUM devices.
Assisted-by: Gemini 3.8 Flash
Following the removal of reactive interactive su prompting in magiskd,
remove the corresponding request activity and obsolete settings from
the app.
- Remove SuRequestActivity, SuRequestScreen, SuRequestViewModel, and
SuRequestHandler.
- Remove tapjack protection, auto response, and request timeout
settings and resources.
- Update Stub.kt manifest generator to drop the unexported activity
placeholder.
- Simplify DynLoad activity mapping now that both stub and app declare
a single activity.
- Bump magisk.stubVersion to 41.
Assisted-by: Gemini 3.8 Flash
Historically, magiskd fell back to `am start` when notifying the app
if `content call` failed. With interactive su prompts removed and
SuRequestActivity slated for removal, this fallback is obsolete.
Rely exclusively on ContentProvider calls for su logging and notify
events, log content call errors directly, and remove Extra::add_intent.
Assisted-by: Gemini 3.8 Flash
With interactive su prompting removed, update MagiskAppTest to
explicitly grant su access to the ADB shell UID in the policy database
rather than relying on SuRequestActivity launch and auto-allow config.
Assisted-by: Gemini 3.8 Flash
With the ability to explicitly grant superuser access in the app,
reactive su prompting and waiting for user response via an interactive
dialog is no longer needed.
- Remove app_request and the associated FIFO / poll waiting logic.
- Change the default SuPolicy and RootSettings from Query to Deny.
- Make SuInfo immutable by removing the internal Mutex<AccessInfo>,
flattening settings into SuInfo, and refreshing with an updated
clone on cache hits.
- Remove SuAppContext and convert notification and logging logic into
private MagiskD methods.
Assisted-by: Gemini 3.8 Flash
Add a floating action button on the superuser page that opens a new
app list allowing users to proactively grant superuser privileges to
applications before they request root.
The grant screen adopts the same style and controls as the denylist
screen, including search, sorting, and system/OS filtering, while
always keeping the Shell application accessible. Common card and list
item UI components are shared with the superuser policy list.
Assisted-by: Gemini 3.8 Flash
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
Detect the architecture and file format from input bytes to apply the
proper BCJ pre-filter when compressing with XZ:
- ELF binaries: map e_machine to x86, ARM-Thumb, ARM64, or RISC-V.
- Linux kernels: detect ARM64 raw Image, RISC-V Image, and ARM32 raw
vmlinux.bin via condition-code density.
- Non-code data: omit BCJ filters to avoid degradation.
Introduce get_encoder_bcj_detection and eliminate the redundant
compress_bytes_kernel and compress_len_kernel helpers.
Assisted-by: Gemini 3.8 Flash
The hidden app compiles its dynamic APK on first launch. On API 24
this pushes package removal past the 20-second receiver timeout.
Wait up to 30 seconds while still requiring the removal broadcast.
Assisted-by: GPT-6
Replace BSD funopen with POSIX open_memstream when dumping the policy
image into memory. Also update the crt0 submodule which implements
open_memstream and fixes duplicate mmap64 definitions on 32-bit targets.
Assisted-by: Gemini 3.8 Flash
Fix compilation errors when building host binaries (such as magiskboot)
using GCC on Linux:
- Define _GNU_SOURCE in base and boot build.rs for glibc extensions.
- Add missing <cstdarg>, <cstring>, and <memory> standard headers.
- Provide a fallback definition for __printflike on glibc.
- Implement portable strscpy without relying on BSD strlcpy.
- Add unwrap_ref in bootimg.hpp to allow binding references to packed
struct members under GCC.
- Remove cxx_impl_annotations in codegen.rs to prevent always_inline
from being emitted on header declarations without function bodies.
Assisted-by: Gemini 3.8 Flash
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
Remove reliance on /proc/self/fd symlink resolution across base and core
components:
- Add top-level pre_order_walk and post_order_walk that track entry
paths via an internal buffer, and unify Directory walk methods to
support path-tracking and pathless traversals without extra overhead.
- Add DirEntry::get_stat using fstatat(AT_SYMLINK_NOFOLLOW) directly on
directory file descriptors.
- Update Directory::copy_into and link_into to operate directly on file
descriptors with fd_get_attr/fd_set_attr, passing paths only for
symlink attribute updates.
- Refactor find_apk_path and restore_tmpcon to use pre_order_walk, and
update get_app_no_list to use DirEntry::get_stat.
- Remove DirEntry::resolve_path, Directory::path_at,
Directory::resolve_path, and fd_path.
- Replace remaining consumers of xrealpath and canonical_path (in su
and magiskinit) with standard realpath or partition matching, allowing
removal of Utf8CStr::realpath and its C FFI exports.
Assisted-by: Gemini 3.8 Flash
Move utilities that are exclusively used by the daemon (core module)
from base to core:
- fork_dont_care, fork_no_orphan, new_daemon_thread, init_argv0,
set_nice_name, and switch_mnt_ns into utils.cpp
- exec_command* functions and exec_t into scripting.cpp as static
functions, as scripting is their sole consumer
Also remove the unused exec_command_sync overload.
Assisted-by: Gemini 3.8 Flash
Fix multiple D-pad focus traversal and containment defects reported on
Android TV and non-touch devices:
- Pager focus bleed: Set beyondViewportPageCount = 0 on HorizontalPager
in MainScreen and LogScreen. Constrain horizontal and upward focus
exits on pager page containers using focusProperties and focusGroup so
DPAD_RIGHT on module cards or switches does not oscillate into
adjacent offscreen tabs.
- LogScreen focus leak: Wrap log tabs in focus boundaries to prevent
DPAD_UP at the top of the logs from escaping into the Home tab.
- Module install accessibility: Wire bidirectional D-pad focus between
ShortNavigationBar (Modules tab), the root FloatingActionButton, and
the module card list using FocusRequesters. Remove redundant install
buttons from TopAppBar and EmptyState.
Fixes#10113
Assisted-by: Gemini 3.8 Flash
Enable the architecture-specific BCJ pre-filter when creating XzWriter
for supported ABIs. For ARM32 kernel compression, use the standard ARM
filter rather than Thumb-2.
Assisted-by: Gemini 3.8 Flash
Add https://github.com/tukaani-project/xz-embedded as a submodule
pinned to tag v2024-12-30, replacing previously vendored sources.
Keep customized userspace configuration in external/xz_config with
architecture-specific BCJ filters and CRC64 support.
Assisted-by: Gemini 3.8 Flash
Previously, decompress_bytes dropped the LoggedResult from decoding,
returning void. In bootimg.cpp, unpack and split_image_dtb never checked
whether decompression succeeded, leaving empty 0-byte output files and
returning RETURN_OK (0).
Return a boolean status from decompress_bytes and check it during unpack
and split_image_dtb. On decompression failure, remove any incomplete
output files and return RETURN_ERROR (1).
Assisted-by: Gemini 3.8 Flash
When locating the compressed piggy payload in a zImage, check only
formats where fmt.is_compressed() to avoid false positives on container
or header formats (such as DTB or Android boot magic).
Additionally, prioritize 4-byte aligned offsets since ARM kernel linker
scripts align .piggydata to 4 bytes, falling back to an unaligned scan
only if no candidate is found.
Assisted-by: Gemini 3.8 Flash
XZ decompressor stubs in 32-bit ARM Linux zImage (lib/decompress_unxz.c)
include the HEADER_MAGIC string literal "\3757zXZ" in .rodata, which
appears before the compressed payload. check_fmt previously matched
only the first 5 bytes, falsely identifying the .rodata string literal
as an XZ payload.
Validate the 12-byte XZ stream header by verifying the 6-byte magic,
stream flags, and IEEE 802.3 CRC32 of the stream flags. In addition,
harden GZIP, BZIP2, and LZOP checks with stricter header validation
to prevent false positives when scanning raw binaries.
Assisted-by: Gemini 3.8 Flash
Only consume pointer events when the scrollbar is visible and touch hits
the thumb, preventing edge touches from teleporting the scroll position
when the scrollbar is invisible.
In addition, compute drag fraction relative to the initial grab offset
within the thumb to prevent jump-on-grab.
Assisted-by: Gemini 3.8 Flash
Resolve scrolling, touch interception, and scrollbar layout defects
in markdown dialogs across the apk module:
- Dialog: Implement LinkClickMovementMethod to handle link taps without
intercepting drag gestures, allowing Compose to retain momentum and
fling physics.
- Dialog: Rebuild MagiskDialog with Dialog and Surface to allow
scrollable content to extend to the card boundaries, positioning the
scrollbar at the outer edge while keeping text padding intact to
prevent overlap. Support neutralButton and scrollable parameters.
- HomeScreen & ModuleScreen: Use scrollable MagiskDialog for install
and module changelog dialogs.
Assisted-by: Gemini 3.8 Flash
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
Unify FlashScreen to render TerminalScreen unconditionally for all
installation and flashing actions instead of branching on FLASH_ZIP
with a LazyColumn fallback:
- FlashScreen: Remove LazyColumn, scrollbar, and the unused action
parameter, displaying TerminalScreen inside the scaffold body.
- FlashViewModel: Forward MagiskInstaller output directly to the
terminal emulator via appendLineOnMain and remove consoleItems.
Await emulatorReady before starting flashing operations.
- FlashViewModel: Preserve transcriptText saving for FLASH_ZIP while
saving logItems (stdout and stderr) for MagiskInstaller actions.
- MainActivity: Drop action parameter from FlashScreen invocation.
Assisted-by: Gemini 3.8 Flash
Setting setFinishOnTouchOutside(false) at the Activity window level was
insufficient because SuRequestScreen hosts MagiskDialog (AlertDialog),
which defaults to dismissOnClickOutside = true. Tapping outside the
dialog triggered onDismissRequest and finished the activity.
Add dismissOnClickOutside and dismissOnBackPress parameters to
MagiskDialog (defaulting to true), and set dismissOnClickOutside = false
for SuRequestScreen to prevent accidental dismissal while keeping back
button dismissal intact.
Assisted-by: Gemini 3.8 Flash
- Invert offsetRatio accurately in LazyListState adapter using
maxOffset so scroll fraction maps 1:1 to list items and avoids jumping
upon drag release.
- Allow dragging anywhere along the track and consume pointer events on
PointerEventPass.Initial to prevent underlying views from stealing
touch input.
- Use MutatePriority.PreventUserInput to avoid drag cancellation from
inner scroll modifiers.
- Immediately snap alpha animation to 1.0 upon touch down for instant
visual feedback.
Assisted-by: Gemini 3.8 Flash
Resolve shadow and elevation clipping issues across the apk module:
- DenyListScreen: Remove redundant Modifier.clip from DenyAppCard so
elevation drop shadows can render outside the card.
- DenyListScreen & HomeScreen: Add an 8dp horizontal offset to dropdown
menus to prevent popup drop shadows clipping at the screen edge.
- SuperuserScreen, LogScreen, DenyListScreen, ModuleScreen: Move
horizontal padding from Modifier.padding to LazyColumn contentPadding
so item shadows have breathing room within the scroll container.
- ModuleScreen & MainScreen: Hoist floating action button to root
Scaffold to prevent FAB being sliced during HorizontalPager swipe
transitions.
- Dialog: Apply full systemBars insets and uniform 24dp padding to
MagiskDialog to prevent dialog shadow clipping against screen edges.
Assisted-by: Gemini 3.8 Flash
Resolve touch target and ripple effect area discrepancies across the
apk module:
- ModuleScreen: Use Card(onClick) to ensure ripple indications are
clipped to the card's 20.dp rounded corners.
- SettingsComponents: Make trailing Switch passive and apply
Modifier.toggleable on ListItem to eliminate nested ripples and
conflicting hitboxes.
- DenyListScreen: Use Modifier.toggleable on ProcessRow with a passive
Checkbox to prevent 48dp touch targets overflowing the 32dp row.
- HomeScreen: Increase developer link button spacing to 8.dp to prevent
overlapping 48x48dp touch targets.
- Scrollbar: Only consume pointer events when the scrollbar is visible
and touch hits the thumb, allowing underlying controls to receive
touches unimpeded.
Assisted-by: Gemini 3.8 Flash
- Standardize card shapes to 20.dp across all home screen cards
- Add M3 leading icons, 16.dp shape, and divider to reboot dropdown menu
- Convert support donation buttons to Material 3 FilledTonalButton
- Group App card hide/restore button and reinstall button with proper
accessibility content description
- Update section headers to labelLarge SemiBold matching Settings
Assisted-by: Gemini 3.8 Flash