Skip to content

fix: isolate invalid patch bundle import failures#3329

Open
mostafaNazari702 wants to merge 1 commit into
ReVanced:mainfrom
mostafaNazari702:fix/isolate-invalid-patch-bundle-failures
Open

fix: isolate invalid patch bundle import failures#3329
mostafaNazari702 wants to merge 1 commit into
ReVanced:mainfrom
mostafaNazari702:fix/isolate-invalid-patch-bundle-failures

Conversation

@mostafaNazari702

Copy link
Copy Markdown

The cause of the bug was that a local patch file was dropped into the patch source folder and then picked up by the normal pipeline that loads all patch bundles together.
The problem started when an invalid file made it to the android patch loader. Patch.androidKt.loadPatches tried to read it as a dex file using MultiDexIO.readDexFile but it wasn’t actually a dex file, so it crashed before it could clearly identify where the bad input came from. After that, PatchBundleRepository.loadMetadata treated the whole batch as failed, marked all patch sources as broken, and returned no metadata at all. since that metadata is also used to decide which apps are compatible and should be shown, one bad file ended up making the whole default bundle look broken. which caused the entire "Apps" section to disappear until the invalid file was removed.

@oSumAtrIX oSumAtrIX requested a review from Axelen123 May 2, 2026 23:29
private fun PatchBundle.loadPatchSet(): Set<Patch> {
val file = File(patchesJar)
file.requireDexContainer()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need explicit checks like this or should we just raise the original exceptions? @Axelen123

@Axelen123

Copy link
Copy Markdown
Contributor

If I remember correctly, this stuff was going to be implemented in patcher instead.

@oSumAtrIX

Copy link
Copy Markdown
Member

Yep and it was already, found in dev branch

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.

3 participants