WindowWidthSizeClass is deprecated in window-core 1.5. Check the
width breakpoints with WindowSizeClass.isWidthAtLeastBreakpoint()
instead. The adaptive library only buckets widths at 600 and 840dp,
so the expanded and compact checks behave exactly as before.
The API is only available since window-core 1.4, while adaptive
1.1.0 puts 1.3.0 on the compile classpath. Depend on window-core
1.5.0 explicitly, the version already resolved at runtime, so the
packaged dependencies do not change.
Assisted-by: Claude Opus 5.5
The install dialog always covered the whole window. Full screen
dialogs are meant for compact windows only; on a desktop window it
turned a short list of options into a huge empty page. Keep it full
screen on compact windows, and show it as a regular sized dialog with
rounded corners and the dialog surface color everywhere else.
Assisted-by: Claude Opus 5.5
Home and Settings are columns of cards, which became very wide and
sparse on large windows. Add a small AdaptiveColumns helper that
splits the content into two equal columns on expanded width windows,
capped in width and centered, and falls back to the existing single
column otherwise. Settings wraps each title and card pair so they
stay together, and moves the App section to the second column when
the root-only sections are hidden.
The Superuser detail page only has a few rows, so cap its width and
center it instead of splitting it.
Assisted-by: Claude Opus 5.5
The DenyList and Grant Superuser screens listed every app as a card
spanning the whole window, and the search field stretched across it
too. Show the apps in adaptive grids instead (staggered for DenyList,
whose cards expand to show processes), and cap the search field at
the Material search bar maximum width. Phones still get one column.
Assisted-by: Claude Opus 5.5
On wide windows the Superuser, Modules and Superuser log lists were a
single column of cards stretched across the whole window. Turn them
into lazy grids with adaptive columns: one column on phones, more as
the window gets wider. Modules use a staggered grid since its cards
expand, with a larger minimum width for the action buttons row. The
spacer items move into content padding so phones look the same.
The Magisk log is read from top to bottom, so it stays a single
column, but its cards and the log tab row are capped to a readable
width and centered.
Assisted-by: Claude Opus 5.5
The bottom navigation bar was used at every window size, which wastes
vertical space and looks out of place on wide windows such as desktop
and unfolded foldables.
Switch MainScreen to NavigationSuiteScaffold, which shows the same
bottom bar on compact windows and a navigation rail on medium and
wider windows. With a rail, the FAB moves into the rail header; its
slot is kept even when the FAB is hidden so the rail items don't jump
when switching tabs. The pager no longer swipes between tabs in rail
mode, and the custom FAB/bottom bar focus wiring only applies to the
bar layout, leaving default 2D focus search for the rail.
Assisted-by: Claude Opus 5.5
The scrollbar only had adapters for ScrollState and LazyListState, so
lazy grids could not use it. Replace the LazyListState adapter, which
estimated sizes from the visible items, with one generic adapter built
on ScrollableState.scrollIndicatorState. Lazy lists, grids and
staggered grids all provide it, so existing lists keep working and
grids can be adopted without extra code.
Assisted-by: Claude Opus 5.5
Add PixelProvider in FirmwareCrawler to crawl and suggest official
factory images for Google Pixel devices.
Fetch factory images from developers.google.com/android/images via
NetworkService with DevSite's terms acknowledgment cookie, parse the
target device table, and suggest the latest factory image (or matching
Build.ID) as candidate download in the install flow.
Add unit tests in AppTest verifying device matching, build ID
selection, Nexus device filtering, and unknown device rejection.
Assisted-by: Gemini 3.8 Flash
Add FirmwareCrawler in app:core to provide an extensible API for
crawling and suggesting firmware candidate download URLs in the
install flow.
Implement GooglebookProvider to query production_recovery.json via
NetworkService, filtering by matching Build.DEVICE or Build.MODEL to
suggest the latest official recovery image on supported devices.
Refactor InstallViewModel and InstallDialog to use the generic
FirmwareCrawler API without hardcoding device-specific logic,
presenting candidate suggestions alongside custom URL input.
Assisted-by: Gemini 3.8 Flash
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
Toggling or granting superuser privileges within the Magisk app (such
as in SuperuserViewModel or SuperuserGrantViewModel) displayed a toast
message confirming the grant or denial.
Because the user is already interacting directly with the UI where the
state is visible, these toast messages are redundant. Toast messages
should only be displayed when a process actually requests superuser
access via the su daemon.
Remove the toast notifications shown during in-app superuser policy
changes.
Assisted-by: Gemini 3.8 Flash
On Android 14+ (including Aluminium OS on Googlebooks), trackpad
two-finger scroll gestures are dispatched as MotionEvents with
CLASSIFICATION_TWO_FINGER_SWIPE. Compose UI 1.12 translates these into
PanMove pointer events with panOffset.
However, compose-foundation was not explicitly declared and was resolved
transitively to 1.10.0 via compose-material3. In foundation 1.10.0,
TrackpadScrollingLogic did not exist yet, causing two-finger swipe
gestures to be dropped and leaving scrollable views unresponsive.
Add explicit compose-foundation and compose-animation dependencies
aligned with compose-ui (1.12.1) so all core Compose modules stay in
sync and trackpad scrolling is handled properly.
Assisted-by: Gemini 3.8 Flash
Add ZipChannel, a zip archive backed by a DataChannel. open() returns
a random access DataChannel of STORED entries, and openStream()
returns a sequential stream of STORED or DEFLATED entries.
Add PatchFileClassifier to inspect the format of input files and
locate the payload to patch: RawFile, BootZip, PayloadBin, or Tar.
Zip archives are inspected with ZipChannel, and nested zips such as
the inner image zip of factory images are transparently inspected
instead. The payload is accessed as either a DataChannel or a
decompressed InputStream based on its type.
MagiskInstaller now relies on PatchFileClassifier to process inputs.
WholeFilePatcher now accepts an InputStream, as whole file formats
are always processed sequentially. ZipExtractor is removed as it is
fully superseded.
Add unit tests for ZipChannel with in-memory zips, and update
existing tests to go through PatchFileClassifier.
Assisted-by: Claude Opus 5.5
Add testTarProcessor in AppTest to test streaming and extracting
Samsung AP tar firmware packages via DataChannel.Http.
Also update DataChannel.Http to probe using standard prefix byte
ranges instead of suffix byte ranges, avoiding 501 Unsupported
client range errors on servers and CDNs such as Azure Blob and
Varnish used by GitHub Releases.
Assisted-by: Gemini 3.8 Flash
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
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
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
Define WholeFilePatcher and ImageExtractor interfaces for whole-file
patching and single-image extraction pipelines.
Have TarProcessor implement WholeFilePatcher, and OtaPayloadExtractor
and ZipExtractor implement ImageExtractor. In MagiskInstallImpl,
streamline terminology by renaming srcBoot to targetImage, useRootDir
to useRootFs, and processArchive to processWholeFile.
Assisted-by: Gemini 3.8 Flash
processFile handled two different jobs in one function, sharing
variables and try/catch blocks: patching a tar archive into a new tar,
and extracting a boot image into a patched .img. It also opened the
input twice, as a stream for detection and as a channel for the
extractors. processUrl separately repeated a zip-only copy of the
image path.
Open the input once as a DataChannel: DataChannel.File for a URI and
DataChannel.Http for a URL. Everything after that is one pipeline:
processInput reads the header with a positional read and dispatches to
processArchive (tar in, tar out) or extractAndProcessImage (payload,
zip or raw image in, image out). As a result, URLs now accept every
format that files do.
Additionally:
- Rename DataChannel.sliceStream to stream, and add a zero-arg
stream() that covers the entire channel.
- Make TarProcessor.consume take a DataChannel and close it, matching
the extractors.
- Close the input ParcelFileDescriptor instead of leaking it.
- Report output file creation failures on the URL path instead of
crashing.
Assisted-by: Claude Opus 5.5
Tar firmware handling (e.g. Samsung AP tars) was entangled with
MagiskInstallImpl: BootItem and processTar lived in the installer, and
processFile set up the TarArchiveOutputStream, used a nullable
BootItem as the tar flag, and reassigned its file to new-boot.img.
Move all tar logic into a standalone TarProcessor next to
OtaPayloadExtractor and ZipExtractor. Since the output tar has to stay
open while the installer patches the image, it uses a two-phase API:
consume() extracts the boot images, copies all other entries to the
output tar, and returns the image to patch; finish() writes the
patched image and finalizes the archive. The caller still owns and
closes both raw streams, and MagiskInstallImpl no longer references
any tar types.
Additionally:
- Pass through vbmeta.img smaller than 256 bytes unpatched instead of
looping forever, as the loop continued without advancing the entry.
- Close the output stream when patching fails instead of leaking it,
ignoring close errors so that they cannot crash the app.
Assisted-by: Claude Opus 5.5
Refactor DataSourceChannel into an abstract DataChannel with nested
DataChannel.File and DataChannel.Http implementations, separating
local file and remote HTTP stream backends.
Additionally:
- Rename Payload to OtaPayloadExtractor and ExtractImage to
ZipExtractor to better reflect their responsibilities.
- Standardize both extractors with a uniform constructor and a
consume(channel: DataChannel) method that handles channel lifecycle.
- Make OtaPayloadExtractor stateless by passing channel, manifest,
and data offsets directly through method arguments.
Assisted-by: Gemini 3.8 Flash
The usage blocks in docs/tools.md had drifted behind the actual CLI
output of the tools:
- su: add -d/--drop-cap (added in ff18cb8, missing from docs since 2023)
- resetprop: document wait mode (-w, NAME/OLD_VALUE), --compact,
-P, -Z and the mode-based flag semantics; the old block predated
the wait-mode rewrite entirely
- magiskboot unpack: document the 3:vendor_boot return value
(RETURN_VENDOR in bootimg.cpp)
- magiskboot split: document the -n flag (skip decompression)
- magiskboot cpio: document ls [-r] [PATH], fix test return values
to 0:stock/1:Magisk/2:unsupported (test returns on first match,
the old 'bitwise or-ed' wording was misleading), document the -n
flag of backup ORIG
All blocks now match the usage strings shipped in the binaries
(su.cpp, resetprop/cli.rs, boot/cli.rs, boot/cpio.rs).
SQLite returns a null pointer for SQL NULL. Passing it to rust::Str
crashes the daemon when a query result contains a NULL column.
Return an empty Rust string for NULL while leaving the raw C++ getter
unchanged, so callers that distinguish NULL can keep doing so.
Fixes: #10131
Assisted-by: GPT-6
Updated informal language usage in strings, added strings missed in a previous commit, also added new strings corresponding to this commits ccad207125 and f093f847bb.
Change-Id: I0505127da4e420a94328cca8fd0fbf71be68ae13
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