Commit Graph
100 Commits
Author SHA1 Message Date
topjohnwu 5f2faee618 native: Remove custom package and cert validation
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
2026-10-22 14:06:48 -07:00
topjohnwu 7d9b0dfb3e app: Remove dynamic code loading and simplify stub
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
2026-10-22 14:06:48 -07:00
topjohnwu 1240c2e35c app: Remove app repackaging and signing
Remove app hiding repackaging, key generation, AXML patching, and
in-app APK signing components along with BouncyCastle (bcpkix).

- Delete AppMigration, Keygen, AXML, and signing package classes.
- Remove bcpkix dependency and build-logic packaging exclude.
- Remove suManager, keyStoreRaw, StringDao, and strings DB table.
- Simplify DownloadProcessor app update and SplashScreen init.
- Remove AppMigrationTest, setupAppHide/Restore, and test scripts
  references to repackaged test packages.
- Remove unused hide_app_title string across all locales.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu 5847745840 app: Remove app hiding UI
Remove the ability to hide or restore the Magisk app from the
application UI in preparation for completely removing the app hiding
and stub repackaging feature.

- Remove hide and restore dialogs, ViewModel actions, and the
  hide/restore toggle IconButton from HomeScreen.
- Remove the stub home screen shortcut item from SettingsScreen and
  associated action in SettingsViewModel.
- Remove shortcut prompt and invalid non-root stub restore dialogs
  from MainActivity.
- Remove addHomeIcon() from Shortcuts and ASKED_HOME preference from
  Config.
- Remove 13 unused localized string resources across all 52 locale
  strings.xml files.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu ea16c8141e Fix package management and user targeting on HSUM
- Use --user current for pm install, adb install, and appops set across
  install_script, adb_pm_install, and test/setup scripts.
- Skip headless user 0 in get_users() on HSUM devices.
- Use --user current in app_notify for non-app UIDs instead of calling
  content call against all users.
- Clear path buffer on each iteration in setup_magisk_env.
- Use --user current for am instrument in app migration tests.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu c275a4ea30 Embed trusted certificate in flags.rs
- Extract the signing certificate from keyStore via keytool in
  dump_flags_native() and emit TRUSTED_CERT in flags.rs (or an empty
  slice when keyStore is not configured).
- Replace dynamic certificate extraction from stub.apk in
  preserve_stub_apk() with the static TRUSTED_CERT constant.
- Move get_package_uid() out of MagiskD into a standalone function.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu b43a08fdde Bump minSdk to 24 and drop API 23 workarounds
- Bump minSdk to 24 in Setup.kt, APP_PLATFORM to android-24 in
  Application.mk, and update CI AVD matrices and scripts.
- Unify SePatchStrategy::Legacy with SePatchStrategy::SelinuxFs in
  magiskinit to use MOCK_ENFORCE FIFO blocking and remove MOCK_REQPROT.
- Make APP_DATA_DIR a compile-time "/data/user_de" constant and remove
  pre-API 24 /data/user and /data/adb fallbacks.
- Remove Android 6.0 Samsung forkAndSpecialize JNI hook signature.
- Remove pre-API 24 device-protected storage wrappers, Api23Impl in
  LocaleSetting, AndroidManifest.xml stub resource workaround, and
  ServiceCompat/ProcessCompat/InlinedApi workarounds in the app.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu af8c2566b0 Update documentation to use samloader-rs 2026-10-16 14:00:19 +00:00
topjohnwu 2762a0ebf2 app: track both read and write progress
Add ProgressOutputStream and wrap both the raw input stream and output
stream in runWholeFilePatcher so read and write progress and speeds are
tracked independently.

Render read and write progress on two in-place lines in the terminal to
fit narrow screens, and support multi-line in-place updates in
appendLineOnMain using ANSI cursor movement and erase-in-display.

Assisted-by: Gemini 4 Argon
2026-10-15 00:33:42 +02:00
topjohnwu 248195c975 app: track raw stream in openProgressStream
Wrap the underlying raw source stream in ProgressInputStream before
decompression and compare against rawSize (entry.compressedSize for
DEFLATED zip entries) so that progress percentages and transfer speeds
reflect actual I/O instead of skewed decompressed output on sparse
images.

