Skip to content

feat(root): overhaul rooted mount system with split APK support and resilient recovery - #722

Merged
Jman-Github merged 19 commits into
devfrom
feat/root-mount-recovery-and-performance
Oct 4, 2026
Merged

Jman-Github merged 19 commits into
devfrom
feat/root-mount-recovery-and-performance

Conversation

@Jman-Github

@Jman-Github Jman-Github commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Overhaul URV's rooted mount system to make mounting safer, more reliable, and compatible with modern Android app installations, including split APK packages.

The new mount flow replaces and expands the previous implementation with transaction-safe mounting, stronger stock APK verification, automatic reboot recovery, split APK support, improved mount namespace handling, safer installer routing, diagnostics, repair feedback, and more reliable rollback behavior.

Root mounts now preserve and verify the identity of the original installed app before making changes, track committed mount state across restarts, recover mounts automatically after reboot, and reject stale or foreign state instead of attempting unsafe mutations.

This also extends the mount system to apps installed as split APK sets and integrates the required split handling throughout patching, installation, recovery, remounting, stock replacement, and rollback.

Addresses the root mount recovery reports in #664 and also includes the recovery and repair improvements from #737.

Root mount system overhaul

  • Reworked the rooted mount installation flow around persistent, transaction-safe mount state.
  • Added an explicit install-base-and-mount flow for rooted installations.
  • Track the original stock APK identity so URV can distinguish verified stock files from patched or externally modified files.
  • Preserve committed mount state for later verification, remounting, recovery, and rollback.
  • Prevent incomplete or interrupted transactions from being treated as successful mounts.
  • Retain completed transaction journals until their associated mount state is safely cleaned up.
  • Stop creating unused legacy root mount directories.
  • Prevent rooted mount installs from creating duplicate saved-app entries.
  • Tighten mount eligibility checks so Rooted Mount is only offered when the selected patch and app state can safely use it.

Split APK support

  • Add rooted mounting support for applications installed as base + split APK sets.
  • Track every stock APK in the package independently using its name and SHA-256 identity.
  • Avoid depending on the package's current installation directory so Android can relocate package paths without invalidating saved mount state.
  • Verify the complete split APK set before mounting or restoring a saved mount.
  • Detect missing, changed, duplicate, unexpected, or foreign splits and reject the operation safely.
  • Preserve split identities in committed mount and module state.
  • Support split APK packages during unmount and recovery.
  • Allow verified split archives to be used as stock sources during regular and batch patch flows.
  • Require patched bases that depend on splits to have their matching verified stock split set available.
  • Replace and restore complete base + split APK sets when performing stock replacement or rollback.

Recovery and reboot handling

  • Reworked boot recovery so saved mounts can be restored reliably after a reboot.
  • Mount earlier during boot when possible, then verify the resulting state again after Android finishes booting.
  • Retry recovery while Android's Package Manager and package state are still becoming available.
  • Allow Android startup additional time to settle before treating temporary package-state failures as permanent failures.
  • Add bounded retry windows and deadlines to Package Manager, dumpsys, launcher resolution, process-stop, and package-state operations.
  • Require complete package state before deciding whether a saved mount can be restored.
  • Reload committed mount state and query fresh package state after acquiring the package transaction lock.
  • Release the transaction lock while waiting for Android services instead of blocking other operations.
  • Defer automatic recovery while the module is disabled, removed, or a Manager transaction is already in progress.
  • Recover saved mounts using the committed stock identity when the currently registered APK path still exposes the previous patched bind mount.
  • Continue verifying the actual stock files after the old mount is removed.

Mount verification and safety

  • Strengthen stock APK and mount-source verification before changing package state.
  • Verify package ownership, APK paths, hashes, split topology, app version, enabled state, Android user, and launcher resolution where required.
  • Refresh package and mount discovery after mount changes instead of relying on stale state.
  • Preserve protection against foreign mounts and externally modified APKs.
  • Reject saved state when the current package no longer matches the package that originally created the mount.
  • Cancel and close interrupted root-shell operations before rollback begins.
  • Improve rollback so the original package state is restored when a mount or stock replacement fails.

