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
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
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
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
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
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
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
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
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.