Also remove the redundant InflaterInputStream.close() override in
ZipChannel since Android's libcore unconditionally ends the Inflater
on close().

Assisted-by: Gemini 4 Argon
2026-10-14 23:44:30 +02:00
topjohnwu 2168e71f14 app: describe supported formats in patch dialog
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
2026-10-14 23:44:30 +02:00
topjohnwu 25df423252 app: unify image patching and support USB output
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
2026-10-14 23:44:30 +02:00
topjohnwu 476794f5f6 Update magisk-app skill regarding string resource updates 2026-10-14 23:44:30 +02:00
topjohnwu 1629d44714 app: hide Superuser log tab without root access
Omit PrimaryTabRow and SuLogTab in LogScreen when Info.env.isActive is
false, rendering MagiskLogTab directly below TopAppBar and skipping
SuLog database queries in LogViewModel.

Assisted-by: Gemini 4 Argon
2026-10-14 01:12:03 +02:00
topjohnwu 9a47544da0 app: fix truncated text in SuLogCard header
Replace the 3-column ListItem in SuLogCard with a Row and Column
layout that places the action badge alongside the app name and gives
the UID/PID and timestamp lines the full header width without single-
line truncation.

Assisted-by: Gemini 4 Argon
2026-10-13 23:06:06 +02:00
topjohnwu e8915d9db1 su: remove obsolete access and reauth settings
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
2026-10-09 09:37:15 -07:00
topjohnwu a77198ea60 su: do not notify app when UID has no policy
With reactive su prompting removed, root requests from UIDs without
an existing policy in the database are rejected immediately. Previously,
RootSettings defaulted log and notify to true, causing the daemon to
notify the manager app whenever an unconfigured UID attempted to run
su.

Derive Default for RootSettings so that policy defaults to Deny with
log and notify initialized to false, preventing unwanted notifications
to the app when no database policy exists. Also simplify SuInfo::allow
and SuInfo::deny to leverage Default.

Assisted-by: Gemini 3.8 Flash
2026-10-09 07:16:48 +00:00
topjohnwu 79bf48d768 app: show in-place progress during image patching
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
2026-10-09 06:22:04 +00:00
topjohnwu b268b361f0 More HSUM fixes 2026-10-09 03:51:34 +00:00
topjohnwu 1445d83a3a Make recovery image patching show progress in UI 2026-10-08 17:56:22 +00:00
topjohnwu d033e43151 app: jump on long scrollbar drags
Dragging the scrollbar thumb of a lazy list or grid scrolled by the
dragged distance, and a large scrollBy composes and measures every
item in between. On the Magisk log, fast thumb drags froze the UI
for up to several seconds per frame.

When the target is more than a viewport away, jump to the matching
item index with scrollToItem() instead; shorter moves still scroll
by pixels so slow drags stay smooth.

Assisted-by: Claude Opus 5.5
2026-10-08 10:35:49 -07:00
topjohnwu b9d7d6f2d1 app: keep dpad focus in content on rail
With a navigation rail there is nothing below the page, yet pressing
DPAD_DOWN on the last focusable item let the 2D focus search leave
the page and land on a rail item to the side. Cancel downward exits
from the page in rail mode; moving to the rail is still possible
with DPAD_LEFT. The bottom bar keeps its existing focus handling.

Assisted-by: Claude Opus 5.5
2026-10-08 10:35:49 -07:00
topjohnwu a271b9559e app: use bar when navigation rail does not fit
The navigation suite switches to a rail once the window is at least
480dp tall, but the collapsed rail with the FAB header needs about
476dp of its own height for all five destinations plus the 44dp
bottom space. In short freeform windows on desktop the last rail
item was clipped by the window edge.

The rail cannot scroll and its spacing is fixed, so fall back to the
short navigation bar when the height left for the rail after system
bars is below 520dp, the same switch the library already makes for
windows under 480dp.

Assisted-by: Claude Opus 5.5
2026-10-08 10:35:49 -07:00
topjohnwu 5f1135036d app: align search fields with app grids
On wide windows the DenyList and Grant search fields were centered
within their 720dp cap, while the app grid below them starts at the
left edge. With few results the cards sat far left under an indented
search field.

Keep the 720dp cap, which is the M3 search bar maximum, but align the
field to the start so it lines up with the grid and the top app bar
title. Compact windows are unchanged since the field fills the width.

