revanced-patcher icon indicating copy to clipboard operation
revanced-patcher copied to clipboard

feat: cross-platform patch bundle format

Open oSumAtrIX opened this issue 3 years ago • 8 comments

Issue:

Patches can have resources. On Android, this will not be possible.

Solution

Introduce a patch bundle format. Can be a ZIP file with the dex'ed resources for DexPatchBundle and the regular JAR file for JarPatchBundle. The patcher would either need to introduce an API for patch resources or extract the resources to the patch bundle's specific cache directory to which a resource patch will have access via the data parameter. The implementation of the API on the other hand would require to return a File for resources from the ZIP file. Example: data.patchBundleResources[resourcePath]. This way writing to the cache directory would not be necessary anymore.

RE: https://github.com/revanced/revanced-patches/pull/76

oSumAtrIX avatar Jun 29 '22 19:06 oSumAtrIX

Isn't this overcomplicated? Just keep all resources in integrations and just merge all of them into yt?

TheJeterLP avatar Jun 30 '22 04:06 TheJeterLP

Not the task of the patcher. What if we do not want sponsorblock strings but only ryd.

oSumAtrIX avatar Jun 30 '22 08:06 oSumAtrIX

Not the task of the patcher. What if we do not want sponsorblock strings but only ryd.

I know that, but who cares about sponsorblockstrings being in the ReVanced APK?

TheJeterLP avatar Jun 30 '22 08:06 TheJeterLP

This would overcomplicate things by A lot. If you do it that way, every patch would need its own settings class too for ex.

TheJeterLP avatar Jun 30 '22 08:06 TheJeterLP

I know that, but who cares about sponsorblockstrings being in the ReVanced APK?

These strings are for the overlay buttons and other elements. They are mandatory.

oSumAtrIX avatar Jun 30 '22 08:06 oSumAtrIX

This would overcomplicate things by A lot. If you do it that way, every patch would need its own settings class too for ex.

Each patch which needs its own resources such as strings or xmls, has to provide them via a dependant resource patch.

oSumAtrIX avatar Jun 30 '22 08:06 oSumAtrIX

Yes I know that. But wouldn't it be easier to check in integrations if the patch is installed and hide the settings etc if it's not?

TheJeterLP avatar Jun 30 '22 08:06 TheJeterLP

If sb patch is excluded, ideally no reference to sb should exist. ReVanced is modular for a reason.

oSumAtrIX avatar Jun 30 '22 09:06 oSumAtrIX