n0k0m3 / revanced-build-template

Github Template for building Revanced
GNU General Public License v3.0
139 stars 155 forks source link

Explicit include and exclude patches #42

Closed n0k0m3 closed 2 years ago

n0k0m3 commented 2 years ago

Revanced patcher now has both including and excluding patches. Some patches are included by default but there are some that needs to be included explicitly.

We need to modify the script to read from patches.txt in a way that can do both exclude and include in a same file

ManorSailor commented 2 years ago

Hmm. I see. What's the flag to explicitly include patches? Is it -i?

n0k0m3 commented 2 years ago

I'd assume so, haven't got time to check yet

ManorSailor commented 2 years ago

I'd assume so, haven't got time to check yet

Its -i.
By far the most challenging thing would be to figure out how to distinguish both types of patches Anyway. I see 2 ways how this can be implemented. However, both of them have some limitations:

  1. Making the user add flag prefixes to the patches they want to exclude/include themselves.

    • Not really reliable. Users might mess up & later complain that script isn't working
    • Easier to implement, minimal changes required in the current setup
  2. Dividing the patches file into two separate sections, one where user will enter patches to be excluded & other where they will add patches to be included

    • It is a bit nuance to enter patches in different sections
    • Not that typical, can be implemented with some efforts.

Personally, I think the 2nd method is better. We can make the script read specific parts of a file to obtain excluded & included patches & then it will only be a matter of two conditional statements to decide which patch goes where.

What do you think?

n0k0m3 commented 2 years ago

Yep I'm thinking of sectioning the patches.txt, basically when it reach the 2nd # then we'll switch to read includes patches

ManorSailor commented 2 years ago

@n0k0m3 Alright. Are you working on it? I'm already working on a separate feature to reduce build times which might conflict with the changes here, I can implement this if it's okay

n0k0m3 commented 2 years ago

That'd be great as I'll not work on this until weekend

ManorSailor commented 2 years ago

That'd be great as I'll not work on this until weekend

The PR is up ;)