Skip to content

feat: automatic APK downloads in batch patching - #1406

Open
Judzim wants to merge 3 commits into
MorpheApp:devfrom
Judzim:feat/batch-auto-apk-download
Open

Judzim wants to merge 3 commits into
MorpheApp:devfrom
Judzim:feat/batch-auto-apk-download

Conversation

@Judzim

@Judzim Judzim commented Nov 8, 2026

Copy link
Copy Markdown

Description

Batch patching can now fetch the APKs it needs through a trusted helper on its own. A new switch under Settings > APK download helper, "Download APKs automatically in batch", checks every queued app for the newest APK version its patches support and asks the first trusted helper for it when the app has no APK or is behind that version.

The pass starts only after the user presses Start. It walks the queue one app at a time, attaches each returned APK, and then starts the queue as usual. Cancelling a helper stops the pass and leaves the queue in preflight.

It respects:

  • the source order, so the recommended version matches the app's update offer
  • the prerelease patch setting and the per-source experimental app version setting
  • a version the user turned down on the home screen
  • a hand-edited patch selection and a version the user accepted despite the patches, both left untouched
  • the existing signature check requirement; an app whose APK signature cannot be checked is still handled by hand

It never downgrades an app that is newer than everything the patches support.

Morphe still checks the package, version and signature of every APK the helper returns before patching. The helper contract itself is unchanged.

APK download helper settings with the new automatic batch download switch

Testing

  • :app:testDebugUnitTest and :app:lint pass
  • assembleRelease builds
  • Tested on a device with missing and outdated APKs, including cancelling a helper and starting again

Closes #891

When the new setting is enabled, a batch queue asks the first trusted APK download helper for every app that has no APK, choosing the newest version its patches support, and moves on to the next app once the file is attached. Helper results still go through the usual package, version and signature checks.
The automatic helper pass now also fetches an APK for a queued app whose saved or installed APK is behind the newest version the patches offer, instead of only for apps with no APK at all. An app already at the newest version, or past it, is left alone, and a version the user turned down on the home screen is not fetched. The recommended version still follows the source order, the prerelease patch setting and the per-source experimental version setting.
Opening a batch queue no longer starts the helper pass. The pass now runs after the user presses Start, fetches the missing and newer APKs, and then starts the queue itself. Cancelling a helper aborts the start and leaves the queue in preflight. The Start button stays available for a queue that only lacks APKs, as long as a trusted helper is there to fetch them.
@Judzim Judzim closed this Nov 9, 2026
@Judzim Judzim reopened this Nov 9, 2026
@Judzim

Judzim commented Nov 9, 2026

Copy link
Copy Markdown
Author

The build failed before the tests started: the Gradle wrapper download of gradle-9.8.2-bin.zip returned HTTP 504 from services.gradle.org. The same commit passes unit tests, lint and assembleRelease in a separate CI run, so a re-run of the workflow should be enough. The new run is waiting for approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant