Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update to ReVanced Patcher v20 #64

Open
oSumAtrIX opened this issue Jul 23, 2024 · 0 comments
Open

feat: Update to ReVanced Patcher v20 #64

oSumAtrIX opened this issue Jul 23, 2024 · 0 comments

Comments

@oSumAtrIX
Copy link
Contributor

oSumAtrIX commented Jul 23, 2024

Note

For any questions, you can contact [email protected] or contact us through our social media platforms listed on ReVanced's official website. Alternatively, you can use this issue for discussion.


Soon, ReVanced Patcher v20 will be released. The APIs have been converted to Kotlin DSL, but backward compatibility is not retained, leading to breaking changes.

As a heads-up before Patcher v20 is fully released and integrated into ReVanced Manager, I am manually reviewing a couple of repositories. Once ReVanced Manager updates, your patches will stop working due to the breaking API changes.

The ReVanced Patches template repository has already implemented the necessary changes and serves as a basis for updating your patches to the new APIs: ReVanced Patches template repository.

ReVanced Patcher v20 API documentation is also available for reference: ReVanced Patcher API documentation.

I recommend familiarizing yourself with the new API and checking out the respective branch in the ReVanced Patches template repository to migrate your patches to the new API. It is not recommended to manually bump ReVanced Patcher. Instead, use the template repo as a basis because it now employs the ReVanced Patches Gradle plugin, which reduces build system boilerplate for ReVanced Patches developers. Using that plugin, you can automatically apply updates to the build system of ReVanced Patches without worrying about it yourself.

If You Also Developed Integrations for Your Patches:

ReVanced has merged integrations with patches, meaning you no longer need a separate repository to write integrations. The build system compiles the integrations and adds them to the patches, with ReVanced Patcher handling the rest. Therefore, it is recommended to use the template repository as this build system is handled by the Gradle plugin already applied in the template.

ReVanced Patcher v20 API documents how integrations (now called extensions) work: ReVanced Patcher documentation.

Extensions are now on a per-patch basis. Previously, you usually had one integration merged with the app you were patching. Because patches are modular by design, extensions are also now on a per-patch level. Each patch can ship its extension. Extensions can be compiled against each other for interoperability. If it is difficult to separate the extensions for now into their respective patches, you can create a single patch that ships your one big extension for now and migrate to separate extensions over time. Other patches can depend on that patch which would make ReVanced Patcher merge the extension of the patch, which all the other patches can use just like with integrations.

Here's an example by ReVanced:

TL;DR

ReVanced Patcher v20 will be released soon and will introduce breaking APIs. Until ReVanced Manager updates, do the following:

  1. Read the ReVanced Patcher documentation
  2. Check out the ReVanced Patches template repository
  3. Update your current patches to the new API and merge integrations into the same repository

Caution

Both the Gradle plugin and Patcher v20 are still in development. They are subject to have further breaking changes or bugs. If you encounter any issues, please open an issue in the respective repository.

Tip

Once we release everything, you can simply update the plugin and ReVanced Patcher dependency to use the new release version. Make sure to confirm if the template has not received any changes you may want to mirror to yours.

Note

If you want to test your changes, you will need to check out this branch in ReVanced CLI: ReVanced CLI branch. Additionally, you need to check out this branch in ReVanced Library: ReVanced Library branch and publish it to the local Maven repository so ReVanced CLI can use it.

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

No branches or pull requests

1 participant