Assisted-by: Claude Opus 5.5
2026-10-08 10:35:49 -07:00
topjohnwu 96e6d90d0f app: refine FAB slot in navigation rail
M3 specifies that a FAB nested in a navigation rail rests at
elevation level 0. Use the library's zero elevation for the FAB in
the rail header; the FAB floating above the bottom bar keeps its
default elevation.

The rail header reserves a 56dp slot so the rail items do not jump
when the FAB shows or hides. Without root, neither the Modules nor
the Superuser tab exists and the FAB never shows, so skip the slot
and let the rail items start at the top.

Assisted-by: Claude Opus 5.5
2026-10-08 10:35:49 -07:00
topjohnwu 2140801eb4 app: use non-deprecated window size class API
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
2026-10-08 10:35:49 -07:00
topjohnwu 42b203679a app: size install dialog for wide windows
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
2026-10-08 10:35:49 -07:00
topjohnwu 52314125e0 app: use two columns on wide screens
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
2026-10-08 10:35:49 -07:00
topjohnwu 6ad8aea21e app: use grids for app lists
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
2026-10-08 10:35:49 -07:00
topjohnwu c60156ebd3 app: show tab lists as adaptive grids
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
2026-10-08 10:35:49 -07:00
topjohnwu 07ae8380ea app: use adaptive navigation suite
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
2026-10-08 10:35:49 -07:00
topjohnwu d4b6bebcf9 app: support any scrollable in scrollbar
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
2026-10-08 10:35:49 -07:00
topjohnwu 4d169b84b6 app: add PixelProvider for FirmwareCrawler
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
2026-10-08 10:35:49 -07:00
topjohnwu 93e4023b8b app: suggest recovery images with FirmwareCrawler
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
2026-10-08 10:35:49 -07:00
topjohnwu 3ebcc3440d Support patching Aluminium OS recovery images
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
2026-10-08 10:35:49 -07:00
topjohnwu 35fd230938 app: do not show toast on in-app superuser grant
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
2026-10-08 06:04:45 +00:00
topjohnwu f25a6aa81f app: fix trackpad scrolling on Googlebook
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
2026-10-08 06:04:45 +00:00
topjohnwu cefa2730d4 Classify patch input files with PatchFileClassifier
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
2026-10-07 16:53:36 -07:00
topjohnwu 5f7b39ac63 Add unit test for TarProcessor
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
2026-10-07 08:23:32 +00:00
topjohnwu 53d66fb847 Add unit tests for ZipExtractor
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
2026-10-07 07:44:31 +00:00
topjohnwu 33c1f83562 Rename test class name 2026-10-07 05:05:38 +00:00
topjohnwu 0265698710 Preserve Samsung SignerVer02
Fix #9938, close #10137
2026-10-07 03:18:47 +00:00
topjohnwu cdb02ea12a Several small improvements and bug fixes 2026-10-07 02:58:28 +00:00
topjohnwu 43afdf16a8 Automatically re-sign ChromeOS images on repack
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
2026-10-06 23:36:12 +00:00
topjohnwu da50b5586f Sign ChromeOS boot images with magiskboot
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
2026-10-06 22:59:48 +00:00
topjohnwu 3e9b09f5d5 app: add WholeFilePatcher and ImageExtractor
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
2026-10-06 15:53:42 -07:00
topjohnwu 980f426668 app: share one input pipeline for files and URLs
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
2026-10-06 15:53:42 -07:00
topjohnwu 09d55f2afd app: extract tar processing into TarProcessor
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
2026-10-06 15:53:42 -07:00
topjohnwu 5ebd48ab87 app: refactor DataChannel and extractors
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
2026-10-06 15:53:42 -07:00
topjohnwu 3b37599db9 Cleanup resources 2026-10-06 05:53:18 +00:00
topjohnwu 441ac32623 Handle the situation when connect_daemon returns -1
Fix #10117, close #10141
2026-10-06 03:45:05 +00:00
topjohnwu 8f0cc199e7 core: resolve user 0 assumptions for HSUM
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
2026-10-05 18:20:32 -07:00
topjohnwu e097945851 su: unify su usage callback to notify action
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
2026-10-05 18:20:32 -07:00
topjohnwu 813f9cb9d4 Support Headless System User Mode (HSUM)
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
2026-10-05 18:20:32 -07:00
topjohnwu f093f847bb app: remove interactive su request components
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
2026-10-05 01:38:20 -07:00
topjohnwu a1cf051ac7 su: remove legacy am start fallback
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
2026-10-05 01:38:20 -07:00
topjohnwu 9d79f868f0 test: update su test to explicitly grant access
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
2026-10-05 01:38:20 -07:00
topjohnwu 9a101215f1 su: remove interactive su request prompt
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
2026-10-05 01:38:20 -07:00
topjohnwu ccad207125 app: allow explicitly granting superuser access
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
2026-10-05 01:38:20 -07:00
topjohnwu 5381a1e9b8 Remove legacy apk codebase
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
2026-10-04 03:30:08 -07:00
topjohnwu 70bf88c383 magiskboot: detect format for XZ BCJ filter
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
2026-10-04 04:07:03 +00:00
topjohnwu f7a9b39be2 sepolicy: switch to open_memstream
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
2026-10-03 18:27:40 -07:00
topjohnwu a70a7e67b0 Fix host build compatibility with GCC
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
2026-10-03 06:35:05 +00:00
topjohnwu 66bcdaf4e0 magiskboot: support building on host
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
2026-10-02 17:17:48 -07:00
topjohnwu 33d09a2aff Expose xpipe2 as symbol 2026-10-02 17:17:48 -07:00
topjohnwu 32ee775026 Cleanup base.cpp 2026-10-02 17:17:48 -07:00
topjohnwu 8348d6e39c base: eliminate /proc/self/fd path resolution
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
2026-10-02 17:17:48 -07:00
topjohnwu 0e228db61f Reduce more Linux specific code in base 2026-10-02 17:17:48 -07:00
topjohnwu b76d674a60 Move daemon utilities from base to core
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
2026-10-02 17:17:48 -07:00
topjohnwu 93708e5e73 Use nix Errno 2026-10-02 17:17:48 -07:00
topjohnwu 32998d6991 app: fix D-pad focus and navigation issues
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
2026-09-21 18:33:34 -07:00
topjohnwu aed0261c3d Refactor adb patching and emulator setup
Add support for patching boot images directly via adb
with the build.py script.
2026-09-21 01:40:07 -07:00
topjohnwu 89d3100ffc Update cargo dependencies 2026-09-20 02:21:59 -07:00
topjohnwu da320823ac magiskboot: enable BCJ filter for XZ compression
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
2026-09-20 02:21:59 -07:00
topjohnwu 9e8ff0d1bd Update xz-embedded to upstream submodule
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
2026-09-20 02:21:59 -07:00
topjohnwu ad81daf874 Update gradle dependencies 2026-09-20 02:21:59 -07:00
topjohnwu 6d391dd5b1 magiskboot: handle decompression errors in unpack
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
2026-09-18 16:50:34 -07:00
topjohnwu 887a97822b magiskboot: search compressed formats in zImage
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
2026-09-18 16:50:34 -07:00
topjohnwu 8376f7b27c magiskboot: validate XZ header CRC in check_fmt
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
2026-09-18 16:50:34 -07:00
topjohnwu 3c0838f44e app: fix scrollbar touch interception
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
2026-09-18 01:05:11 -07:00
topjohnwu 66211d4021 app: fix dialog scrolling and scrollbar layout
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
2026-09-17 22:21:22 -07:00
topjohnwu 37063225d4 build: show progress when downloading ONDK
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
2026-09-05 08:17:11 +00:00
topjohnwu 173153fcc7 build: improve build.py and env.py scripts
Modernize build scripts and improve reliability across environments:
- Update required Java toolchain to JDK 25 across scripts and CI
- Propagate subprocess exit codes and report filesystem errors
- Fix argument parsing edge cases and dynamic linker path handling
- Anchor working directory and improve terminal output formatting

