1
mirror of https://github.com/revanced/revanced-patcher synced 2025-09-03 03:43:05 +02:00

Compare commits

...

280 Commits

Author SHA1 Message Date
semantic-release-bot
b160a2adc0 chore: Release v21.1.0-dev.4 [skip ci]
# [21.1.0-dev.4](https://github.com/ReVanced/revanced-patcher/compare/v21.1.0-dev.3...v21.1.0-dev.4) (2025-07-18)

### Bug Fixes

* Correctly save XML files in UTF-8 by using a bufferedWriter ([#356](https://github.com/ReVanced/revanced-patcher/issues/356)) ([33fadcb](33fadcbd0c))
2025-07-18 19:33:42 +00:00
kitadai31
33fadcbd0c fix: Correctly save XML files in UTF-8 by using a bufferedWriter (#356) 2025-07-18 21:31:51 +02:00
semantic-release-bot
68db95b99b chore: Release v21.1.0-dev.3 [skip ci]
# [21.1.0-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v21.1.0-dev.2...v21.1.0-dev.3) (2025-06-20)

### Bug Fixes

* Encode XML files as UTF-8 to fix compilation of resources ([#339](https://github.com/ReVanced/revanced-patcher/issues/339)) ([4f2ef3c](4f2ef3c47c))
2025-06-20 14:44:18 +00:00
Pg
4f2ef3c47c fix: Encode XML files as UTF-8 to fix compilation of resources (#339)
Co-authored-by: kitadai31 <90122968+kitadai31@users.noreply.github.com>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2025-06-20 16:41:53 +02:00
semantic-release-bot
062ae14936 chore: Release v21.1.0-dev.2 [skip ci]
# [21.1.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v21.1.0-dev.1...v21.1.0-dev.2) (2025-06-20)

### Bug Fixes

* Add back missing log by naming logger correctly ([#332](https://github.com/ReVanced/revanced-patcher/issues/332)) ([e4e66b0](e4e66b0d8b))
* Support UTF-8 chars when compiling instructions in Smali in non UTF-8 environments ([#331](https://github.com/ReVanced/revanced-patcher/issues/331)) ([bb8771b](bb8771bb8b))

### Features

* Use option name as key for simplicity and consistency ([754b02e](754b02e4ca))

### Performance Improvements

* Use a buffered writer to reduce IO overhead ([#347](https://github.com/ReVanced/revanced-patcher/issues/347)) ([99f4318](99f431897e))
2025-06-20 13:28:31 +00:00
Pg
99f431897e perf: Use a buffered writer to reduce IO overhead (#347) 2025-06-20 15:26:10 +02:00
oSumAtrIX
d80abbcd17 docs: Correct API usage of fingerprints 2025-03-10 13:52:09 +01:00
oSumAtrIX
509ecc81e1 docs: Correct API usage of fingerprints 2025-03-10 13:47:55 +01:00
kitadai31
e4e66b0d8b fix: Add back missing log by naming logger correctly (#332) 2025-01-20 00:40:26 +01:00
Vologhat
bb8771bb8b fix: Support UTF-8 chars when compiling instructions in Smali in non UTF-8 environments (#331) 2025-01-07 01:30:21 +01:00
oSumAtrIX
754b02e4ca feat: Use option name as key for simplicity and consistency 2024-12-24 16:47:48 +01:00
oSumAtrIX
fe5fb736cb build: Bump dependencies 2024-12-17 04:20:28 +01:00
semantic-release-bot
fc505a8726 chore: Release v21.1.0-dev.1 [skip ci]
# [21.1.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v21.0.0...v21.1.0-dev.1) (2024-12-07)

### Features

* Add identity hash code to unnamed patches ([88a3252](88a3252574))
2024-12-07 05:20:15 +00:00
oSumAtrIX
88a3252574 feat: Add identity hash code to unnamed patches 2024-12-07 06:19:08 +01:00
semantic-release-bot
ead701bdaf chore: Release v21.0.0 [skip ci]
# [21.0.0](https://github.com/ReVanced/revanced-patcher/compare/v20.0.2...v21.0.0) (2024-11-05)

### Bug Fixes

* Match fingerprint before delegating the match property ([5d996de](5d996def4d))
* Merge extension only when patch executes ([#315](https://github.com/ReVanced/revanced-patcher/issues/315)) ([aa472eb](aa472eb985))

### Features

* Improve Fingerprint API ([#316](https://github.com/ReVanced/revanced-patcher/issues/316)) ([0abf1c6](0abf1c6c02))
* Improve various APIs  ([#317](https://github.com/ReVanced/revanced-patcher/issues/317)) ([b824978](b8249789df))
* Move fingerprint match members to fingerprint for ease of access by using context receivers ([0746c22](0746c22743))

### Performance Improvements

* Use smallest lookup map for strings ([1358d3f](1358d3fa10))

### BREAKING CHANGES

* Various APIs have been changed.
* Many APIs have been changed.
2024-11-05 18:18:41 +00:00
oSumAtrIX
0581dcf931 chore: Merge branch dev to main 2024-11-05 19:16:28 +01:00
semantic-release-bot
62191e3c4a chore: Release v21.0.0-dev.4 [skip ci]
# [21.0.0-dev.4](https://github.com/ReVanced/revanced-patcher/compare/v21.0.0-dev.3...v21.0.0-dev.4) (2024-11-05)

### Performance Improvements

* Use smallest lookup map for strings ([1358d3f](1358d3fa10))
2024-11-05 13:41:06 +00:00
oSumAtrIX
1358d3fa10 perf: Use smallest lookup map for strings 2024-11-05 14:39:18 +01:00
semantic-release-bot
6712f0ea72 chore: Release v21.0.0-dev.3 [skip ci]
# [21.0.0-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v21.0.0-dev.2...v21.0.0-dev.3) (2024-11-05)

### Features

* Move fingerprint match members to fingerprint for ease of access by using context receivers ([0746c22](0746c22743))
2024-11-05 13:25:22 +00:00
oSumAtrIX
0746c22743 feat: Move fingerprint match members to fingerprint for ease of access by using context receivers 2024-11-05 14:23:19 +01:00
semantic-release-bot
7f55868e6f chore: Release v21.0.0-dev.2 [skip ci]
# [21.0.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v21.0.0-dev.1...v21.0.0-dev.2) (2024-11-01)

### Bug Fixes

* Match fingerprint before delegating the match property ([5d996de](5d996def4d))
2024-11-01 01:49:47 +00:00
oSumAtrIX
5d996def4d fix: Match fingerprint before delegating the match property 2024-11-01 02:47:57 +01:00
semantic-release-bot
49f4570164 chore: Release v21.0.0-dev.1 [skip ci]
# [21.0.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v20.0.2...v21.0.0-dev.1) (2024-10-27)

### Bug Fixes

* Merge extension only when patch executes ([#315](https://github.com/ReVanced/revanced-patcher/issues/315)) ([aa472eb](aa472eb985))

### Features

* Improve Fingerprint API ([#316](https://github.com/ReVanced/revanced-patcher/issues/316)) ([0abf1c6](0abf1c6c02))
* Improve various APIs  ([#317](https://github.com/ReVanced/revanced-patcher/issues/317)) ([b824978](b8249789df))

### BREAKING CHANGES

* Various APIs have been changed.
* Many APIs have been changed.
2024-10-27 15:08:13 +00:00
oSumAtrIX
b8249789df feat: Improve various APIs (#317)
Some APIs have been slightly changed, and API docs have been added.

BREAKING CHANGE: Various APIs have been changed.
2024-10-27 16:06:25 +01:00
oSumAtrIX
0abf1c6c02 feat: Improve Fingerprint API (#316)
Fingerprints can now be matched easily without adding them to a patch first.

BREAKING CHANGE: Many APIs have been changed.
2024-10-27 16:04:30 +01:00
oSumAtrIX
aa472eb985 fix: Merge extension only when patch executes (#315) 2024-10-27 16:00:30 +01:00
semantic-release-bot
ab624f04f6 chore: Release v20.0.2 [skip ci]
## [20.0.2](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1...v20.0.2) (2024-10-17)

### Bug Fixes

* Make it work on Android 12 and lower by using existing APIs ([#312](https://github.com/ReVanced/revanced-patcher/issues/312)) ([a44802e](a44802ef4e))
2024-10-17 18:03:27 +00:00
oSumAtrIX
21b5c079fb chore: Merge branch dev to main (#314) 2024-10-17 20:01:49 +02:00
semantic-release-bot
5024204046 chore: Release v20.0.2-dev.1 [skip ci]
## [20.0.2-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1...v20.0.2-dev.1) (2024-10-15)

### Bug Fixes

* Make it work on Android 12 and lower by using existing APIs ([#312](https://github.com/ReVanced/revanced-patcher/issues/312)) ([a44802e](a44802ef4e))
2024-10-15 11:41:01 +00:00
LisoUseInAIKyrios
a44802ef4e fix: Make it work on Android 12 and lower by using existing APIs (#312)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-10-15 13:39:33 +02:00
semantic-release-bot
4c1c34ad01 chore: Release v20.0.1 [skip ci]
## [20.0.1](https://github.com/ReVanced/revanced-patcher/compare/v20.0.0...v20.0.1) (2024-10-13)

### Bug Fixes

* Check for class type exactly instead of with contains ([#310](https://github.com/ReVanced/revanced-patcher/issues/310)) ([69f2f20](69f2f20fd9))
* Make it work on Android by not using APIs from JVM unavailable to Android. ([2be6e97](2be6e97817))
* Use non-nullable type for options ([ea6fc70](ea6fc70caa))

### Performance Improvements

* Free memory earlier and remove negligible lookup maps ([d53aacd](d53aacdad4))
2024-10-13 01:54:23 +00:00
oSumAtrIX
b2aecb726d chore: Merge branch dev to main (#304) 2024-10-13 03:52:31 +02:00
semantic-release-bot
851f9c7885 chore: Release v20.0.1-dev.5 [skip ci]
## [20.0.1-dev.5](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1-dev.4...v20.0.1-dev.5) (2024-10-11)

### Bug Fixes

* Use non-nullable type for options ([ea6fc70](ea6fc70caa))
2024-10-11 03:30:03 +00:00
oSumAtrIX
ea6fc70caa fix: Use non-nullable type for options 2024-10-11 05:28:15 +02:00
semantic-release-bot
a2875d1d64 chore: Release v20.0.1-dev.4 [skip ci]
## [20.0.1-dev.4](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1-dev.3...v20.0.1-dev.4) (2024-10-07)

### Bug Fixes

* Make it work on Android by not using APIs from JVM unavailable to Android. ([2be6e97](2be6e97817))
2024-10-07 16:27:20 +00:00
oSumAtrIX
2be6e97817 fix: Make it work on Android by not using APIs from JVM unavailable to Android. 2024-10-07 18:25:43 +02:00
semantic-release-bot
348d0070e7 chore: Release v20.0.1-dev.3 [skip ci]
## [20.0.1-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1-dev.2...v20.0.1-dev.3) (2024-10-03)

### Performance Improvements

* Free memory earlier and remove negligible lookup maps ([d53aacd](d53aacdad4))
2024-10-03 14:08:34 +00:00
oSumAtrIX
d53aacdad4 perf: Free memory earlier and remove negligible lookup maps
Negligible lookup maps used for matching fingerprints have been removed to reduce the likelihood of OOM when the maps are instantiated, commonly observed with 400M RAM. Additionally, lookup maps previously kept for the duration of the patcher instance are now cleared before the classes are compiled. This reduces the likelihood of OOM when compiling classes.
On a related note, a linear increase in memory usage is observed with every compiled class until all classes are compiled implying compiled classes not being freed by GC because they are still referenced. After compiling a class, the class is technically free-able though. The classes are assumed to be referenced in the `multidexlib2` library that takes the list of all classes to compile multiple DEX with and seems to hold the reference to all these classes in memory until all DEX are compiled. A clever fix would involve splitting the list of classes into chunks and getting rid of the list of all classes so that after every DEX compilation, the corresponding split of classes can be freed.
2024-10-03 16:06:42 +02:00
semantic-release-bot
f1615b7ab5 chore: Release v20.0.1-dev.2 [skip ci]
## [20.0.1-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1-dev.1...v20.0.1-dev.2) (2024-10-01)
2024-10-01 15:31:49 +00:00
oSumAtrIX
ffb1d880d7 ci: Use permissions and regular GitHub token instead of PAT 2024-10-01 17:25:49 +02:00
oSumAtrIX
e95f13ae3e build(Needs bump): Update dependencies 2024-09-30 23:21:44 +02:00
oSumAtrIX
e1b984d601 ci: Adjust release commit message 2024-09-30 22:34:23 +02:00
semantic-release-bot
c2dc29e061 chore(release): 20.0.1-dev.1 [skip ci]
## [20.0.1-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v20.0.0...v20.0.1-dev.1) (2024-09-18)

### Bug Fixes

* Check for class type exactly instead of with contains ([#310](https://github.com/ReVanced/revanced-patcher/issues/310)) ([69f2f20](69f2f20fd9))
2024-09-18 12:38:03 +00:00
oSumAtrIX
69f2f20fd9 fix: Check for class type exactly instead of with contains (#310) 2024-09-18 14:36:15 +02:00
Pg
525beda18e docs: Fix code example (#306) 2024-08-29 08:59:33 +02:00
oSumAtrIX
73d3cbf4ff build: Bump Gradle Wrapper to 8.9 2024-08-06 17:46:39 +02:00
semantic-release-bot
70278dd79d chore(release): 20.0.0 [skip ci]
# [20.0.0](https://github.com/ReVanced/revanced-patcher/compare/v19.3.1...v20.0.0) (2024-08-06)

### Bug Fixes

* Downgrade smali to fix dex compilation issue ([5227e98](5227e98abf))
* Improve exception message wording ([5481d0c](5481d0c54c))
* Make constructor internal as supposed ([7f44174](7f44174d91))
* Merge all extensions before initializing lookup maps ([8c4dd5b](8c4dd5b3a3))
* Use null for compatible package version when adding packages only ([736b3ee](736b3eebbf))

### Features

* Add ability to create options outside of a patch ([d310246](d310246852))
* Convert APIs to Kotlin DSL ([#298](https://github.com/ReVanced/revanced-patcher/issues/298)) ([11a911d](11a911dc67))

### BREAKING CHANGES

* Various old APIs are removed, and DSL APIs are added instead.
2024-08-06 14:56:20 +00:00
oSumAtrIX
5e98e9e30a chore: Merge branch dev to main (#279) 2024-08-06 16:54:38 +02:00
semantic-release-bot
ac1aff5a1a chore(release): 20.0.0-dev.4 [skip ci]
# [20.0.0-dev.4](https://github.com/ReVanced/revanced-patcher/compare/v20.0.0-dev.3...v20.0.0-dev.4) (2024-08-06)

### Bug Fixes

* Improve exception message wording ([bd434ce](bd434ceb33))
2024-08-06 16:53:42 +02:00
oSumAtrIX
5481d0c54c fix: Improve exception message wording 2024-08-06 16:53:42 +02:00
semantic-release-bot
4604742d0f chore(release): 20.0.0-dev.3 [skip ci]
# [20.0.0-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v20.0.0-dev.2...v20.0.0-dev.3) (2024-08-01)

### Bug Fixes

* Make constructor internal as supposed ([e95fcd1](e95fcd1c0b))

### Features

* Add ability to create options outside of a patch ([b8d763a](b8d763a66e))
2024-08-06 16:53:42 +02:00
oSumAtrIX
4beb907a61 refactor: Sort dependencies 2024-08-06 16:53:42 +02:00
oSumAtrIX
7f44174d91 fix: Make constructor internal as supposed 2024-08-06 16:53:42 +02:00
oSumAtrIX
d310246852 feat: Add ability to create options outside of a patch 2024-08-06 16:53:42 +02:00
semantic-release-bot
dcc989243c chore(release): 20.0.0-dev.2 [skip ci]
# [20.0.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v20.0.0-dev.1...v20.0.0-dev.2) (2024-07-31)

### Bug Fixes

* Downgrade smali to fix dex compilation issue ([714447d](714447de70))
* Merge all extensions before initializing lookup maps ([328aa87](328aa876d8))
* Use null for compatible package version when adding packages only ([a8e8fa4](a8e8fa4093))
2024-08-06 16:53:42 +02:00
oSumAtrIX
5227e98abf fix: Downgrade smali to fix dex compilation issue 2024-08-06 16:53:42 +02:00
oSumAtrIX
8c4dd5b3a3 fix: Merge all extensions before initializing lookup maps 2024-08-06 16:53:42 +02:00
oSumAtrIX
736b3eebbf fix: Use null for compatible package version when adding packages only 2024-08-06 16:53:42 +02:00
oSumAtrIX
b41a542952 refactor: Convert method bodies to single expression functions 2024-08-06 16:53:42 +02:00
oSumAtrIX
d21128fe2e build(Needs bump): Bump dependencies 2024-08-06 16:53:42 +02:00
oSumAtrIX
cf4374b8cf docs: Fix syntax issues and improve wording 2024-08-06 16:53:42 +02:00
semantic-release-bot
8a30b0fa10 chore(release): 20.0.0-dev.1 [skip ci]
# [20.0.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v19.3.1...v20.0.0-dev.1) (2024-07-22)

### Features

* Convert APIs to Kotlin DSL ([#298](https://github.com/ReVanced/revanced-patcher/issues/298)) ([3f9cbd2](3f9cbd2408))

### BREAKING CHANGES

* Various old APIs are removed, and DSL APIs are added instead.
2024-08-06 16:53:42 +02:00
oSumAtrIX
11a911dc67 feat: Convert APIs to Kotlin DSL (#298)
This commit converts various APIs to Kotlin DSL.

BREAKING CHANGE: Various old APIs are removed, and DSL APIs are added instead.
2024-08-06 16:53:42 +02:00
oSumAtrIX
6e3ba7419b ci: Correct usage of repository variable 2024-08-06 16:53:42 +02:00
oSumAtrIX
50a66ccfed docs: Improve issue templates 2024-08-06 16:53:42 +02:00
oSumAtrIX
0be79840b1 chore: Fix spelling mistake 2024-08-06 16:53:42 +02:00
Vologhat
d8b4c60321 refactor: Simplify mapping classes to their names (#290)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-08-06 16:53:42 +02:00
oSumAtrIX
f77e99e817 build: Publish sources 2024-08-06 16:53:42 +02:00
oSumAtrIX
ea26c486c0 build: Set target bytecode level to JVM 11 2024-08-06 16:53:42 +02:00
oSumAtrIX
bebb734608 ci: Update action 2024-08-06 16:53:42 +02:00
oSumAtrIX
d842f82d07 chore: Lint code 2024-08-06 16:53:42 +02:00
oSumAtrIX
82bab58ac2 build: Bump dependencies 2024-08-06 16:53:42 +02:00
oSumAtrIX
90b7631d9e refactor: Properly abstract Patch#execute function 2024-08-06 16:53:42 +02:00
oSumAtrIX
26d449e6d9 docs: Fix broken links 2024-08-06 16:53:42 +02:00
oSumAtrIX
49466060e3 docs: Fix docs link [skip ci] 2024-08-06 16:53:42 +02:00
oSumAtrIX
620ea5b852 docs: Un-indent markdown to fix rendering 2024-08-06 16:53:42 +02:00
oSumAtrIX
3e2168a2b2 chore: Revert using a relative image path
For some reason GitHub does not render them correctly
2024-08-06 16:53:42 +02:00
oSumAtrIX
13c77967b1 build: Bump dependencies 2024-08-06 16:53:42 +02:00
oSumAtrIX
f57e571a14 chore: Merge branch dev to main (#276) 2024-02-25 03:33:57 +01:00
oSumAtrIX
fe616beb22 docs: Add documentation (#278) 2024-02-25 03:30:08 +01:00
oSumAtrIX
41257ee87e chore: Rename issue templates and use relative image paths 2024-02-25 03:26:15 +01:00
oSumAtrIX
33ed5f0aa3 ci: Fix indentation in workflow 2024-02-24 01:15:09 +01:00
oSumAtrIX
d0a57ac00d docs: Add readme and contribution guidelines 2024-02-23 04:00:59 +01:00
oSumAtrIX
b0b2c10665 ci: Split release into a separate PR build workflow
Because the release workflow already runs on dev and main, it is not necessary to also trigger it for PRs.
2024-02-23 02:26:30 +01:00
oSumAtrIX
cc183062ab chore: Fix inline comment 2024-02-15 02:46:14 +01:00
oSumAtrIX
fe8ea9130d build: Remove unnecessary java plugin 2024-02-14 04:32:33 +01:00
oSumAtrIX
f1c60093cf ci: Update GPG passphrase secret name 2024-02-14 02:49:52 +01:00
oSumAtrIX
687b884dc4 ci: Import GPG key as late as possible
It is not necessary to import it earlier.
2024-02-14 01:59:41 +01:00
semantic-release-bot
ceb6fd51c1 chore(release): 19.3.1 [skip ci]
## [19.3.1](https://github.com/ReVanced/revanced-patcher/compare/v19.3.0...v19.3.1) (2024-02-14)
2024-02-14 00:57:51 +00:00
oSumAtrIX
0b223bfe65 chore: Merge branch dev to main (#275) 2024-02-14 01:55:11 +01:00
semantic-release-bot
308e95cf62 chore(release): 19.3.1-dev.1 [skip ci]
## [19.3.1-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v19.3.0...v19.3.1-dev.1) (2024-02-14)
2024-02-14 00:51:49 +00:00
oSumAtrIX
db8866212a build: Bump Gradle 2024-02-14 01:50:02 +01:00
oSumAtrIX
608a05d9aa build: Bump dependencies 2024-02-14 01:50:01 +01:00
oSumAtrIX
55746ed705 build(Needs bump): Add missing repository to publish packages to 2024-02-14 01:47:52 +01:00
semantic-release-bot
e33026c538 chore(release): 19.3.0 [skip ci]
# [19.3.0](https://github.com/ReVanced/revanced-patcher/compare/v19.2.0...v19.3.0) (2024-02-14)

### Bug Fixes

* Use `Patch#toString` to get patch class name, when no name available ([c9a8260](c9a82608f7))

### Features

* Read and write arbitrary files in APK files ([f1d7217](f1d7217495))
2024-02-14 00:35:38 +00:00
oSumAtrIX
ff215620bb chore: Merge branch dev to main (#266) 2024-02-14 01:33:41 +01:00
oSumAtrIX
fec31f45da chore: Add note 2024-02-14 01:14:28 +01:00
oSumAtrIX
7684b70324 build: Publish to GitHub Packages
Because Jitpack can not sign artifacts.
2024-02-14 01:12:54 +01:00
oSumAtrIX
55a5d3bd4e chore: Fix warnings 2024-02-13 05:27:50 +01:00
semantic-release-bot
17a4675a8e chore(release): 19.3.0-dev.2 [skip ci]
# [19.3.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v19.3.0-dev.1...v19.3.0-dev.2) (2024-02-13)
2024-02-13 04:18:58 +00:00
oSumAtrIX
98085d1d45 build(Needs bump): Sign publication artifacts 2024-02-13 05:17:15 +01:00
semantic-release-bot
bc5c16f112 chore(release): 19.3.0-dev.1 [skip ci]
# [19.3.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v19.2.1-dev.1...v19.3.0-dev.1) (2024-02-13)

### Features

* Read and write arbitrary files in APK files ([f1d7217](f1d7217495))
2024-02-13 02:42:39 +00:00
oSumAtrIX
f1d7217495 feat: Read and write arbitrary files in APK files
This commit allows reading and writing arbitrary files in an APK file. Additionally it allows deleting files from APK files. A `RawResourcePatch` class has been added which has access to `ResourceContext` but ReVanced Patcher will not decode APK resources. A regular `ResourcePatch` can read and write arbitrary files from an APK file, unless they are decoded to `PatcherConfig.apkFiles`. On attempt to get a file from `PatcherConfig.apkFiles` if the second parameter is true, it will read and write the raw resource file from the original APK to `PatcherConfig.apkFiles` if it does not exist. With this commit, many APIs have been deprecated as well, such as `DomFileEditor` and instead a `Document` has been added.
2024-02-13 03:40:39 +01:00
semantic-release-bot
64dd1526cd chore(release): 19.2.1-dev.1 [skip ci]
## [19.2.1-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v19.2.0...v19.2.1-dev.1) (2024-01-27)

### Bug Fixes

* Use `Patch#toString` to get patch class name, when no name available ([c9a8260](c9a82608f7))
2024-01-27 03:08:34 +00:00
oSumAtrIX
c9a82608f7 fix: Use Patch#toString to get patch class name, when no name available 2024-01-27 04:06:15 +01:00
oSumAtrIX
9fc42e132c ci: Use latest Node.js LTS version to fix builds
(cherry picked from commit 23b3eb1325704c39db1a99bb169047f4879766d1)
2024-01-27 04:06:15 +01:00
oSumAtrIX
efa98ece45 ci: Add dependabot 2024-01-26 01:45:43 +01:00
oSumAtrIX
68e2acebba build: Bump dependencies 2024-01-26 01:42:02 +01:00
semantic-release-bot
7a7a8fc353 chore(release): 19.2.0 [skip ci]
# [19.2.0](https://github.com/ReVanced/revanced-patcher/compare/v19.1.0...v19.2.0) (2023-12-28)

### Bug Fixes

* Accept `PatchSet` in `PatchesConsumer#acceptPatches` ([716825f](716825f232))

### Features

* Add `PatchExtensions#registerNewPatchOption` function to simplify instantiation and registration of patch options ([4a91845](4a9184597b))
2023-12-28 21:35:22 +00:00
oSumAtrIX
f8306ac43d chore: Merge branch dev to main (#264) 2023-12-28 22:33:35 +01:00
semantic-release-bot
d03591b735 chore(release): 19.2.0-dev.1 [skip ci]
# [19.2.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v19.1.1-dev.1...v19.2.0-dev.1) (2023-12-22)

### Features

* Add `PatchExtensions#registerNewPatchOption` function to simplify instantiation and registration of patch options ([4a91845](4a9184597b))
2023-12-22 02:23:04 +00:00
oSumAtrIX
4a9184597b feat: Add PatchExtensions#registerNewPatchOption function to simplify instantiation and registration of patch options 2023-12-22 03:20:50 +01:00
oSumAtrIX
0a482f8c9a refactor: Reduce duplicate code by using a common function to register options 2023-12-22 03:09:42 +01:00
oSumAtrIX
e7dacfba8c build: Simplify enabling local build cache 2023-12-10 21:57:10 +01:00
semantic-release-bot
2d7fffd4ec chore(release): 19.1.1-dev.1 [skip ci]
## [19.1.1-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v19.1.0...v19.1.1-dev.1) (2023-12-01)

### Bug Fixes

* Accept `PatchSet` in `PatchesConsumer#acceptPatches` ([716825f](716825f232))
2023-12-01 22:15:43 +00:00
oSumAtrIX
f8baabbcec build: Bump dependencies 2023-12-01 23:13:49 +01:00
oSumAtrIX
716825f232 fix: Accept PatchSet in PatchesConsumer#acceptPatches
This deprecates accepting `List<Patch<*>>`
2023-12-01 23:10:23 +01:00
semantic-release-bot
58bd46750b chore(release): 19.1.0 [skip ci]
# [19.1.0](https://github.com/ReVanced/revanced-patcher/compare/v19.0.0...v19.1.0) (2023-12-01)

### Features

* Add constructor to initialize patches without annotations ([462fbe2](462fbe2cad))
* Retrieve annotations in super and interface classes ([7aeae93](7aeae93f3d))

### Performance Improvements

* Use a hash set for fast lookup ([f1de9b3](f1de9b39ef))
2023-12-01 00:19:54 +00:00
oSumAtrIX
288240f163 chore: Merge branch dev to main (#260) 2023-12-01 01:17:47 +01:00
semantic-release-bot
ff02452cb8 chore(release): 19.1.0-dev.1 [skip ci]
# [19.1.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v19.0.0...v19.1.0-dev.1) (2023-11-29)

### Features

* Add constructor to initialize patches without annotations ([462fbe2](462fbe2cad))
* Retrieve annotations in super and interface classes ([7aeae93](7aeae93f3d))

### Performance Improvements

* Use a hash set for fast lookup ([f1de9b3](f1de9b39ef))
2023-11-29 19:28:24 +00:00
oSumAtrIX
462fbe2cad feat: Add constructor to initialize patches without annotations 2023-11-29 20:26:20 +01:00
oSumAtrIX
7aeae93f3d feat: Retrieve annotations in super and interface classes 2023-11-29 01:14:46 +01:00
oSumAtrIX
f1de9b39ef perf: Use a hash set for fast lookup 2023-11-28 20:17:46 +01:00
oSumAtrIX
db5b0ed7be refactor: Convert extension property to member 2023-11-28 20:17:02 +01:00
oSumAtrIX
9f28a01c03 refactor: Group related extension functions together 2023-11-28 19:59:18 +01:00
oSumAtrIX
80407b6102 chore: Lint code 2023-11-26 05:57:41 +01:00
oSumAtrIX
287841d806 chore: Add heading to issue templates 2023-11-23 00:56:53 +01:00
oSumAtrIX
10c3be1195 build: Bump Gradle wrapper 2023-11-22 01:04:49 +01:00
oSumAtrIX
0c0e22013b build: Use dedicated Gradle cache action 2023-11-22 01:04:49 +01:00
oSumAtrIX
f35c8d4446 build: Use Gradle build cache 2023-11-22 01:04:48 +01:00
oSumAtrIX
17418d4b9c ci: Simplify cache paths 2023-11-22 01:04:48 +01:00
oSumAtrIX
ec1fbdf2ae chore: Reword comment for first PR merge 2023-11-22 01:04:48 +01:00
oSumAtrIX
56e5a46fd5 chore: Add a newline between steps 2023-11-22 01:04:48 +01:00
oSumAtrIX
32e86d44a3 chore: Simplify issue templates 2023-11-22 01:04:47 +01:00
oSumAtrIX
7100606dfc build: Bump dependencies 2023-11-22 01:04:47 +01:00
oSumAtrIX
d7eb111460 ci: Update cache key 2023-11-22 01:04:47 +01:00
oSumAtrIX
27ea46653e chore: Update packages 2023-11-22 01:04:46 +01:00
oSumAtrIX
12c43072cb refactor: Include class of method in call expression 2023-11-03 23:31:15 +01:00
semantic-release-bot
671aa6d507 chore(release): 19.0.0 [skip ci]
# [19.0.0](https://github.com/ReVanced/revanced-patcher/compare/v18.0.0...v19.0.0) (2023-10-24)

### Features

* Add `PatchOption#valueType` to handle type erasure ([a46e948](a46e948b5a))

### BREAKING CHANGES

* This changes the signature of the `PatchOption` constructor.
2023-10-24 20:39:50 +00:00
oSumAtrIX
b697bbad2b chore: Merge branch dev to main (#258) 2023-10-24 22:37:05 +02:00
semantic-release-bot
f05a404e48 chore(release): 19.0.0-dev.1 [skip ci]
# [19.0.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v18.0.0...v19.0.0-dev.1) (2023-10-24)

### Features

* Add `PatchOption#valueType` to handle type erasure ([a46e948](a46e948b5a))

### BREAKING CHANGES

* This changes the signature of the `PatchOption` constructor.
2023-10-24 20:35:38 +00:00
oSumAtrIX
a46e948b5a feat: Add PatchOption#valueType to handle type erasure
Without this new property, it is not possible to infer the type without abusing `ClassCastException` at runtime to infer the type of the option value.

BREAKING CHANGE: This changes the signature of the `PatchOption` constructor.
2023-10-24 22:33:10 +02:00
semantic-release-bot
dc09ea639f chore(release): 18.0.0 [skip ci]
# [18.0.0](https://github.com/ReVanced/revanced-patcher/compare/v17.0.0...v18.0.0) (2023-10-22)

### Bug Fixes

* Do not set patch fields if they are empty ([a76ac04](a76ac04214))
* Only allow setting `MethodFingerprint#result` privately ([aed1eac](aed1eac315))

### Code Refactoring

* Change `PatchOption` from abstract to open class ([09cd6aa](09cd6aa568))
* Change data classes to actual classes ([6192089](6192089b71))
* Convert extension functions to member functions ([e2ca507](e2ca50729d))
* Move files to simplify package structure ([124a2e9](124a2e9d3e))
* Remove deprecated classes and members ([a4212f6](a4212f6bf9))

* refactor!: Remove `Fingerprint` interface ([54a2f8f](54a2f8f16f))

### Features

* Add function to reset options to their default value ([ebbaafb](ebbaafb78e))
* Add function to reset options to their default value ([e6de90d](e6de90d300))
* Add getter for default option value ([c7922e9](c7922e90d0))
* Make `PatchOption#values` nullable ([56ce9ec](56ce9ec2f9))
* Name patch option value validator property correctly ([caa634f](caa634fac6))
* Remove patch annotation processor ([4456031](4456031459))
* Use a map for `PatchOption#values` ([54ac139](54ac1394a9))

### Performance Improvements

* Run the garbage collector after writing dex files ([d9fb241](d9fb241d57))

### BREAKING CHANGES

* The `MethodFingerprint#result` member can now only be set inside `MethodFingerprint`.
* The `Fingerprint` interface is no longer present.
* Some extension functions are now member functions.
* This gets rid of data class members.
* Some deprecated classes and members are not present anymore.
* Classes and members have changed packages.
* This gets rid of the existing basic implementations of the `PatchOptions` type and moves extension functions.
* This changes the getter name of the property.
* Various patch constructor signatures have changed.
2023-10-22 23:59:31 +00:00
oSumAtrIX
49ed096e85 chore: Merge branch dev to main (#257) 2023-10-23 01:56:40 +02:00
semantic-release-bot
167bd83f4e chore(release): 18.0.0-dev.6 [skip ci]
# [18.0.0-dev.6](https://github.com/ReVanced/revanced-patcher/compare/v18.0.0-dev.5...v18.0.0-dev.6) (2023-10-22)

### Bug Fixes

* Only allow setting `MethodFingerprint#result` privately ([aed1eac](aed1eac315))

### Code Refactoring

* Change data classes to actual classes ([6192089](6192089b71))
* Convert extension functions to member functions ([e2ca507](e2ca50729d))
* Move files to simplify package structure ([124a2e9](124a2e9d3e))
* Remove deprecated classes and members ([a4212f6](a4212f6bf9))

* refactor!: Remove `Fingerprint` interface ([54a2f8f](54a2f8f16f))

### BREAKING CHANGES

* The `MethodFingerprint#result` member can now only be set inside `MethodFingerprint`.
* The `Fingerprint` interface is no longer present.
* Some extension functions are now member functions.
* This gets rid of data class members.
* Some deprecated classes and members are not present anymore.
* Classes and members have changed packages.
2023-10-22 23:54:59 +00:00
oSumAtrIX
aed1eac315 fix: Only allow setting MethodFingerprint#result privately
BREAKING CHANGE: The `MethodFingerprint#result` member can now only be set inside `MethodFingerprint`.
2023-10-23 01:52:43 +02:00
oSumAtrIX
54a2f8f16f refactor!: Remove Fingerprint interface
It served no purpose so far.

BREAKING CHANGE: The `Fingerprint` interface is no longer present.
2023-10-23 01:52:04 +02:00
oSumAtrIX
2ca543ffb9 refactor: Move lookup related classes and members to own file 2023-10-23 01:51:48 +02:00
oSumAtrIX
58e7f815a5 refactor: Move MethodFingerprintResult to own file 2023-10-23 01:51:34 +02:00
oSumAtrIX
15b38fc841 refactor: Simplify method implementation 2023-10-23 01:50:54 +02:00
oSumAtrIX
e2ca50729d refactor: Convert extension functions to member functions
BREAKING CHANGE: Some extension functions are now member functions.
2023-10-23 01:50:53 +02:00
oSumAtrIX
6192089b71 refactor: Change data classes to actual classes
The data class members did not serve any actual purpose.

BREAKING CHANGE: This gets rid of data class members.
2023-10-23 01:49:57 +02:00
oSumAtrIX
a4212f6bf9 refactor: Remove deprecated classes and members
BREAKING CHANGE: Some deprecated classes and members are not present anymore.
2023-10-23 01:49:23 +02:00
oSumAtrIX
124a2e9d3e refactor: Move files to simplify package structure
BREAKING CHANGE: Classes and members have changed packages.
2023-10-23 01:48:52 +02:00
semantic-release-bot
f77624b3b9 chore(release): 18.0.0-dev.5 [skip ci]
# [18.0.0-dev.5](https://github.com/ReVanced/revanced-patcher/compare/v18.0.0-dev.4...v18.0.0-dev.5) (2023-10-22)

### Bug Fixes

* Do not set patch fields if they are empty ([a76ac04](a76ac04214))
2023-10-22 16:10:54 +00:00
oSumAtrIX
a76ac04214 fix: Do not set patch fields if they are empty 2023-10-22 18:08:28 +02:00
semantic-release-bot
0447fa9c28 chore(release): 18.0.0-dev.4 [skip ci]
# [18.0.0-dev.4](https://github.com/ReVanced/revanced-patcher/compare/v18.0.0-dev.3...v18.0.0-dev.4) (2023-10-22)

### Features

* Use a map for `PatchOption#values` ([54ac139](54ac1394a9))
2023-10-22 15:39:57 +00:00
oSumAtrIX
54ac1394a9 feat: Use a map for PatchOption#values
This allows to display a string representation associated to the option value.
2023-10-22 17:07:22 +02:00
oSumAtrIX
0b04c73ac5 build: Bump Kotlin Gradle plugin version 2023-10-22 16:14:46 +02:00
semantic-release-bot
079de45238 chore(release): 18.0.0-dev.3 [skip ci]
# [18.0.0-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v18.0.0-dev.2...v18.0.0-dev.3) (2023-10-22)

### Features

* Make `PatchOption#values` nullable ([56ce9ec](56ce9ec2f9))
2023-10-22 14:09:28 +00:00
oSumAtrIX
56ce9ec2f9 feat: Make PatchOption#values nullable
There is no difference semantically, but this change allows passing null as a parameter which is simpler than having to use `emptySet()`.
2023-10-22 16:07:01 +02:00
semantic-release-bot
1b52e4b0f9 chore(release): 18.0.0-dev.2 [skip ci]
# [18.0.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v18.0.0-dev.1...v18.0.0-dev.2) (2023-10-22)

### Code Refactoring

* Change `PatchOption` from abstract to open class ([09cd6aa](09cd6aa568))

### Features

* Add function to reset options to their default value ([ebbaafb](ebbaafb78e))
* Add function to reset options to their default value ([e6de90d](e6de90d300))
* Add getter for default option value ([c7922e9](c7922e90d0))
* Name patch option value validator property correctly ([caa634f](caa634fac6))

### BREAKING CHANGES

* This gets rid of the existing basic implementations of the `PatchOptions` type and moves extension functions.
* This changes the getter name of the property.
2023-10-22 00:56:40 +00:00
oSumAtrIX
098c2c1efa chore: Test default option value 2023-10-22 02:50:26 +02:00
oSumAtrIX
64343e5a7c chore: Test resetting options 2023-10-22 02:49:44 +02:00
oSumAtrIX
0caf6caeb9 refactor: Simplify patch option tests 2023-10-22 02:46:51 +02:00
oSumAtrIX
55f6c2a9fc feat!: Add property PatchOption#values 2023-10-22 02:38:12 +02:00
oSumAtrIX
c6095bc38a feat!: Add PatchOption#toString 2023-10-22 02:04:49 +02:00
oSumAtrIX
09cd6aa568 refactor: Change PatchOption from abstract to open class
BREAKING CHANGE: This gets rid of the existing basic implementations of the `PatchOptions` type and moves extension functions.
2023-10-22 01:55:05 +02:00
oSumAtrIX
ebbaafb78e feat: Add function to reset options to their default value 2023-10-22 01:14:48 +02:00
oSumAtrIX
e6de90d300 feat: Add function to reset options to their default value 2023-10-22 01:10:15 +02:00
oSumAtrIX
c7922e90d0 feat: Add getter for default option value 2023-10-22 01:02:43 +02:00
oSumAtrIX
c1f4c0445a chore: Fix inline docs wording 2023-10-21 23:52:47 +02:00
oSumAtrIX
caa634fac6 feat: Name patch option value validator property correctly
BREAKING CHANGE: This changes the getter name of the property.
2023-10-21 23:51:44 +02:00
oSumAtrIX
f28bfe0dbd chore: Add missing inline docs 2023-10-21 23:49:40 +02:00
semantic-release-bot
155e787ff4 chore(release): 18.0.0-dev.1 [skip ci]
# [18.0.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v17.0.1-dev.1...v18.0.0-dev.1) (2023-10-14)

### Features

* Remove patch annotation processor ([4456031](4456031459))

### BREAKING CHANGES

* Various patch constructor signatures have changed.
2023-10-14 18:43:40 +00:00
oSumAtrIX
c38f0ef42a build: Move subproject to root project 2023-10-14 19:30:10 +02:00
oSumAtrIX
4456031459 feat: Remove patch annotation processor
Unfortunately processing annotations required generating new classes which turned out to be quite cumbersome to work with, especially when trying to publish an API. Therefor, the patch annotation retention is now `RUNTIME`.

BREAKING CHANGE: Various patch constructor signatures have changed.
2023-10-14 19:29:23 +02:00
semantic-release-bot
5fb59a227f chore(release): 17.0.1-dev.1 [skip ci]
## [17.0.1-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v17.0.0...v17.0.1-dev.1) (2023-10-10)

### Performance Improvements

* Run the garbage collector after writing dex files ([d9fb241](d9fb241d57))
2023-10-10 18:23:51 +00:00
oSumAtrIX
d9fb241d57 perf: Run the garbage collector after writing dex files
Writing dex files consumes a lot of memory.
2023-10-10 20:06:27 +02:00
oSumAtrIX
642c4ea97e refactor: Use correct class structure 2023-10-10 20:05:46 +02:00
semantic-release-bot
8c8a251626 chore(release): 17.0.0 [skip ci]
# [17.0.0](https://github.com/ReVanced/revanced-patcher/compare/v16.0.2...v17.0.0) (2023-10-09)

### Features

* Add option to use single threaded writer for dex files ([77dbee3](77dbee3d6a))

### BREAKING CHANGES

* This commit gets rid of deprecated constructors.
2023-10-09 13:00:18 +00:00
oSumAtrIX
5953d6cfb5 chore: Merge branch dev to main (#252) 2023-10-09 14:56:10 +02:00
semantic-release-bot
a1962fe600 chore(release): 17.0.0-dev.1 [skip ci]
# [17.0.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v16.0.2...v17.0.0-dev.1) (2023-10-09)

### Features

* Add option to use single threaded writer for dex files ([77dbee3](77dbee3d6a))

### BREAKING CHANGES

* This commit gets rid of deprecated constructors.
2023-10-09 12:53:08 +00:00
oSumAtrIX
77dbee3d6a feat: Add option to use single threaded writer for dex files
BREAKING CHANGE: This commit gets rid of deprecated constructors.
2023-10-09 14:42:20 +02:00
oSumAtrIX
cb5e39d73e build: Publish artifacts on Jitpack 2023-10-09 14:42:20 +02:00
semantic-release-bot
38ef2f470a chore(release): 16.0.2 [skip ci]
## [16.0.2](https://github.com/ReVanced/revanced-patcher/compare/v16.0.1...v16.0.2) (2023-10-06)

### Performance Improvements

* Use a map to merge integrations classes ([6059d3c](6059d3ca26))
2023-10-06 23:59:10 +00:00
oSumAtrIX
129d84e108 chore: Merge branch dev to main (#250) 2023-10-07 01:55:48 +02:00
semantic-release-bot
affeba76b8 chore(release): 16.0.2-dev.1 [skip ci]
## [16.0.2-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v16.0.1...v16.0.2-dev.1) (2023-10-06)

### Performance Improvements

* Use a map to merge integrations classes ([6059d3c](6059d3ca26))
2023-10-06 23:55:11 +00:00
oSumAtrIX
6059d3ca26 perf: Use a map to merge integrations classes 2023-10-07 01:52:21 +02:00
semantic-release-bot
444dee5a16 chore(release): 16.0.1 [skip ci]
## [16.0.1](https://github.com/ReVanced/revanced-patcher/compare/v16.0.0...v16.0.1) (2023-10-05)

### Bug Fixes

* Merge integrations when required ([06c2b76](06c2b76f11))
2023-10-05 15:31:28 +00:00
oSumAtrIX
d314466ce2 chore: Merge branch dev to main (#249) 2023-10-05 17:28:45 +02:00
semantic-release-bot
fdaf9c21c8 chore(release): 16.0.1-dev.1 [skip ci]
## [16.0.1-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v16.0.0...v16.0.1-dev.1) (2023-10-05)

### Bug Fixes

* Merge integrations when required ([06c2b76](06c2b76f11))
2023-10-05 15:27:34 +00:00
oSumAtrIX
06c2b76f11 fix: Merge integrations when required
Previous to this commit integrations were merged when not required.
2023-10-05 17:24:28 +02:00
semantic-release-bot
3896b30738 chore(release): 16.0.0 [skip ci]
# [16.0.0](https://github.com/ReVanced/revanced-patcher/compare/v15.0.3...v16.0.0) (2023-10-04)

### Bug Fixes

* Use correct super class type ([f590436](f590436399))

### BREAKING CHANGES

* This changes the super classes of some `PatchOptionException` classes
2023-10-04 02:18:27 +00:00
oSumAtrIX
2c4b88e1a0 chore: Merge branch dev to main (#248) 2023-10-04 04:15:04 +02:00
semantic-release-bot
dfc7e1596b chore(release): 16.0.0-dev.1 [skip ci]
# [16.0.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v15.0.3...v16.0.0-dev.1) (2023-10-04)

### Bug Fixes

* Use correct super class type ([f590436](f590436399))

### BREAKING CHANGES

* This changes the super classes of some `PatchOptionException` classes
2023-10-04 02:06:03 +00:00
oSumAtrIX
f590436399 fix: Use correct super class type
BREAKING CHANGE: This changes the super classes of some `PatchOptionException` classes
2023-10-04 04:02:10 +02:00
semantic-release-bot
cbfb9ba02f chore(release): 15.0.3 [skip ci]
## [15.0.3](https://github.com/ReVanced/revanced-patcher/compare/v15.0.2...v15.0.3) (2023-10-01)

### Bug Fixes

* Fix SMALI compilation on devices with RTL language ([#242](https://github.com/ReVanced/revanced-patcher/issues/242)) ([356f1f1](356f1f1553))
2023-10-01 16:58:40 +00:00
oSumAtrIX
b4cfe80ad5 chore: Merge branch dev to main (#243) 2023-10-01 18:56:02 +02:00
semantic-release-bot
b37906fa35 chore(release): 15.0.3-dev.1 [skip ci]
## [15.0.3-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v15.0.2...v15.0.3-dev.1) (2023-09-29)

### Bug Fixes

* Fix SMALI compilation on devices with RTL language ([#242](https://github.com/ReVanced/revanced-patcher/issues/242)) ([356f1f1](356f1f1553))
2023-09-29 13:18:47 +00:00
LisoUseInAIKyrios
356f1f1553 fix: Fix SMALI compilation on devices with RTL language (#242) 2023-09-29 15:15:14 +02:00
semantic-release-bot
e882af74ee chore(release): 15.0.2 [skip ci]
## [15.0.2](https://github.com/ReVanced/revanced-patcher/compare/v15.0.1...v15.0.2) (2023-09-27)

### Performance Improvements

* Do not unnecessary resolve fingeprints twice ([#241](https://github.com/ReVanced/revanced-patcher/issues/241)) ([4d6e08a](4d6e08a650))
2023-09-27 21:27:32 +00:00
oSumAtrIX
46875fb28e chore: Merge branch dev to main (#238) 2023-09-27 23:23:46 +02:00
oSumAtrIX
417c3e4234 ci: Bump checkout action 2023-09-27 18:02:50 +02:00
semantic-release-bot
6d2c28807b chore(release): 15.0.2-dev.1 [skip ci]
## [15.0.2-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v15.0.1...v15.0.2-dev.1) (2023-09-26)

### Performance Improvements

* Do not unnecessary resolve fingeprints twice ([#241](https://github.com/ReVanced/revanced-patcher/issues/241)) ([4d6e08a](4d6e08a650))
2023-09-26 12:25:00 +00:00
LisoUseInAIKyrios
4d6e08a650 perf: Do not unnecessary resolve fingeprints twice (#241) 2023-09-26 14:21:43 +02:00
oSumAtrIX
5cebc1fd30 ci: Use better workflow name and PR message 2023-09-23 18:17:47 +02:00
semantic-release-bot
ac61731dc6 chore(release): 15.0.1 [skip ci]
## [15.0.1](https://github.com/ReVanced/revanced-patcher/compare/v15.0.0...v15.0.1) (2023-09-20)

### Bug Fixes

* Remove log management ([d51bc32](d51bc32e37))
2023-09-20 03:19:14 +00:00
oSumAtrIX
9e4ffabd5c chore: merge branch dev to main (#235) 2023-09-20 05:16:25 +02:00
semantic-release-bot
3f410bd39f chore(release): 15.0.1-dev.1 [skip ci]
## [15.0.1-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v15.0.0...v15.0.1-dev.1) (2023-09-20)

### Bug Fixes

* Remove log management ([d51bc32](d51bc32e37))
2023-09-20 03:16:04 +00:00
oSumAtrIX
d51bc32e37 fix: Remove log management
Changing the logging behaviour caused unintended behaviour outside of the library.
2023-09-19 05:09:19 +02:00
oSumAtrIX
b7f6aa94cc chore: Fix inline docs reference 2023-09-19 05:08:37 +02:00
semantic-release-bot
ff965e6953 chore(release): 15.0.0 [skip ci]
# [15.0.0](https://github.com/ReVanced/revanced-patcher/compare/v14.2.2...v15.0.0) (2023-09-18)

### Bug Fixes

* Account for source patch dependency for tests ([6918418](69184187d9))
* Always make the generated patch depend on the source patch ([8de3063](8de30633ae))
* Catch correct exception ([637d487](637d48746f))
* Delegate `PatchBundleLoader` by mutable set of patches ([9a109c1](9a109c129b))
* Do not resolve the proxied patch to the proxy in the dependency list ([e112837](e11283744a))
* Do not set `CompatiblePackage.versions` if `@CompatiblePackage.versions` is empty ([6b1e0a1](6b1e0a1656))
* Filter for patches correctly ([4bc4b0d](4bc4b0dc01))
* Find dependency in `context.allPatches` ([670f015](670f0153de))
* Log the correct patch names ([9fdb8f0](9fdb8f087f))
* Make `CompatiblePackage.versions` a property ([67b7dff](67b7dff67a))
* Print patch name instead of class name ([4e7811e](4e7811ea07))
* Print stack trace of exception ([aa71146](aa71146b1b))
* Run code-block if `executablePatches` does not yet contain `patch` ([1d7aeca](1d7aeca696))
* Suppress logger when loading patches in `PatchBundleLoader` ([72c9eb2](72c9eb2129))
* Use correct module name ([080fbe9](080fbe9feb))

### Code Refactoring

* Internalize processor constructor ([a802d0d](a802d0df46))

* feat Use `Set` as super type for `PatchBundleLoader` ([4b76d19](4b76d19596))
* feat!: Add patch annotation processor ([3fc6a13](3fc6a139ee))
* feat!: Remove patch annotations ([3b4db3d](3b4db3ddb7))

### Features

* Add patch annotation processor ([#231](https://github.com/ReVanced/revanced-patcher/issues/231)) ([a29931f](a29931f2ec))

### BREAKING CHANGES

* This gets rid of the public constructor.
* `PatchBundleLoader` is not a map anymore
* This renames packages and the Maven package.
* The manifest for patches has been removed, and the properties have been added to patches. Patches are now `OptionsContainer`. The `@Patch` annotation has been removed in favour of the `@Patch` annotation from the annotation processor.
* Patch annotations have been removed. PatcherException is now thrown in various places. PatchBundleLoader is now a map of patches associated by their name. Patches are now instances.
2023-09-18 15:44:01 +00:00
oSumAtrIX
468d5d7421 chore: merge branch dev to main (#232) 2023-09-18 17:40:24 +02:00
semantic-release-bot
fc95b28c49 chore(release): 15.0.0-dev.4 [skip ci]
# [15.0.0-dev.4](https://github.com/ReVanced/revanced-patcher/compare/v15.0.0-dev.3...v15.0.0-dev.4) (2023-09-13)

### Bug Fixes

* Account for source patch dependency for tests ([6918418](69184187d9))
* Always make the generated patch depend on the source patch ([8de3063](8de30633ae))
* Catch correct exception ([637d487](637d48746f))
* Delegate `PatchBundleLoader` by mutable set of patches ([9a109c1](9a109c129b))
* Do not resolve the proxied patch to the proxy in the dependency list ([e112837](e11283744a))
* Do not set `CompatiblePackage.versions` if `@CompatiblePackage.versions` is empty ([6b1e0a1](6b1e0a1656))
* Filter for patches correctly ([4bc4b0d](4bc4b0dc01))
* Find dependency in `context.allPatches` ([670f015](670f0153de))
* Log the correct patch names ([9fdb8f0](9fdb8f087f))
* Print patch name instead of class name ([4e7811e](4e7811ea07))
* Print stack trace of exception ([aa71146](aa71146b1b))
* Run code-block if `executablePatches` does not yet contain `patch` ([1d7aeca](1d7aeca696))
* Suppress logger when loading patches in `PatchBundleLoader` ([72c9eb2](72c9eb2129))

### Code Refactoring

* Internalize processor constructor ([a802d0d](a802d0df46))

### BREAKING CHANGES

* This gets rid of the public constructor.
2023-09-13 03:44:27 +00:00
oSumAtrIX
69184187d9 fix: Account for source patch dependency for tests 2023-09-13 05:40:59 +02:00
oSumAtrIX
a802d0df46 refactor: Internalize processor constructor
BREAKING CHANGE: This gets rid of the public constructor.
2023-09-13 05:32:40 +02:00
oSumAtrIX
8de30633ae fix: Always make the generated patch depend on the source patch 2023-09-13 05:18:28 +02:00
oSumAtrIX
a1fbb7990f refactor: Simplify fingerprint resolution 2023-09-13 04:13:38 +02:00
oSumAtrIX
aa71146b1b fix: Print stack trace of exception
Otherwise the log will not include what originally raised the exception.
2023-09-13 03:58:46 +02:00
oSumAtrIX
9fdb8f087f fix: Log the correct patch names 2023-09-13 03:35:39 +02:00
oSumAtrIX
670f0153de fix: Find dependency in context.allPatches 2023-09-13 03:06:40 +02:00
oSumAtrIX
1d7aeca696 fix: Run code-block if executablePatches does not yet contain patch 2023-09-13 03:06:19 +02:00
oSumAtrIX
4e7811ea07 fix: Print patch name instead of class name 2023-09-13 03:05:37 +02:00
oSumAtrIX
e11283744a fix: Do not resolve the proxied patch to the proxy in the dependency list
If a patch is used as a dependency, it would be present in `dependencyResolutionMap`. If that patch would also be annotated, then the generated patch would depend on itself.
2023-09-13 03:05:06 +02:00
oSumAtrIX
91cdfd53ef refactor: Simplify accessing the patches from PatcherContext.executablePatches 2023-09-13 02:22:31 +02:00
oSumAtrIX
bc7d6b9941 refactor: Rename unused destructed parameter to _ 2023-09-13 02:17:54 +02:00
oSumAtrIX
6b1e0a1656 fix: Do not set CompatiblePackage.versions if @CompatiblePackage.versions is empty 2023-09-13 02:17:24 +02:00
oSumAtrIX
72c9eb2129 fix: Suppress logger when loading patches in PatchBundleLoader 2023-09-13 02:11:51 +02:00
oSumAtrIX
4bc4b0dc01 fix: Filter for patches correctly 2023-09-13 01:52:15 +02:00
oSumAtrIX
637d48746f fix: Catch correct exception 2023-09-13 01:51:46 +02:00
oSumAtrIX
9a109c129b fix: Delegate PatchBundleLoader by mutable set of patches 2023-09-13 01:36:53 +02:00
oSumAtrIX
d49e4ee5ea refactor: Remove unused logger 2023-09-13 00:08:52 +02:00
semantic-release-bot
30f0ea29a3 chore(release): 15.0.0-dev.3 [skip ci]
# [15.0.0-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v15.0.0-dev.2...v15.0.0-dev.3) (2023-09-06)

### Bug Fixes

* Make `CompatiblePackage.versions` a property ([67b7dff](67b7dff67a))
* Use correct module name ([080fbe9](080fbe9feb))

* feat Use `Set` as super type for `PatchBundleLoader` ([4b76d19](4b76d19596))

### BREAKING CHANGES

* `PatchBundleLoader` is not a map anymore
* This renames packages and the Maven package.
2023-09-06 12:32:05 +00:00
oSumAtrIX
49930f6565 chore: Use correct resource names for tests 2023-09-06 14:27:51 +02:00
oSumAtrIX
909d89fa8d chore: Print correct error message 2023-09-06 14:23:26 +02:00
oSumAtrIX
81d1d7f544 refactor: Do not reify generic type 2023-09-06 06:34:38 +02:00
oSumAtrIX
67b7dff67a fix: Make CompatiblePackage.versions a property 2023-09-06 06:12:44 +02:00
oSumAtrIX
4b76d19596 feat Use Set as super type for PatchBundleLoader
BREAKING CHANGE: `PatchBundleLoader` is not a map anymore
2023-09-06 06:12:22 +02:00
oSumAtrIX
080fbe9feb fix: Use correct module name
BREAKING CHANGE: This renames packages and the Maven package.
2023-09-06 06:11:15 +02:00
semantic-release-bot
d3721229bf chore(release): 15.0.0-dev.2 [skip ci]
# [15.0.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v15.0.0-dev.1...v15.0.0-dev.2) (2023-09-06)
2023-09-06 03:36:03 +00:00
oSumAtrIX
86c1c9c772 build(Needs bump): Use correct Maven repository URL 2023-09-06 05:32:58 +02:00
oSumAtrIX
c299817193 feat!: Use Kotlin DSL for patch options (#234) 2023-09-06 02:53:31 +02:00
semantic-release-bot
fcc1de45ed chore(release): 15.0.0-dev.1 [skip ci]
# [15.0.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v14.2.2...v15.0.0-dev.1) (2023-09-04)

* feat!: Add patch annotation processor ([3fc6a13](3fc6a139ee))
* feat!: Remove patch annotations ([3b4db3d](3b4db3ddb7))

### Features

* Add patch annotation processor ([#231](https://github.com/ReVanced/revanced-patcher/issues/231)) ([a29931f](a29931f2ec))

### BREAKING CHANGES

* The manifest for patches has been removed, and the properties have been added to patches. Patches are now `OptionsContainer`. The `@Patch` annotation has been removed in favour of the `@Patch` annotation from the annotation processor.
* Patch annotations have been removed. PatcherException is now thrown in various places. PatchBundleLoader is now a map of patches associated by their name. Patches are now instances.
2023-09-04 03:51:04 +00:00
oSumAtrIX
a29931f2ec feat: Add patch annotation processor (#231) 2023-09-04 05:48:20 +02:00
oSumAtrIX
3fc6a139ee feat!: Add patch annotation processor
This commit introduces an annotation processor for patches. Patches can use the `@Patch` instead of super constructor parameters.

BREAKING CHANGE: The manifest for patches has been removed, and the properties have been added to patches. Patches are now `OptionsContainer`. The `@Patch` annotation has been removed in favour of the `@Patch` annotation from the annotation processor.
2023-09-04 05:43:41 +02:00
oSumAtrIX
4dd04975d9 refactor: Move ReVanced Patcher to sub-project
This allows other sub-projects to exist.
2023-09-04 05:37:13 +02:00
oSumAtrIX
3b4db3ddb7 feat!: Remove patch annotations
Annotations required reflection and working with them turned out to be rather cumbersome. The annotations have been replaced with properties for the most part.

BREAKING CHANGE: Patch annotations have been removed. PatcherException is now thrown in various places. PatchBundleLoader is now a map of patches associated by their name. Patches are now instances.
2023-09-04 05:24:29 +02:00
semantic-release-bot
c4a7117ee8 chore(release): 14.2.2 [skip ci]
## [14.2.2](https://github.com/ReVanced/revanced-patcher/compare/v14.2.1...v14.2.2) (2023-08-30)

### Bug Fixes

* allow setting `DexClassLoader.optimizedDirectory` ([11a3378](11a3378659))
2023-08-30 17:25:12 +00:00
oSumAtrIX
b4e900fde8 chore: merge branch dev to main (#226) 2023-08-30 19:22:46 +02:00
semantic-release-bot
9818d730e4 chore(release): 14.2.2-dev.1 [skip ci]
## [14.2.2-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v14.2.1...v14.2.2-dev.1) (2023-08-29)

### Bug Fixes

* allow setting `DexClassLoader.optimizedDirectory` ([11a3378](11a3378659))
2023-08-29 02:12:54 +00:00
oSumAtrIX
11a3378659 fix: allow setting DexClassLoader.optimizedDirectory
This is required for API level below 26, otherwise an NPE is thrown
2023-08-29 04:09:17 +02:00
oSumAtrIX
1bb05f22d3 chore: add initial API dump
This is necessary for the binary compatibility validation.
2023-08-29 04:05:18 +02:00
oSumAtrIX
26b70554c4 build: use binary compatibility validator
This prevents releasing breaking changes accidentally.
2023-08-29 03:47:21 +02:00
oSumAtrIX
93b29d2e83 chore: assert instead of printing in tests 2023-08-29 03:38:11 +02:00
semantic-release-bot
072986374a chore(release): 14.2.1 [skip ci]
## [14.2.1](https://github.com/ReVanced/revanced-patcher/compare/v14.2.0...v14.2.1) (2023-08-27)

### Bug Fixes

* do not flag resource table as sparse when main package is not loaded ([b832812](b832812767))
2023-08-27 20:23:09 +00:00
oSumAtrIX
2c590d212a chore: merge branch dev to main (#225) 2023-08-27 22:21:36 +02:00
semantic-release-bot
6cc863efb3 chore(release): 14.2.1-dev.1 [skip ci]
## [14.2.1-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v14.2.0...v14.2.1-dev.1) (2023-08-27)

### Bug Fixes

* do not flag resource table as sparse when main package is not loaded ([b832812](b832812767))
2023-08-27 20:17:31 +00:00
oSumAtrIX
b832812767 fix: do not flag resource table as sparse when main package is not loaded 2023-08-27 22:14:43 +02:00
oSumAtrIX
c44558cacd build: bump dependencies
This fixes an issue with flagging the resource table with sparse incorrectly.
2023-08-27 22:14:11 +02:00
semantic-release-bot
6d83a720cd chore(release): 14.2.0 [skip ci]
# [14.2.0](https://github.com/ReVanced/revanced-patcher/compare/v14.1.0...v14.2.0) (2023-08-27)

### Features

* load patches in lexicographical order ([e8f2087](e8f2087a6f))
* log when merging integrations ([983563e](983563efb6))

### Performance Improvements

* compare types of classes ([55d6945](55d694579a))
2023-08-27 00:55:36 +00:00
oSumAtrIX
8d0dd9c448 chore: merge branch dev to main (#222) 2023-08-27 02:53:47 +02:00
oSumAtrIX
64020eec49 chore: add multi-threading opportunity notice 2023-08-26 20:58:19 +02:00
semantic-release-bot
4dedfb85cb chore(release): 14.2.0-dev.3 [skip ci]
# [14.2.0-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v14.2.0-dev.2...v14.2.0-dev.3) (2023-08-26)

### Performance Improvements

* compare types of classes ([55d6945](55d694579a))
2023-08-26 17:44:12 +00:00
oSumAtrIX
55d694579a perf: compare types of classes 2023-08-26 19:42:33 +02:00
semantic-release-bot
86db64edff chore(release): 14.2.0-dev.2 [skip ci]
# [14.2.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v14.2.0-dev.1...v14.2.0-dev.2) (2023-08-26)

### Features

* log when merging integrations ([983563e](983563efb6))
2023-08-26 17:16:08 +00:00
oSumAtrIX
983563efb6 feat: log when merging integrations 2023-08-26 19:14:29 +02:00
oSumAtrIX
37abb2db99 build: package the Java sources 2023-08-26 19:10:29 +02:00
semantic-release-bot
5ba0b47e60 chore(release): 14.2.0-dev.1 [skip ci]
# [14.2.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v14.1.0...v14.2.0-dev.1) (2023-08-25)

### Features

* load patches in lexicographical order ([e8f2087](e8f2087a6f))
2023-08-25 15:12:46 +00:00
oSumAtrIX
e8f2087a6f feat: load patches in lexicographical order
This feature was lost in past commits
2023-08-25 17:10:44 +02:00
semantic-release-bot
6ce99f5cdf chore(release): 14.1.0 [skip ci]
# [14.1.0](https://github.com/ReVanced/revanced-patcher/compare/v14.0.0...v14.1.0) (2023-08-24)

### Bug Fixes

* move version properties file to correct package ([e985676](e985676c2d))

### Features

* properly make use of logging facade ([ba56a6a](ba56a6a2ee))
2023-08-24 02:50:15 +00:00
oSumAtrIX
13c0c9cdd3 chore: merge branch dev to main (#220) 2023-08-24 04:48:39 +02:00
semantic-release-bot
58ffdb60d7 chore(release): 14.1.0-dev.1 [skip ci]
# [14.1.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v14.0.1-dev.1...v14.1.0-dev.1) (2023-08-24)

### Features

* properly make use of logging facade ([ba56a6a](ba56a6a2ee))
2023-08-24 02:45:16 +00:00
oSumAtrIX
ba56a6a2ee feat: properly make use of logging facade
This deprecates the primary constructor of `PatcherOptions` with the `logger` parameter
2023-08-24 04:43:16 +02:00
oSumAtrIX
ccccf5b1d2 build: migrate dependencies to version catalogs 2023-08-23 04:30:31 +02:00
semantic-release-bot
b507ac0a54 chore(release): 14.0.1-dev.1 [skip ci]
## [14.0.1-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v14.0.0...v14.0.1-dev.1) (2023-08-23)

### Bug Fixes

* move version properties file to correct package ([e985676](e985676c2d))
2023-08-23 01:39:26 +00:00
oSumAtrIX
e985676c2d fix: move version properties file to correct package 2023-08-23 03:36:48 +02:00
oSumAtrIX
f7f4ba6c55 build: update dependencies 2023-08-23 03:36:48 +02:00
semantic-release-bot
4292f43814 chore(release): 14.0.0 [skip ci]
# [14.0.0](https://github.com/ReVanced/revanced-patcher/compare/v13.0.0...v14.0.0) (2023-08-22)

### Bug Fixes

* log decoding resources after logging deleting resource cache directory ([db62a16](db62a1607b))
* only emit closed patches that did not throw an exception with the `@Patch` annotation ([5938f6b](5938f6b7ea))
* supply the parent classloader to `DexClassLoader` ([0f15077](0f15077225))

### Code Refactoring

* improve structure and public API ([6b8977f](6b8977f178))

### Features

* do not log instantiation of ReVanced Patcher ([273dd8d](273dd8d388))

### BREAKING CHANGES

* Various public APIs have been changed. The `Version` annotation has been removed. Patches do not return anything anymore and instead throw `PatchException`. Multiple patch bundles can now be loaded in a single ClassLoader to bypass class loader isolation.
2023-08-22 17:16:51 +00:00
oSumAtrIX
30bd4fd9fe chore: merge branch dev to main (#217) 2023-08-22 19:15:09 +02:00
120 changed files with 11856 additions and 5902 deletions

3
.editorconfig Normal file
View File

@@ -0,0 +1,3 @@
[*.{kt,kts}]
ktlint_code_style = intellij_idea
ktlint_standard_no-wildcard-imports = disabled

View File

@@ -1,72 +0,0 @@
name: 🐞 Bug report
description: Report a very clearly broken issue.
title: 'bug: <title>'
labels: [bug]
body:
- type: markdown
attributes:
value: |
# ReVanced bug report
Important to note that your issue may have already been reported before. Please check for existing issues [here](https://github.com/revanced/revanced-patcher/labels/bug).
- type: dropdown
attributes:
label: Type
options:
- Crash
- Cosmetic
- Other
validations:
required: true
- type: textarea
attributes:
label: Bug description
description: How did you find the bug? Any additional details that might help?
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: Add the steps to reproduce this bug including your environment.
placeholder: Step 1. Download some files. Step 2. ...
validations:
required: true
- type: textarea
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: true
- type: textarea
attributes:
label: Screenshots or videos
description: Add screenshots or videos that show the bug here.
placeholder: Drag and drop the screenshots/videos into this box.
validations:
required: false
- type: textarea
attributes:
label: Solution
description: If applicable, add a possible solution.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add additional context here.
validations:
required: false
- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Your issue will be closed if you haven't done these steps.
options:
- label: I have searched the existing issues and this is a new and no duplicate or related to another open issue.
required: true
- label: I have written a short but informative title.
required: true
- label: I filled out all of the requested information in this issue properly.
required: true

109
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,109 @@
name: 🐞 Bug report
description: Report a bug or an issue.
title: "bug: "
labels: ["Bug report"]
body:
- type: markdown
attributes:
value: |
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# ReVanced Patcher bug report
Before creating a new bug report, please keep the following in mind:
- **Do not submit a duplicate bug report**: Search for existing bug reports [here](https://github.com/ReVanced/revanced-patcher/issues?q=label%3A%22Bug+report%22).
- **Review the contribution guidelines**: Make sure your bug report adheres to it. You can find the guidelines [here](https://github.com/ReVanced/revanced-patcher/blob/main/CONTRIBUTING.md).
- **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app).
- type: textarea
attributes:
label: Bug description
description: |
- Describe your bug in detail
- Add steps to reproduce the bug if possible (Step 1. ... Step 2. ...)
- Add images and videos if possible
validations:
required: true
- type: textarea
attributes:
label: Error logs
description: Exceptions can be captured by running `logcat | grep AndroidRuntime` in a shell.
render: shell
- type: textarea
attributes:
label: Solution
description: If applicable, add a possible solution to the bug.
- type: textarea
attributes:
label: Additional context
description: Add additional context here.
- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Your bug report will be closed if you don't follow the checklist below.
options:
- label: I have checked all open and closed bug reports and this is not a duplicate.
required: true
- label: I have chosen an appropriate title.
required: true
- label: All requested information has been provided properly.
required: true

View File

@@ -1,58 +0,0 @@
name: ⭐ Feature request
description: Create a detailed feature request.
title: 'feat: <title>'
labels: [feature-request]
body:
- type: markdown
attributes:
value: |
# ReVanced feature request
Do not submit requests for patches here. Please submit them [here](https://github.com/orgs/revanced/discussions/categories/patches) instead.
Important to note that your feature request may have already been made before. Please check for existing feature requests [here](https://github.com/revanced/revanced-patcher/labels/feature-request).
- type: dropdown
attributes:
label: Type
options:
- Functionality
- Cosmetic
- Other
validations:
required: true
- type: textarea
attributes:
label: Issue
description: What is the current problem. Why does it require a feature request?
validations:
required: true
- type: textarea
attributes:
label: Feature
description: Describe your feature in detail. How does it solve the issue?
validations:
required: true
- type: textarea
attributes:
label: Motivation
description: Why should your feature should be considered?
validations:
required: true
- type: textarea
attributes:
label: Additional context
description: Add additional context here.
validations:
required: false
- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Your issue will be closed if you haven't done these steps.
options:
- label: I have searched the existing issues and this is a new and no duplicate or related to another open issue.
required: true
- label: I have written a short but informative title.
required: true
- label: I filled out all of the requested information in this issue properly.
required: true

View File

@@ -0,0 +1,107 @@
name: ⭐ Feature request
description: Create a detailed request for a new feature.
title: "feat: "
labels: ["Feature request"]
body:
- type: markdown
attributes:
value: |
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# ReVanced Patcher feature request
Before creating a new feature request, please keep the following in mind:
- **Do not submit a duplicate feature request**: Search for existing feature requests [here](https://github.com/ReVanced/revanced-patcher/issues?q=label%3A%22Feature+request%22).
- **Review the contribution guidelines**: Make sure your feature request adheres to it. You can find the guidelines [here](https://github.com/ReVanced/revanced-patcher/blob/main/CONTRIBUTING.md).
- **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app).
- type: textarea
attributes:
label: Feature description
description: |
- Describe your feature in detail
- Add images, videos, links, examples, references, etc. if possible
- Add the target application name in case you request a new patch
- type: textarea
attributes:
label: Motivation
description: |
A strong motivation is necessary for a feature request to be considered.
- Why should this feature be implemented?
- What is the explicit use case?
- What are the benefits?
- What makes this feature important?
validations:
required: true
- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Your feature request will be closed if you don't follow the checklist below.
options:
- label: I have checked all open and closed feature requests and this is not a duplicate.
required: true
- label: I have chosen an appropriate title.
required: true
- label: All requested information has been provided properly.
required: true

2
.github/config.yml vendored
View File

@@ -1,2 +1,2 @@
firstPRMergeComment: >
Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) if you want to receive a contributor role.
Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) to receive a role for your contribution.

22
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: github-actions
labels: []
directory: /
target-branch: dev
schedule:
interval: monthly
- package-ecosystem: npm
labels: []
directory: /
target-branch: dev
schedule:
interval: monthly
- package-ecosystem: gradle
labels: []
directory: /
target-branch: dev
schedule:
interval: monthly

View File

@@ -0,0 +1,25 @@
name: Build pull request
on:
workflow_dispatch:
pull_request:
branches:
- dev
jobs:
release:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Gradle
uses: burrunan/gradle-cache-action@v1
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build --no-daemon

View File

@@ -1,4 +1,4 @@
name: PR to main
name: Open a PR to main
on:
push:
@@ -7,7 +7,7 @@ on:
workflow_dispatch:
env:
MESSAGE: merge branch `${{ github.head_ref || github.ref_name }}` to `main`
MESSAGE: Merge branch `${{ github.head_ref || github.ref_name }}` to `main`
jobs:
pull-request:
@@ -15,7 +15,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Open pull request
uses: repo-sync/pull-request@v2
with:

View File

@@ -6,40 +6,48 @@ on:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
release:
name: Release
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Make sure the release step uses its own credentials:
# https://github.com/cycjimmy/semantic-release-action#private-packages
persist-credentials: false
fetch-depth: 0
- name: Cache
uses: actions/cache@v3
with:
path: |
${{ runner.home }}/.gradle/caches
${{ runner.home }}/.gradle/wrapper
.gradle
build
node_modules
key: ${{ runner.os }}-gradle-npm-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'package-lock.json') }}
- name: Build with Gradle
- name: Cache Gradle
uses: burrunan/gradle-cache-action@v1
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew clean --no-daemon
- name: Setup semantic-release
run: ./gradlew build clean
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ vars.GPG_FINGERPRINT }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm exec semantic-release

View File

@@ -0,0 +1,19 @@
name: Update documentation
on:
push:
paths:
- docs/**
jobs:
trigger:
runs-on: ubuntu-latest
name: Dispatch event to documentation repository
if: github.ref == 'refs/heads/main'
steps:
- uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.DOCUMENTATION_REPO_ACCESS_TOKEN }}
repository: revanced/revanced-documentation
event-type: update-documentation
client-payload: '{"repo": "${{ github.event.repository.name }}", "ref": "${{ github.ref }}"}'

View File

@@ -23,7 +23,8 @@
"assets": [
"CHANGELOG.md",
"gradle.properties"
]
],
"message": "chore: Release v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[

File diff suppressed because it is too large Load Diff

99
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,99 @@
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# 👋 Contribution guidelines
This document describes how to contribute to ReVanced Patcher.
## 📖 Resources to help you get started
- The [documentation](https://github.com/ReVanced/revanced-patcher/tree/docs/docs) contains the fundamentals
of ReVanced Patcher and how to use ReVanced Patcher to create patches
- [Our backlog](https://github.com/orgs/ReVanced/projects/12) is where we keep track of what we're working on
- [Issues](https://github.com/ReVanced/revanced-patcher/issues) are where we keep track of bugs and feature requests
## 🙏 Submitting a feature request
Features can be requested by opening an issue using the
[Feature request issue template](https://github.com/ReVanced/revanced-patcher/issues/new?assignees=&labels=Feature+request&projects=&template=feature_request.yml&title=feat%3A+).
> **Note**
> Requests can be accepted or rejected at the discretion of maintainers of ReVanced Patcher.
> Good motivation has to be provided for a request to be accepted.
## 🐞 Submitting a bug report
If you encounter a bug while using ReVanced Patcher, open an issue using the
[Bug report issue template](https://github.com/ReVanced/revanced-patcher/issues/new?assignees=&labels=Bug+report&projects=&template=bug_report.yml&title=bug%3A+).
## 📝 How to contribute
1. Before contributing, it is recommended to open an issue to discuss your change
with the maintainers of ReVanced Patcher. This will help you determine whether your change is acceptable
and whether it is worth your time to implement it
2. Development happens on the `dev` branch. Fork the repository and create your branch from `dev`
3. Commit your changes
4. Submit a pull request to the `dev` branch of the repository and reference issues
that your pull request closes in the description of your pull request
5. Our team will review your pull request and provide feedback. Once your pull request is approved,
it will be merged into the `dev` branch and will be included in the next release of ReVanced Patcher
❤️ Thank you for considering contributing to ReVanced Patcher,
ReVanced

122
README.md
View File

@@ -1,3 +1,125 @@
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# 💉 ReVanced Patcher
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-patcher/release.yml)
![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)
ReVanced Patcher used to patch Android applications.
## ❓ About
ReVanced Patcher is a library that is used to patch Android applications.
It powers [ReVanced Manager](https://github.com/ReVanced/revanced-manager),
[ReVanced CLI](https://github.com/ReVanced/revanced-cli)
and [ReVanced Library](https://github.com/ReVanced/revanced-library) and a rich set of patches have been developed
using ReVanced Patcher in the [ReVanced Patches](https://github.com/ReVanced/revanced-patches) repository.
## 💪 Features
Some of the features the ReVanced Patcher provides are:
- 🔧 **Patch Dalvik VM bytecode**: Disassemble and assemble Dalvik bytecode
- 📦 **Patch APK resources**: Decode and build Android APK resources
- 📂 **Patch arbitrary APK files**: Read and write arbitrary files directly from and to APK files
- 🧩 **Write modular patches**: Extensive API to write modular patches that can patch Dalvik VM bytecode,
APK resources and arbitrary APK files
## 🚀 How to get started
To use ReVanced Patcher in your project, follow these steps:
1. [Add the repository](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package)
to your project
2. Add the dependency to your project:
```kt
dependencies {
implementation("app.revanced:revanced-patcher:{$version}")
}
```
For a minimal project configuration,
see [ReVanced Patches template](https://github.com/ReVanced/revanced-patches-template).
## 📚 Everything else
### 📙 Contributing
Thank you for considering contributing to ReVanced Patcher.
You can find the contribution guidelines [here](CONTRIBUTING.md).
### 🛠️ Building
To build ReVanced Patcher,
you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation).
### 📃 Documentation
The documentation contains the fundamentals of ReVanced Patcher and how to use ReVanced Patcher to create patches.
You can find it [here](https://github.com/ReVanced/revanced-patcher/tree/main/docs).
## 📜 Licence
ReVanced Patcher is licensed under the GPLv3 license. Please see the [licence file](LICENSE) for more information.
[tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3) you may copy, distribute and modify ReVanced Patcher as long as you track changes/dates in source files.
Any modifications to ReVanced Patcher must also be made available under the GPL,
along with build & install instructions.

889
api/revanced-patcher.api Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,78 +1,119 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
kotlin("jvm") version "1.8.20"
alias(libs.plugins.kotlin)
alias(libs.plugins.binary.compatibility.validator)
`maven-publish`
signing
}
group = "app.revanced"
val githubUsername: String = project.findProperty("gpr.user") as? String ?: System.getenv("GITHUB_ACTOR")
val githubPassword: String = project.findProperty("gpr.key") as? String ?: System.getenv("GITHUB_TOKEN")
repositories {
mavenCentral()
google()
mavenLocal()
listOf("multidexlib2", "apktool").forEach { repo ->
maven {
url = uri("https://maven.pkg.github.com/revanced/$repo")
credentials {
username = githubUsername
password = githubPassword
}
}
}
}
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
implementation("xpp3:xpp3:1.1.4c")
implementation("com.android.tools.smali:smali:3.0.3")
implementation("app.revanced:multidexlib2:3.0.3.r2")
implementation("app.revanced:apktool-lib:2.8.2-5")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.8.22")
compileOnly("com.google.android:android:4.1.1.4")
testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.20-RC")
}
tasks {
processResources {
expand("projectVersion" to project.version)
}
test {
useJUnitPlatform()
testLogging {
events("PASSED", "SKIPPED", "FAILED")
}
}
processResources {
expand("projectVersion" to project.version)
}
repositories {
mavenCentral()
google()
maven {
// A repository must be specified for some reason. "registry" is a dummy.
url = uri("https://maven.pkg.github.com/revanced/registry")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
// TODO: Convert project to KMP.
compileOnly(libs.android) {
// Exclude, otherwise the org.w3c.dom API breaks.
exclude(group = "xerces", module = "xmlParserAPIs")
}
implementation(libs.apktool.lib)
implementation(libs.kotlin.reflect)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.multidexlib2)
implementation(libs.smali)
implementation(libs.xpp3)
testImplementation(libs.mockk)
testImplementation(libs.kotlin.test)
}
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
freeCompilerArgs = listOf("-Xcontext-receivers")
}
}
java {
withSourcesJar()
}
targetCompatibility = JavaVersion.VERSION_11
kotlin {
jvmToolchain(11)
withSourcesJar()
}
publishing {
repositories {
if (System.getenv("GITHUB_ACTOR") != null)
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
create<MavenPublication>("revanced-patcher-publication") {
from(components["java"])
version = project.version.toString()
pom {
name = "ReVanced Patcher"
description = "Patcher used by ReVanced."
url = "https://revanced.app"
licenses {
license {
name = "GNU General Public License v3.0"
url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
}
}
developers {
developer {
id = "ReVanced"
name = "ReVanced"
email = "contact@revanced.app"
}
}
scm {
connection = "scm:git:git://github.com/revanced/revanced-patcher.git"
developerConnection = "scm:git:git@github.com:revanced/revanced-patcher.git"
url = "https://github.com/revanced/revanced-patcher"
}
}
else
mavenLocal()
}
publications {
register<MavenPublication>("gpr") {
from(components["java"])
}
}
}
signing {
useGpgCmd()
sign(publishing.publications["revanced-patcher-publication"])
}

111
docs/1_patcher_intro.md Normal file
View File

@@ -0,0 +1,111 @@
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="../assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="../assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="../assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="../assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# 💉 Introduction to ReVanced Patcher
To create patches for Android apps, it is recommended to know the basic concept of ReVanced Patcher.
## 📙 How it works
ReVanced Patcher is a library that allows modifying Android apps by applying patches.
It is built on top of [Smali](https://github.com/google/smali) for bytecode manipulation and [Androlib (Apktool)](https://github.com/iBotPeaches/Apktool)
for resource decoding and encoding.
ReVanced Patcher receives a list of patches and applies them to a given APK file.
It then returns the modified components of the APK file, such as modified dex files and resources,
that can be repackaged into a new APK file.
ReVanced Patcher has a simple API that allows you to load patches from RVP (JAR or DEX container) files
and apply them to an APK file. Later on, you will learn how to create patches.
```kt
val patches = loadPatchesFromJar(setOf(File("revanced-patches.rvp")))
val patcherResult = Patcher(PatcherConfig(apkFile = File("some.apk"))).use { patcher ->
// Here you can access metadata about the APK file through patcher.context.packageMetadata
// such as package name, version code, version name, etc.
// Add patches.
patcher += patches
// Execute the patches.
runBlocking {
patcher().collect { patchResult ->
if (patchResult.exception != null)
logger.info { "\"${patchResult.patch}\" failed:\n${patchResult.exception}" }
else
logger.info { "\"${patchResult.patch}\" succeeded" }
}
}
// Compile and save the patched APK file components.
patcher.get()
}
// The result of the patcher contains the modified components of the APK file that can be repackaged into a new APK file.
val dexFiles = patcherResult.dexFiles
val resources = patcherResult.resources
```
## ⏭️ What's next
The next page teaches the fundamentals of ReVanced Patches.
Continue: [🧩 Introduction to ReVanced Patches](2_patches_intro.md)

112
docs/2_1_setup.md Normal file
View File

@@ -0,0 +1,112 @@
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="../assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="../assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="../assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="../assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# 👶 Setting up a development environment
To start developing patches with ReVanced Patcher, you must prepare a development environment.
## 📝 Prerequisites
- A Java IDE with Kotlin support, such as [IntelliJ IDEA](https://www.jetbrains.com/idea/)
- Knowledge of Java, [Kotlin](https://kotlinlang.org), and [Dalvik bytecode](https://source.android.com/docs/core/runtime/dalvik-bytecode)
- Android reverse engineering skills and tools such as [jadx](https://github.com/skylot/jadx)
## 🏃 Prepare the environment
Throughout the documentation, [ReVanced Patches](https://github.com/revanced/revanced-patches) will be used as an example project.
> [!NOTE]
> To start a fresh project,
> you can use the [ReVanced Patches template](https://github.com/revanced/revanced-patches-template).
1. Clone the repository
```bash
git clone https://github.com/revanced/revanced-patches && cd revanced-patches
```
2. Build the project
```bash
./gradlew build
```
> [!NOTE]
> If the build fails due to authentication, you may need to authenticate to GitHub Packages.
> Create a PAT with the scope `read:packages` [here](https://github.com/settings/tokens/new?scopes=read:packages&description=ReVanced) and add your token to ~/.gradle/gradle.properties.
>
> Example `gradle.properties` file:
>
> ```properties
> gpr.user = user
> gpr.key = key
> ```
3. Open the project in your IDE
> [!TIP]
> It is a good idea to set up a complete development environment for ReVanced, so that you can also test your patches
> by following the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation).
## ⏭️ What's next
The next page will go into details about a ReVanced patch.
Continue: [🧩 Anatomy of a patch](2_2_patch_anatomy.md)

File diff suppressed because it is too large Load Diff

262
docs/2_2_patch_anatomy.md Normal file

File diff suppressed because it is too large Load Diff

126
docs/2_patches_intro.md Normal file
View File

@@ -0,0 +1,126 @@
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="../assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="../assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="../assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="../assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# 🧩 Introduction to ReVanced Patches
Learn the basic concepts of ReVanced Patcher and how to create patches.
## 📙 Fundamentals
A patch is a piece of code that modifies an Android application.
There are multiple types of patches. Each type can modify a different part of the APK, such as the Dalvik VM bytecode,
the APK resources, or arbitrary files in the APK:
- A `BytecodePatch` modifies the Dalvik VM bytecode
- A `ResourcePatch` modifies (decoded) resources
- A `RawResourcePatch` modifies arbitrary files
Each patch can declare a set of dependencies on other patches. ReVanced Patcher will first execute dependencies
before executing the patch itself. This way, multiple patches can work together for abstract purposes in a modular way.
The `execute` function is the entry point for a patch. It is called by ReVanced Patcher when the patch is executed.
The `execute` function receives an instance of a context object that provides access to the APK.
The patch can use this context to modify the APK.
Each type of context provides different APIs to modify the APK. For example, the `BytecodePatchContext` provides APIs
to modify the Dalvik VM bytecode, while the `ResourcePatchContext` provides APIs to modify resources.
The difference between `ResourcePatch` and `RawResourcePatch` is that ReVanced Patcher will decode the resources
if it is supplied a `ResourcePatch` for execution or if any patch depends on a `ResourcePatch`
and will not decode the resources before executing `RawResourcePatch`.
Both, `ResourcePatch` and `RawResourcePatch` can modify arbitrary files in the APK,
whereas only `ResourcePatch` can modify decoded resources. The choice of which type to use depends on the use case.
Decoding and building resources is a time- and resource-consuming,
so if the patch does not need to modify decoded resources, it is better to use `RawResourcePatch` or `BytecodePatch`.
Example of patches:
```kt
@Surpress("unused")
val bytecodePatch = bytecodePatch {
execute {
// More about this on the next page of the documentation.
}
}
@Surpress("unused")
val rawResourcePatch = rawResourcePatch {
execute {
// More about this on the next page of the documentation.
}
}
@Surpress("unused")
val resourcePatch = resourcePatch {
execute {
// More about this on the next page of the documentation.
}
}
```
> [!TIP]
> To see real-world examples of patches,
> check out the repository for [ReVanced Patches](https://github.com/revanced/revanced-patches).
## ⏭️ Whats next
The next page will guide you through creating a development environment for creating patches.
Continue: [👶 Setting up a development environment](2_1_setup.md)

View File

@@ -0,0 +1,105 @@
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="../assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="../assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="../assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="../assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# 📜 Project structure and conventions
Over time, a specific project structure and conventions have been established.
## 📁 File structure
Patches are organized in a specific way. The file structure looks as follows:
```text
📦your.patches.app.category
├ 🔍Fingerprints.kt
└ 🧩SomePatch.kt
```
> [!NOTE]
> Moving fingerprints to a separate file isn't strictly necessary, but it helps the organization when a patch uses multiple fingerprints.
## 📙 Conventions
- 🔥 Name a patch after what it does. For example, if a patch removes ads, name it `Remove ads`.
If a patch changes the color of a button, name it `Change button color`
- 🔥 Write the patch description in the third person, present tense, and end it with a period.
If a patch removes ads, the description can be omitted because of redundancy,
but if a patch changes the color of a button, the description can be _Changes the color of the resume button to red._
- 🔥 Write patches with modularity and reusability in mind. Patches can depend on each other,
so it is important to write patches in a way that can be used in different contexts.
- 🔥🔥 Keep patches as minimal as possible. This reduces the risk of failing patches.
Instead of involving many abstract changes in one patch or writing entire methods or classes in a patch,
you can write code in extensions. An extension is a precompiled DEX file that is merged into the patched app
before this patch is executed.
Patches can then reference methods and classes from extensions.
A real-world example of extensions can be found in the [ReVanced Patches](https://github.com/ReVanced/revanced-patches) repository
- 🔥🔥🔥 Do not overload a fingerprint with information about a method that's likely to change.
In the example of an obfuscated method, it's better to fingerprint the method by its return type
and parameters rather than its name because the name is likely to change. An intelligent selection
of an opcode pattern or strings in a method can result in a strong fingerprint dynamic to app updates.
- 🔥🔥🔥 Document your patches. Patches are abstract, so it is important to document parts of the code
that are not self-explanatory. For example, explain why and how a certain method is patched or large blocks
of instructions that are modified or added to a method
## ⏭️ What's next
The next page discusses useful APIs for patch development.
Continue: [💪 Advanced APIs](4_apis.md)

117
docs/4_apis.md Normal file
View File

@@ -0,0 +1,117 @@
# 💪 Advanced APIs
A handful of APIs are available to make patch development easier and more efficient.
## 📙 Overview
1. 👹 Create mutable replacements of classes with `proxy(ClassDef)`
2. 🔍 Find and create mutable replaces with `classBy(Predicate)`
3. 🏃‍ Navigate method calls recursively by index with `navigate(Method)`
4. 💾 Read and write resource files with `get(String, Boolean)` and `delete(String)`
5. 📃 Read and write DOM files using `document(String)` and `document(InputStream)`
### 🧰 APIs
#### 👹 `proxy(ClassDef)`
By default, the classes are immutable, meaning they cannot be modified.
To make a class mutable, use the `proxy(ClassDef)` function.
This function creates a lazy mutable copy of the class definition.
Accessing the property will replace the original class definition with the mutable copy,
thus allowing you to make changes to the class. Subsequent accesses will return the same mutable copy.
```kt
execute {
val mutableClass = proxy(classDef)
mutableClass.methods.add(Method())
}
```
#### 🔍 `classBy(Predicate)`
The `classBy(Predicate)` function is an alternative to finding and creating mutable classes by a predicate.
It automatically proxies the class definition, making it mutable.
```kt
execute {
// Alternative to proxy(classes.find { it.name == "Lcom/example/MyClass;" })?.classDef
val classDef = classBy { it.name == "Lcom/example/MyClass;" }?.classDef
}
```
#### 🏃‍ `navigate(Method).at(index)`
The `navigate(Method)` function allows you to navigate method calls recursively by index.
```kt
execute {
// Sequentially navigate to the instructions at index 1 within 'someMethod'.
val method = navigate(someMethod).to(1).original() // original() returns the original immutable method.
// Further navigate to the second occurrence where the instruction's opcode is 'INVOKEVIRTUAL'.
// stop() returns the mutable copy of the method.
val method = navigate(someMethod).to(2) { instruction -> instruction.opcode == Opcode.INVOKEVIRTUAL }.stop()
// Alternatively, to stop(), you can delegate the method to a variable.
val method by navigate(someMethod).to(1)
// You can chain multiple calls to at() to navigate deeper into the method.
val method by navigate(someMethod).to(1).to(2, 3, 4).to(5)
}
```
#### 💾 `get(String, Boolean)` and `delete(String)`
The `get(String, Boolean)` function returns a `File` object that can be used to read and write resource files.
```kt
execute {
val file = get("res/values/strings.xml")
val content = file.readText()
file.writeText(content)
}
```
The `delete` function can mark files for deletion when the APK is rebuilt.
```kt
execute {
delete("res/values/strings.xml")
}
```
#### 📃 `document(String)` and `document(InputStream)`
The `document` function is used to read and write DOM files.
```kt
execute {
document("res/values/strings.xml").use { document ->
val element = doc.createElement("string").apply {
textContent = "Hello, World!"
}
document.documentElement.appendChild(element)
}
}
```
You can also read documents from an `InputStream`:
```kt
execute {
val inputStream = classLoader.getResourceAsStream("some.xml")
document(inputStream).use { document ->
// ...
}
}
```
## 🎉 Afterword
ReVanced Patcher is a powerful library to patch Android applications, offering a rich set of APIs to develop patches
that outlive app updates. Patches make up ReVanced; without you, the community of patch developers,
ReVanced would not be what it is today. We hope that this documentation has been helpful to you
and are excited to see what you will create with ReVanced Patcher. If you have any questions or need help,
talk to us on one of our platforms linked on [revanced.app](https://revanced.app) or open an issue in case of a bug or
feature request,
ReVanced

73
docs/README.md Normal file
View File

@@ -0,0 +1,73 @@
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="../assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="../assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="../assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="../assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# 💉 Documentation of ReVanced Patcher
This documentation contains the fundamentals of ReVanced Patcher and how to use ReVanced Patcher to create patches
## 📖 Table of content
1. [💉 Introduction to ReVanced Patcher](1_patcher_intro.md)
2. [🧩 Introduction to ReVanced Patches](2_patches_intro.md)
1. [👶 Setting up a development environment](2_1_setup.md)
2. [🧩 Anatomy of a ReVanced patch](2_2_patch_anatomy.md)
1. [🔎 Fingerprinting](2_2_1_fingerprinting.md)
3. [📜 Project structure and conventions](3_structure_and_conventions.md)
4. [💪 Advanced APIs](4_apis.md)

View File

@@ -1,4 +1,3 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 14.0.0-dev.4
version = 21.1.0-dev.4

27
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,27 @@
[versions]
android = "4.1.1.4"
apktool-lib = "2.10.1.1"
binary-compatibility-validator = "0.15.1"
kotlin = "2.0.20"
kotlinx-coroutines-core = "1.8.1"
mockk = "1.13.10"
multidexlib2 = "3.0.3.r3"
# Tracking https://github.com/google/smali/issues/64.
#noinspection GradleDependency
smali = "3.0.8"
xpp3 = "1.1.4c"
[libraries]
android = { module = "com.google.android:android", version.ref = "android" }
apktool-lib = { module = "app.revanced:apktool-lib", version.ref = "apktool-lib" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines-core" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
multidexlib2 = { module = "app.revanced:multidexlib2", version.ref = "multidexlib2" }
smali = { module = "com.android.tools.smali:smali", version.ref = "smali" }
xpp3 = { module = "xpp3:xpp3", version.ref = "xpp3" }
[plugins]
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary-compatibility-validator" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }

Binary file not shown.

View File

@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

Some files were not shown because too many files have changed in this diff Show More