Root manager and namespace compatibility

  • Improve mount namespace handling for KernelSU and other supported root environments.
  • Verify mounts from the namespaces where the target application will actually observe them.
  • Improve compatibility with root managers and devices where mount visibility differs between the Manager process, Zygote, and application processes.
  • Handle transient force-stop failures seen on some HyperOS devices during mount operations.

Installer integration

  • Make Rooted Mount available from compatible post-patch installer selectors.
  • Respect the user's selected installer instead of allowing a saved installer preference to bypass per-install selection.
  • Honor profile auto-install preferences when Rooted Mount is selected.
  • Keep normal and batch patch flows consistent when choosing and preparing rooted mount inputs.
  • Improve stock-source tracking so repatching, mounting, and recovery use the correct original APK data.

Repair and user feedback

  • Add structured Rooted Mount operation feedback for mounting, remounting, recovery, and repair.
  • Show repair progress while blocking actions that would conflict with the active repair.
  • Improve remount success and failure feedback.
  • Add diagnostics export for root mount failures so device-specific problems can be investigated more easily.
  • Improve cleanup and recovery behavior when a previous mount operation was interrupted.

Performance

  • Reduce mount ownership-check overhead by batching source inode lookups into a single bounded root-shell operation.
  • Keep current, legacy, rollback, backup, and filesystem-relative ownership candidates available during detection.
  • Ignore missing candidates while continuing to identify existing mount sources.
  • Continue checking target identities independently and refresh mount discovery after changes.

The optimization reduces root-shell ownership probe overhead. Actual mount-time improvement depends on the device and root environment.

Split APK merger reliability

The mount work also required strengthening the shared split APK preparation and merge paths used to produce valid standalone inputs.

  • Normalize sparse Android resource tables before merging so resource IDs remain valid.
  • Use consistent split merge behavior across the app, Morphe runtime, and ReVanced runtime implementations.
  • Update the Morphe patcher integration to the newer split merge implementation.
  • Preserve required split configuration and manifest information during merge preparation.
  • Compress native libraries correctly in standalone merged exports.
  • Keep DEX compression behavior consistent across supported runtimes.

These changes ensure split archives prepared for patching or rooted mounting behave consistently with standalone APK inputs.

Artifact

https://github.com/Jman-Github/Universal-ReVanced-Manager/actions/runs/37162776840/artifacts/11288338962

Note

PR build data and regular release data are kept separate to prevent conflicts when switching between release builds and PR artifacts. Because of this, when you install a PR artifact, your app data will appear to be reset. It’s only a clean slate for that specific PR build. Your previous data is still preserved, and once you reinstall the release build you were using before, that data will be restored.

Validation

  • git diff --check passed.
  • .\gradlew.bat assembleRelease passed.
  • JVM tests passed.

@Jman-Github Jman-Github added this to the Release URV 1.9.0-dev.1 milestone Sep 18, 2026
@Jman-Github Jman-Github self-assigned this Sep 18, 2026
@Jman-Github Jman-Github linked an issue Sep 18, 2026 that may be closed by this pull request
@Jman-Github

Copy link
Copy Markdown
Owner Author

@SHAD0WBULLET707, I found a way to speed up mounts. If you can confirm on your end that it's noticeably faster, that would be great (and let me know if any issues occur unrelated to this, too). The artifact is linked below. Just keep in mind the note listed in the PR description above:

PR build data and regular release data are kept separate to prevent conflicts when switching between release builds and PR artifacts. Because of this, when you install a PR artifact, your app data will appear to be reset. It’s only a clean slate for that specific PR build. Your previous data is still preserved, and once you reinstall the release build you were using before, that data will be restored.

@Rat-Man-1015, if you could also test this build, it includes the previous changes from PR #708 (which has now moved here), which should resolve any issues you were having with dev.22 and mounting. Let me know how it goes.

Artifact

https://github.com/Jman-Github/Universal-ReVanced-Manager/actions/runs/35387752824/artifacts/10564909202

