- Link ota.md under the Users section in docs/README.md.
- Note in docs/ota.md that restoring the boot image is also unnecessary
for Googlebooks.
- Add a System Updates subsection under Googlebooks in docs/install.md
linking to ota.md.
Assisted-by: Gemini 4 Argon
- Add a new Googlebooks section in docs/install.md covering bootloader
unlocking, recovery image patching, USB drive creation, and booting
into recovery mode without wiping data.
- Convert step lists in Patching Images, Samsung Devices, and Custom
Recovery sections to numbered lists.
Assisted-by: Gemini 4 Argon
- Remove non-A/B OTA instructions and specify A/B-only support.
- Note that the workflow is tested on Pixel devices and that boot image
restoration is unnecessary on Pixels.
- Update the OTA installation workflow and screenshots.
Assisted-by: Gemini 4 Argon
- The back buttons of the DenyList, flash and action screens, and the
DenyList's clear search button, had no label, so TalkBack read them
as unlabeled buttons. Label them like the other screens do.
- A module's enable switch is its own accessibility node without the
module name. Name it after the module.
- The safe mode item in the reboot menu showed its state only with a
check mark. Expose it as a toggleable state.
- Navigation items and the module action and update buttons labeled
their icons with the same text as their visible label, so it was
read twice. Make those icons decorative.
Assisted-by: Claude Opus 5.5
The patch dialog restores its state after process death, including a
pending file pick, but the selected install method only lived in
InstallViewModel. If the app was killed while the file picker was open,
the new ViewModel had no method, so picking the image closed the dialog
and silently did nothing.
On Pixel and Googlebook devices, the dialog also keyed its source
choice on the downloadable firmware image. That is only found after
the firmware search, which runs again after process death, so a file
chosen before was reset to the downloadable image.
Set the patch method when an image is selected, and save the user's
source choice without keying it on the firmware image.
Assisted-by: Claude Opus 5.5
Two Home dialogs didn't restore their data with their visibility:
- The "abnormal state" dialog kept its visibility in saved state but
its exit code in plain remember. After a rotation the code was 0, so
for code 2, which needs a full reinstall, it offered the quick fix
(fix environment and reboot) instead.
- The app install dialog read the update from Info.update, which is
reset on every connectivity change, including each time the app
comes to the foreground, and after process death. It then showed
empty notes and downloaded an empty link.
Save the exit code, and keep the update shown by the Home screen in the
ViewModel and in the dialog's saved state, passing it to the download.
Assisted-by: Claude Opus 5.5
Turning on "Check for updates" didn't request the notification
permission, so on Android 13+ the update notifications could never be
shown. Instead, every creation of MainActivity, including rotations,
requested the permission when the setting was on, and turned the
setting off if it was denied, while the settings switch still showed it
as on.
Request the permission when the setting is turned on, and only enable
it when granted. Only request it on startup when the activity is first
created, and refresh the switch from the setting when the settings tab
resumes.
Assisted-by: Claude Opus 5.5
Saving the install, action or Magisk log didn't handle any error: if
creating or writing the file failed (e.g. storage full, or the media
store rejecting the file), the exception reached the default handler
and the app exited. On Android 10 and older, a module name containing
a slash also made the action log name point to a missing directory.
Save logs through a shared helper that replaces slashes in the name
and shows an error toast when saving fails.
Assisted-by: Claude Opus 5.5
Without the system's per-app language settings (before Android 13),
changing the language in the app relaunched the foreground activity by
starting it again and finishing it. MainActivity is singleTask, so the
start was delivered to the same instance, which was then finished, and
the app closed instead of showing the new language.
Recreate the activity instead, and remove relaunch(), which has no
other users.
Assisted-by: Claude Opus 5.5
Isolated processes are matched by name prefix, and the DenyList now
adds a single "isolated|<process>:" entry per app. Older versions of
the app added one entry per isolated service instead, e.g.
"isolated|com.foo:com.foo.Service". The screen shows the isolated row
as checked if any entry starts with the prefix, but unchecking it only
removed the exact prefix entry, so the old entries stayed and the row
was checked again on the next visit.
When removing an isolated row, remove every isolated entry starting
with its prefix.
Assisted-by: Claude Opus 5.5
Each tap on the grant screen started its own database write on the IO
dispatcher, with nothing ordering them. A grant takes two queries
(fetch, then replace) while a revoke takes one, so a quick grant and
revoke could run as fetch, delete, replace and leave the app granted
while it was shown as not granted. The new state was also computed from
the item the UI captured, so two taps before a recomposition both
granted.
Write in tap order under a Mutex, like SuperuserViewModel does, and
toggle the current state of the app.
Assisted-by: Claude Opus 5.5
The superuser, log and module lists are refreshed whenever their tab is
shown, when returning to the main screen, after configuration changes,
and on other events (the module list on every activity start, the logs
on every superuser request). Each refresh set the loading flag, which
replaced the list with a spinner, so the list lost its scroll position
and expanded cards collapsed. Module update buttons also disappeared
until update info was fetched again. The DenyList even scanned every
installed app again on rotation.
Only show the loading state until the first load finishes, keep update
info of unchanged modules across refreshes, and scan apps for the
DenyList only once per screen.
Assisted-by: Claude Opus 5.5
Every script running in the context of Magisk is supposed to run in
BusyBox ash with standalone mode. Since module actions and installs run
in a PTY, they ran in /system/bin/sh instead: busybox script starts
$SHELL, which su sets to /system/bin/sh, and ASH_STANDALONE was never
set. Module installers recover by re-executing themselves in BusyBox,
but action.sh has no such fallback.
Run the PTY command in BusyBox ash with ASH_STANDALONE=1, which has to
be set before ash starts. Also run the action from the module's
directory name, quoted, rather than from the id in module.prop, which
can differ from it.
Assisted-by: Claude Opus 5.5
MagiskInstaller.exec() only cleared its static session flag after the
operation returned normally. When the calling coroutine was cancelled,
withContext() threw once the blocking operation finished and the flag
stayed set, so every later install, patch, uninstall, restore or
environment fix failed immediately until the app process died.
Restore images and Fix environment ran in a composition scope through
rememberLoadingDialog(), so this happened just by rotating while their
loading dialog was showing, which also lost the result toast and the
reboot after fixing the environment. Leaving a running flash screen
triggered it too.
Release the flag in a finally block, and run both operations in
HomeViewModel, which survives configuration changes. Remove
rememberLoadingDialog(), which has no other users.
Assisted-by: Claude Opus 5.5
Modules are third-party, but some of their metadata could crash the
app:
- A malformed updateJson URL (e.g. ftp://) made Retrofit throw
IllegalArgumentException, which LocalModule.fetch() didn't catch, so
the app exited every time the module list loaded, even offline. A
malformed changelog URL did the same when opening the update dialog.
- Two module directories with the same id in module.prop crashed the
module list, which used the id as the item key.
Catch every non-cancellation exception when fetching update info and
changelogs, and identify modules by their directory name, which is
unique.
Assisted-by: Claude Opus 5.5
The module zip's display name and path were pasted into the root shell
command that runs the installer, inside single quotes. The display name
comes from the content provider, which belongs to another app for
external install requests. A name with an apostrophe broke the install,
and a crafted name could run arbitrary commands as root.
Print the header line directly to the terminal instead of with echo,
without control characters, and quote the paths with a new
shellQuoted() helper, which also replaces the manual escaping in
runSuCommand.
Assisted-by: Claude Opus 5.5
Module installs and actions run in a PTY through busybox script, which
always exits with 0. The exit code of the command itself was lost, so
a failed module install or action was shown as done, with a reboot
button.
Run the command in a subshell and have it write its exit code to a
temporary file, then read it after the process exits.
Assisted-by: Claude Opus 5.5
MainActivity is singleTask, so an intent sent while the app is running
is delivered to onNewIntent(). The requested tab was only read from the
launch intent, so e.g. the "App settings" button in the system settings
brought the app to the front without opening the Settings tab.
Also read the requested tab from new intents and switch to it. If
another screen is open, it stays open and the tab is shown when going
back, so no running flash or action screen is interrupted.
Assisted-by: Claude Opus 5.5
The back stack survives process death, but a flash or action screen's
ViewModel doesn't. When such a screen was restored, its new ViewModel
had no job yet, so the job started again without the user asking: a
Magisk install, a module zip, an uninstall, or a module's action
script, which may not be safe to repeat.
Record in the ViewModel's SavedStateHandle that the job was started.
If a restored screen finds the flag in a new ViewModel, its job and
output are gone, so leave the screen instead of running the job again.
Assisted-by: Claude Opus 5.5
ViewModels requested navigation through a SharedFlow without replay, so
a request was silently dropped when no screen was collecting it. This
happens when an activity result arrives right after the activity was
recreated: the launcher delivers it before the screen's collector has
started. E.g. after a configuration change while picking an image to
patch, the patch dialog closed but the patching screen never opened.
Use a buffered Channel instead, so requests wait for the collector.
Assisted-by: Claude Opus 5.5
Clicks that open a screen were handled even while a screen transition
was running, so a quick second tap could push another screen on top of
the one being opened, e.g. an app's details and then the grant screen.
Wrap these clicks in dropUnlessResumed, as the Navigation 3 recipes do.
NavDisplay caps each scene's lifecycle at STARTED until its transition
settles, so taps during the animation are dropped.
Assisted-by: Claude Opus 5.5
Navigator.push() accepted any route, so a double tap (e.g. on an app in
the Superuser list) or the same flash request confirmed twice pushed
the same route twice. Navigation 3 gives equal routes the same content
key, so both copies shared one ViewModel and saved state: a second
identical flash request just showed the first one's result, and two
back presses were needed to leave.
Ignore a push of the route that is already on top. Making routes unique
instead would let a double tap start two installs at once.
Assisted-by: Claude Opus 5.5
A screen's back button stays clickable while the screen slides out, so
tapping it twice quickly called Navigator.pop() twice. The second call
removed Route.Main, and NavDisplay crashed the app because its back
stack must not be empty.
Make pop() a no-op on the root entry. Leaving the app from the root is
handled by the system, not by popping the last entry.
Assisted-by: Claude Opus 5.5
In navigation bar mode, NavigationSuiteScaffold places the primary
action at the end edge of the window with a fixed 16dp margin and
ignores window insets. In landscape with 3-button navigation, the FAB
on the Modules and Superuser tabs overlapped the side navigation bar.
Pad the primary action slot with the end side of the safe drawing
insets in bar mode, so the FAB stays clear of side system bars and
display cutouts. Portrait and navigation rail layouts are unchanged.
Assisted-by: Claude Opus 5.5
The terminal emulator lives in the ViewModel and survives Activity
recreation, but a recreated TerminalScreen draws its first frame
before LaunchedEffect resizes the emulator to the new viewport.
Nothing invalidated the drawing after the resize, so after rotating,
the screen kept showing rows laid out for the old geometry instead of
the end of the output, and the scrollbars used stale values.
Refresh the snapshot state and redraw after every resize, through the
same path used for new output, and keep a scrolled-up position within
the transcript.
Assisted-by: Claude Opus 5.5
Configure NavDisplay with standard horizontal slide transitions for
forward, pop, and predictive back navigation, following the layout
direction, and wrap the root content in a Surface to prevent window
background bleed.
Assisted-by: Gemini 4 Argon
Assisted-by: Claude Opus 5.5
Eliminate recomposition bottlenecks in TerminalScreen by invalidating
strictly inside the draw phase via drawBehind, decoupling the
TerminalEmulator lifecycle to ViewModels, and replacing Handler with
Coroutines Dispatchers.Main.immediate in TerminalProcess. Commands still
start only after the terminal has been sized to its viewport.
Stabilize Compose data models (PolicyItem, AppProcessInfo, ProcessInfo,
SuGrantAppInfo, SuGrantAppState) as @Immutable data classes with
read-only val properties, decoupling Android Drawable dependencies into
an on-demand async AppIcon component.
Drop the remain field from SuPolicy as timed grants no longer exist, and
always write until=0. This lets SuperuserViewModel rebuild policies from
the immutable PolicyItem without persisting an expired row. Apply policy
edits to the UI state first and persist them in order, so quick
consecutive toggles cannot overwrite each other and reloads or deletes
cannot interleave with them. Remove the MagiskDB.Literal helper, which
no longer has any users.
Implement dynamic adaptive bottom padding in SuperuserScreen and
ModuleScreen according to FAB positioning (isFabAtBottom),
deduplicate sort and filter controls into AppSortFilterActions,
modernize storage permission handling using ActivityResultContracts,
and replace BaseViewModel.showSnackbar with showToast. Keep the delayed
reboot after fixing the environment from being cancelled when leaving
HomeScreen.
Assisted-by: Gemini 4 Argon
Assisted-by: Claude Opus 5.5
Refactor SettingsScreen and SettingsViewModel to adhere to modern
Unidirectional Data Flow (UDF) patterns. Hoist all preference
settings, environment visibility flags, and modal dialog states into an
immutable SettingsUiState collected via collectAsStateWithLifecycle.
Decompose SettingsScreen into a pure stateless SettingsContent
composable with configuration-resilient, validated dialogs.
Keep localized strings out of SettingsUiState and resolve them during
composition, so they follow per-app locale changes even though the
ViewModel outlives the recreated Activity. Refresh device security and
environment flags whenever the screen resumes.
Eliminate Activity memory leaks caused by passing ActivityExtension
lambdas into retained ViewModels. Introduce rememberBiometricAuth
scoped to Composable lifecycles using rememberLauncherForActivityResult
with RequestAuthentication contract. Remove authenticate callback
properties from SettingsViewModel, SuperuserViewModel, and
SuperuserGrantViewModel, and invoke biometric authentication at
call-time in the UI layer.
Assisted-by: Gemini 4 Argon
Assisted-by: Claude Opus 5.5
Refactor Navigator to wrap NavBackStack<NavKey> with Parcelable
listSaver and multi-key support, and remove dead @Serializable
annotations and imports from Routes.kt.
Implement hierarchical tab back navigation in MainScreen to animate
scroll to Tab.HOME before bubbling to root exit, only while Route.Main
is the current destination. Scope child pager pages in MainScreen and
LogScreen with
rememberNavigationEventDispatcherOwner(enabled = isCurrentPage) to
prevent inactive offscreen tabs from intercepting navigation events.
Add NavigationBackHandler and exit confirmation dialogs to FlashScreen
and ActionScreen during active execution, and guard TopAppBar back
navigation buttons while operations are in progress.
Add NavigationBackHandler and TopAppBar back interception to
DenyListScreen and SuperuserGrantScreen to collapse active search
queries before exiting the screen.
Assisted-by: Gemini 4 Argon
Assisted-by: Claude Opus 5.5
Enable edge-to-edge window fitting in MainActivity before
super.onCreate() and disable navigation bar contrast enforcement on
API 29+. Declare adjustResize soft input mode in AndroidManifest.xml
and remove deprecated runtime setSoftInputMode.
Derive system bar appearance from the app's color mode instead of the
system night mode by passing a custom detectDarkMode to
enableEdgeToEdge. Re-apply it from MagiskTheme whenever the resolved
theme changes, replacing the unkeyed SideEffect that only updated the
icon colors and left the API < 29 and API 35+ scrims mismatched.
Support full IME and system bar insets in MagiskDialog and
InstallDialog using safeDrawing insets and decorFitsSystemWindows, and
make the custom update channel and download path dialogs in
SettingsScreen scrollable so their text fields stay reachable above
the keyboard.
Pass Scaffold innerPadding to contentPadding or post-scroll padding in
HomeScreen, SettingsScreen, ModuleScreen, SuperuserScreen, and
LogScreen so scrollable content draws behind transparent system bars
edge-to-edge without clipping. Keep the start/end insets as regular
padding so content stays clear of side navigation bars in landscape.
Assisted-by: Gemini 4 Argon
Assisted-by: Claude Opus 5.5
Harden external intent handling in MainActivity: only accept module
installation, and drop any other action, including uninstallation.
Require explicit user confirmation before flashing, unless the intent
carries the per-process token attached to our own one-shot module
download intents, which the user already chose to install. Hide
overlay windows while the confirmation is shown. Look up the file name
from the external provider with a timeout, and sanitize it and the
provider authority shown in the confirmation. Avoid external intent
indirection in HomeScreen when triggering uninstallation.
Restore callback-based confirm dialogs together with their content
after configuration changes. Dialogs awaited by a coroutine are not
restored, as nothing would receive their result.
Register dynamic USB receivers in InstallDialog as not exported via
registerRuntimeReceiver (RECEIVER_NOT_EXPORTED, enforced on API 33+).
Enable android:enableOnBackInvokedCallback in core manifest to support
predictive back gestures. Fix MagiskDialog modifier parameter ordering
to adhere to Compose lint rules.
Remove the obsolete release manifest and redundant R8 configuration in
core and apk modules: the Parcelable CREATOR and Continuation keep
rules and -allowaccessmodification are covered by
proguard-android-optimize.txt and library consumer rules, and
-shrinkunusedprotofields has no effect with Wire.
Assisted-by: Gemini 4 Argon
Assisted-by: Claude Opus 5.5
- Expose MagiskD::get_app_id via CXX bridge and reuse it in denylist
instead of duplicating user collection and package UID lookup in C++.
- Remove redundant manager package name returns, Status enum, and the
ManagerInfo wrapper struct now that the package name is fixed.
Assisted-by: Gemini 4 Argon
Normalize system and shared-UID (< 10000) processes to their app ID
when evaluating su policies and uid_granted_root so policies stored by
PolicyDao.normalizeUid match across non-zero users on HSUM devices.
- Normalize eval_uid in build_su_info and uid in uid_granted_root when
app_id < AID_APP_START.
- Ensure SECURE_DIR exists before writing settings in boot_complete(),
seed SuMultiuserMode on HSUM, and check isHeadlessSystemUser in
Info.showSuperUser.
- Normalize UID comparisons in PackageManager.getPackageInfo(uid, pid).
- Simplify ManagerInfo to track a single TrackedFile instead of a
per-user BTreeMap.
- Skip negative parse_int results in deny collect_users.
Assisted-by: Gemini 4 Argon
Consolidate ProviderInstaller and APKInstall into :core under matching
packages (com.topjohnwu.magisk and com.topjohnwu.magisk.utils).
- Move ProviderInstaller.java and APKInstall.java to :core
- Delete app/shared/ module and its build configuration
- Merge permissions and application attributes into :core manifest
- Remove :shared project dependency from :core build.gradle.kts
- Update app/settings.gradle.kts to only include :apk, :core, :test
- Update magisk-app skill documentation to remove obsolete references
Assisted-by: Gemini 4 Argon
Remove the :stub Android application module, its build-logic task
integration, build.py stub building commands, and leftover stub hooks
in :core.
- Delete app/stub/ and its 60 tracked files (activity, networking,
and localized string resources)
- Remove :stub from app/settings.gradle.kts
- Remove stubTask and stub.apk syncing in Setup.kt
- Remove build_stub, stub subparser, and stub APK copying in build.py
- Simplify RootUtils by removing unused stub parameter and constructor
- Remove unused -keep rule for App constructor in proguard-rules.pro
- Update README.MD to remove stub string references
Assisted-by: Gemini 4 Argon
Move permissions, requestLegacyExternalStorage, and the debug
usesCleartextTraffic manifest from :shared into :core so the stub APK
only retains permissions required for downloading and installing the
full Magisk APK.
Assisted-by: Gemini 4 Argon
Remove support for custom/repackaged manager package names
(su_manager / repackaged_pkg) and secondary certificate verification
(repackaged_cert) from the native daemon and database.
- Remove SuManager from DbEntryKey in CXX bridge and db.rs.
- Remove unused get_db_string and rm_db_string methods from MagiskD.
- Delete check_dyn and check_stub in package.rs.
- Remove repackaged_* fields from ManagerInfo and derive Default.
- Simplify find_apk_path, get_package_uid, and get_manager to target
APP_PACKAGE_NAME and verify against TRUSTED_CERT.
- Bump SQLite DB_VERSION to 13, drop strings table on migration, and
remove create_strings from new database initialization.
- Remove obsolete hidden/stub app sections from FAQ documentation.
Assisted-by: Gemini 4 Argon
Remove dynamic APK class and resource loading across :app, :shared,
and :stub. Consolidate stub resources into :stub and remove stub
obfuscation and encryption.
- Merge :stub-res into :stub and delete the :stub-res module.
- Delete DynLoad, DelegateComponentFactory, ClassLoaders,
StubApplication, StubRootService, and dummy component classes.
- Delete StubApk, DynamicClassLoader, and CompoundEnumeration from
:shared.
- Remove lsparanoid, stub component randomization, resource
encryption, and Stub.kt from build-logic.
- Remove stubVersion and STUB_VERSION tracking.
- Simplify DownloadActivity to use direct resources and APKInstall.
- Remove isRunningAsStub and stub-specific hooks across :core.
Assisted-by: Gemini 4 Argon