Assisted-by: Gemini 3.8 Flash
2026-09-05 08:17:11 +00:00
topjohnwu 96221b69fa Release Magisk v31.0
[skip ci]
2026-09-04 09:46:09 -07:00
topjohnwu bc1128c4f2 Update release date 2026-09-04 09:45:37 -07:00
topjohnwu 584ba3227e Update cargo dependencies 2026-09-04 09:44:49 -07:00
topjohnwu da382dc771 Update AGP 2026-09-04 09:44:49 -07:00
topjohnwu cc08282b6d app: always use TerminalScreen in FlashScreen
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
2026-09-04 09:44:49 -07:00
topjohnwu b36c60abc1 app: prevent SuRequest dismiss on touch outside
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
2026-09-03 22:08:33 -07:00
topjohnwu 26dd8c1352 app: fix scrollbar drag and list synchronization
- 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
2026-09-03 21:36:21 -07:00
topjohnwu 4334c078c1 app: fix UI element shadow clipping
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
2026-09-03 17:51:10 -07:00
topjohnwu fed84885e3 app: fix touch effect and hitbox mismatches
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
2026-09-03 16:17:29 -07:00
topjohnwu aafda835f4 app: polish home screen actions and reboot menu
- 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
2026-09-03 15:44:44 -07:00
topjohnwu 7064cdf305 app: modernize settings layout and choice dialogs
- Replace popup DropdownMenu in SettingsDropdown with standard
  Material 3 single-choice RadioButton dialog.