@SHAD0WBULLET707

SHAD0WBULLET707 commented Sep 18, 2026 •

Copy link
Copy Markdown

============================================================
Universal ReVanced Manager - Root Mount Diagnostics

URV version: 1.8.1-pr.722
Device: Google Pixel 10 Pro XL
Android: 17 (37)
Architecture: arm64-v8a


Patcher mount outcome:

Failed to mount app: Safe root mount rejects split/resource-dependent installations No package or mount changes were made. Diagnostic root-dd848d31.


Information:

Package: com.github.android
Generated (UTC): 2026-09-18 20:28:53 UTC
Event timestamps use Unix epoch milliseconds.
Each source is limited to its newest 32 KiB.


Committed Mount State:

Source: /data/adb/urv/transactions/com.github.android/committed.json
Not present.


Active Transaction:

Source: /data/adb/urv/transactions/com.github.android/active.json
Not present.


Recent Diagnostic Events:

Source: /data/adb/urv/transactions/com.github.android/diagnostics.log
1789763304415 [root-dd848d31] java.lang.IllegalArgumentException: Safe root mount rejects split/resource-dependent installations
at okio.Buffer$$ExternalSyntheticBUOutline2.m(R8$$SyntheticClass:3)
at app.urv.manager.domain.installer.root.RootMountTransactionCoordinator.preflight(RootMountTransactionCoordinator.kt:306)
at app.urv.manager.domain.installer.root.RootMountTransactionCoordinator.prepareMountExecution(RootMountTransactionCoordinator.kt:1112)
at app.urv.manager.domain.installer.root.RootMountTransactionCoordinator$prepareMountExecution$1.invokeSuspend(RootMountTransactionCoordinator.kt:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:11)
at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:27)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:23)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:47)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:131)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:4)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:3)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:94)


Boot Status:

Source: /data/adb/urv/transactions/com.github.android/boot-status
Not present.


Root Module State:

Source: /data/adb/modules/com.github.android-revanced/state.env
Not present.


Root Module Service Log:

Source: /data/adb/modules/com.github.android-revanced/log.txt
Not present.


Active Mount Layers:

Source: /proc/self/mountinfo
No active mount layers found.

Sorry boss, it aint working still slow. After 50 or so toasts mounting. The app crashes, I gave up on doing this testing. I'm staying on dev.21. After attempting another to it just infinite mounting and eventually craches, I am aware it doesn't support split apks. Which I do want split apks when I'm rooted and mounted the app. Just gonna stay on dev.21, it's my final update. I gave up trying. It also does the same thing on my Pixel 6 Pro with this artifact as well. It just never works and I know I'm not doing anything wrong and been using it the way it was on dev.21 and below. It just works, why upgrade something when ain't broke? It just made things worse so I'm staying behind.

@Jman-Github Jman-Github changed the title fix(root-mount): improve boot recovery and reduce ownership-check overhead feat(root-mount): support split APKs and improve recovery Sep 28, 2026
@Jman-Github Jman-Github added Feature Something you wish to be added and removed Fix labels Sep 28, 2026
@yoo07 yoo07 mentioned this pull request Oct 2, 2026
Mount earlier during boot and recheck mounts after boot completes.
Handle transient HyperOS force-stop failures, honor profile auto-install
settings, and show repair progress while blocking conflicting actions.

Also closes #737.
@Jman-Github Jman-Github changed the title feat(root-mount): support split APKs and improve recovery feat(root): overhaul rooted mount system with split APK support and resilient recovery Oct 4, 2026
@Jman-Github Jman-Github linked an issue Oct 4, 2026 that may be closed by this pull request
@Jman-Github
Jman-Github marked this pull request as ready for review October 4, 2026 04:01
@Jman-Github
Jman-Github merged commit 600aa60 into dev Oct 4, 2026
@Jman-Github
Jman-Github deleted the feat/root-mount-recovery-and-performance branch October 4, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Something you wish to be added

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: mount installer issues feat: show progress feedback while repairing root mount

2 participants