Remove the outdated patch_file_msg string resource across all locales
and add a top-level patch_image_msg description in PatchComposableDialog
explaining all supported input formats and their expected outputs.
Render the formatted description with bold spans, hanging-indent bullet
rows, a divider, and improved spacing for the radio group and URL input
field.
Assisted-by: Gemini 4 Argon
Merge "Select and patch a file" and "Download and patch a file" into a
single "Patch firmware / image" flow that lets users choose between an
app-provided firmware suggestion, a local file, or an HTTPS URL.
On Googlebooks, allow streaming the patched recovery GPT image directly
to a connected USB flash drive via Android's USB Host Bulk-Only
Transport and SCSI block commands in UsbBlockDevice, avoiding writing
the multi-gigabyte image to internal storage or needing another PC.
Assisted-by: Gemini 4 Argon
With reactive su request prompts removed and superuser permissions
granted explicitly ahead of time in the app, the legacy 4-way superuser
access mode (Disabled, Apps only, ADB only, Apps & ADB) and pre-O
reauthentication after upgrade settings are no longer applicable.
ADB shell (com.android.shell) is now an explicit policy entry managed
directly in the Superuser tab, making global access filters redundant
and prone to conflicting state. Furthermore, revoking policy on package
upgrade without reactive prompting silently breaks root for upgraded
apps.
- Remove RootAccess enum and root_access checks from magiskd.
- Remove su access mode and reauthenticate settings from Manager app.
- Drop ACTION_PACKAGE_REPLACED from Receiver and manifests.
- Purge obsolete string resources across all translations.
Assisted-by: Gemini 3.8 Flash
Wrap PatchFileClassifier.openStream() in ProgressInputStream via
openProgressStream() in MagiskInstallImpl to emit real-time transfer
progress and EMA-smoothed speed during Tar and RecoveryGpt processing.
Also update OtaPayloadExtractor to emit operation download progress
in-place.
Render console lines starting with '\r' in-place in TerminalEmulator
using ANSI erase-in-line ("\r\u001b[2K") and exclude them from saved
logItems in FlashViewModel.
Also fix single-byte read recursion and track skipped bytes in
ProgressInputStream.
Assisted-by: Gemini 3.8 Flash
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
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
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