- Standardize screen horizontal margins to 16dp and increase spacing
  between preference sections.
- Insert outlineVariant HorizontalDividers between items inside
  each section card.
- Apply RoundedCornerShape(12.dp) to OutlinedTextFields in Settings
  text dialogs.

Assisted-by: Gemini 3.8 Flash
2026-09-03 15:44:44 -07:00
topjohnwu 87a3ca3024 app: modernize logs screen cards and typography scale
Refactor SuLogCard to use Material 3 ListItem with an internal
HorizontalDivider for detail rows. Modernize MagiskLogCard to use
Card(onClick) and standardize horizontal margins to 16.dp across both
log tabs.

Replace hardcoded sp font sizes with MaterialTheme.typography tokens
(labelSmall and bodySmall) using monospace font families to ensure
consistent font scaling.

Assisted-by: Gemini 3.8 Flash
2026-09-03 15:44:44 -07:00
topjohnwu 5127a6d782 app: modernize superuser policy items with M3 ListItem
Refactor PolicyCard to use Material 3 ListItem within a Card container,
removing the artificial VerticalDivider and bespoke click bounds.

In SuperuserDetailScreen:
- Standardize Card corner radiuses to 20.dp
- Add subtle HorizontalDivider between switch items
- Modernize RevokeButton to use filledTonalButtonColors with standard
  ButtonDefaults.shape and ButtonWithIconContentPadding

Assisted-by: Gemini 3.8 Flash
2026-09-03 15:44:44 -07:00
topjohnwu c8c214a0ed app: normalize TopAppBar insets across screens
Compose Material 3 TopAppBar already applies standard insets internally
for navigation and action icons. Remove redundant manual start/end
paddings across detail and main screens to ensure icons align flush with
the standard 16dp content margin.

Assisted-by: Gemini 3.8 Flash
2026-09-03 15:44:44 -07:00
topjohnwu 482cde7aa4 app: use ShortNavigationBar and fix insets
- Replace Material 3 NavigationBar with ShortNavigationBar and
  ShortNavigationBarItem for a more compact bottom bar.
- Set contentWindowInsets to zero on the root Scaffold so status bar
  insets are passed down to child screens' TopAppBars.
- Consume innerPadding on HorizontalPager to prevent nested Scaffolds
  from duplicating bottom system navigation insets.

Assisted-by: Gemini 3.8 Flash
2026-09-03 01:43:17 -07:00
topjohnwu c2f8da60f6 app: fix touch handling in SuRequest dialog
- Remove android:windowIsFloating so SuRequestActivity is a full-screen
  translucent activity rather than a floating window that dismisses on
  touches outside during asynchronous initialization.
- Set setFinishOnTouchOutside(false) to prevent unwanted dismissals.
- Decouple the 1-second grant button delay from the countdown timer so
  interacting with the timeout slider immediately does not leave the
  grant button permanently disabled.
- Ensure an immediate DENY response is sent if the activity or
  view model is destroyed before responding.

Assisted-by: Gemini 3.8 Flash
2026-09-03 00:22:42 -07:00
topjohnwu c603be1005 Fix wording in SuRequest dialog 2026-09-02 23:14:56 -07:00