1
mirror of https://github.com/revanced/revanced-patcher synced 2025-09-06 16:38:50 +02:00

Compare commits

..

186 Commits

Author SHA1 Message Date
semantic-release-bot
d971239997 chore(release): 1.0.0-dev.18 [skip ci]
# [1.0.0-dev.18](https://github.com/revanced/revanced-patcher/compare/v1.0.0-dev.17...v1.0.0-dev.18) (2022-06-04)

### Features

* `Dependencies` annotation ([83d608a](83d608ac06))
* optional `forStaticMethod` parameter for `InlineSmaliCompiler.compileMethodInstructions` ([28b9847](28b98478e4))
2022-06-04 00:28:58 +00:00
oSumAtrIX
28b98478e4 feat: optional forStaticMethod parameter for InlineSmaliCompiler.compileMethodInstructions 2022-06-04 02:25:13 +02:00
oSumAtrIX
83d608ac06 feat: Dependencies annotation 2022-06-03 17:49:31 +02:00
semantic-release-bot
b369a30dd5 chore(release): 1.0.0-dev.17 [skip ci]
# [1.0.0-dev.17](https://github.com/revanced/revanced-patcher/compare/v1.0.0-dev.16...v1.0.0-dev.17) (2022-05-31)

### Features

* patch dependencies annotation and `PatcherOptions` ([8442991](8442991290))
2022-05-31 23:41:12 +00:00
oSumAtrIX
8442991290 feat: patch dependencies annotation and PatcherOptions 2022-06-01 01:33:30 +02:00
semantic-release-bot
a06c0db6a7 chore(release): 1.0.0-dev.16 [skip ci]
# [1.0.0-dev.16](https://github.com/revanced/revanced-patcher/compare/v1.0.0-dev.15...v1.0.0-dev.16) (2022-05-27)

### Bug Fixes

* `JarPatchBundle` loading non-class files to class loader ([3f0c740](3f0c740200))
* remove dependency to fork of Apktool ([0fa529f](0fa529fcdf))

### Features

* migrate to `DexPatchBundle` and `JarPatchBundle` ([7573db2](7573db2575))
2022-05-27 12:30:13 +00:00
oSumAtrIX
3f0c740200 fix: JarPatchBundle loading non-class files to class loader 2022-05-27 14:26:06 +02:00
oSumAtrIX
545c5c144d chore: update gradlew wrapper 2022-05-26 03:52:28 +02:00
oSumAtrIX
0fa529fcdf fix: remove dependency to fork of Apktool 2022-05-26 03:51:25 +02:00
oSumAtrIX
7573db2575 feat: migrate to DexPatchBundle and JarPatchBundle
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-26 01:02:41 +02:00
semantic-release-bot
70ca184cf9 chore(release): 1.0.0-dev.15 [skip ci]
# [1.0.0-dev.15](https://github.com/revanced/revanced-patcher/compare/v1.0.0-dev.14...v1.0.0-dev.15) (2022-05-25)

### Features

* utility functions to get metadata of patch & sigs ([72f16b7](72f16b7785))
2022-05-25 20:55:57 +00:00
Lucaskyy
72f16b7785 feat: utility functions to get metadata of patch & sigs 2022-05-25 22:54:20 +02:00
Lucaskyy
fc03639b26 chore: fix typo 2022-05-25 22:52:57 +02:00
semantic-release-bot
88a85f94e7 chore(release): 1.0.0-dev.14 [skip ci]
# [1.0.0-dev.14](https://github.com/revanced/revanced-patcher/compare/v1.0.0-dev.13...v1.0.0-dev.14) (2022-05-24)

### Bug Fixes

* reformat (trigger release) ([45a167e](45a167e785))
2022-05-24 18:12:32 +00:00
Lucaskyy
45a167e785 fix: reformat (trigger release) 2022-05-24 20:11:04 +02:00
Lucaskyy
699d8abf59 refactor: use apktool fork
also fixed some compilation issues
2022-05-24 17:43:43 +02:00
semantic-release-bot
b58c718699 chore(release): 1.0.0-dev.13 [skip ci]
# [1.0.0-dev.13](https://github.com/revanced/revanced-patcher/compare/v1.0.0-dev.12...v1.0.0-dev.13) (2022-05-24)

### Performance Improvements

* decode manifest only when not using resource patcher ([40b1fa4](40b1fa43e1))
2022-05-24 00:11:23 +00:00
oSumAtrIX
266d6810a9 refactor: use resourceData.get(path) instead of a reader/writer
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-24 01:41:48 +02:00
oSumAtrIX
40b1fa43e1 perf: decode manifest only when not using resource patcher
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-24 01:28:31 +02:00
oSumAtrIX
94f9594eed chore: update kotlin jvm
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-24 00:16:57 +02:00
oSumAtrIX
cff58ab180 refactor: improve ExampleResourcePatch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-23 20:58:03 +02:00
oSumAtrIX
989646b0b5 chore: update dependencies
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-23 20:56:17 +02:00
semantic-release-bot
5c3fbaee7a chore(release): 1.0.0-dev.12 [skip ci]
# [1.0.0-dev.12](https://github.com/revanced/revanced-patcher/compare/v1.0.0-dev.11...v1.0.0-dev.12) (2022-05-22)

### Bug Fixes

* using old instance of `Androlib` when saving ([5630e49](5630e49663))
2022-05-22 15:23:09 +00:00
oSumAtrIX
08525e9c26 Merge remote-tracking branch 'origin/dev' into dev 2022-05-22 17:21:50 +02:00
oSumAtrIX
5630e49663 fix: using old instance of Androlib when saving
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-22 17:21:18 +02:00
semantic-release-bot
0543122427 chore(release): 1.0.0-dev.11 [skip ci]
# [1.0.0-dev.11](https://github.com/revanced/revanced-patcher/compare/v1.0.0-dev.10...v1.0.0-dev.11) (2022-05-22)

### Features

* `PatchLoader` ([1a99eca](1a99ecaffe))
* use annotations instead of metadata objects ([6726884](6726884be5))
2022-05-22 15:17:31 +00:00
oSumAtrIX
0873703056 Merge pull request #33 from revanced/annotations
feat: use annotations instead of metadata objects
2022-05-22 17:14:48 +02:00
oSumAtrIX
1a99ecaffe feat: PatchLoader
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-22 17:12:46 +02:00
oSumAtrIX
6726884be5 feat: use annotations instead of metadata objects
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-22 13:46:20 +02:00
semantic-release-bot
8b4f3947f8 chore(release): 1.0.0-dev.10 [skip ci]
# [1.0.0-dev.10](https://github.com/revanced/revanced-patcher/compare/v1.0.0-dev.9...v1.0.0-dev.10) (2022-05-07)

### Bug Fixes

* qualifying `Element` with wrong package ([4d74de4](4d74de4061))
2022-05-07 19:37:18 +00:00
oSumAtrIX
4d74de4061 fix: qualifying Element with wrong package
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-07 21:36:05 +02:00
oSumAtrIX
4fbee7d255 Merge remote-tracking branch 'origin/dev' into dev 2022-05-07 21:25:37 +02:00
oSumAtrIX
fd9f639605 chore: bump java-version for action setup-java
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-07 21:25:18 +02:00
semantic-release-bot
9084ccc2a2 chore(release): 1.0.0-dev.9 [skip ci]
# [1.0.0-dev.9](https://github.com/revanced/revanced-patcher/compare/v1.0.0-dev.8...v1.0.0-dev.9) (2022-05-07)

### Bug Fixes

* `compareSignatureToMethod` not matching correctly in case opcodes are null ([5ae5e98](5ae5e98f1f))
* `ConcurrentModificationException` while iterating through `proxies` and modifying it ([bfeeaf4](bfeeaf4435))
* `PackageMetadata` ([305a817](305a81793a))
* `replaceWith` not replacing classes with used class proxies ([f0f3403](f0f34031dd))
* adding existing classes to the patchers cache ([4281546](4281546f69))
* always return PatchResultSuccess on patch success ([866b03a](866b03af21))
* applying no patches throwing error ([f88c118](f88c11820d))
* applyPatches not returning successful patches ([8b70bb4](8b70bb4290))
* Classes not being written properly because of array shifting ([1471956](147195647c))
* failing tests temporarily ([66b08f8](66b08f8b3a))
* fix classes having multiple instances of fields ([b711b80](b711b8001e))
* fix classes having multiple method instances ([12c10d8](12c10d8c64))
* Fixed writer & signature resolver, improved tests & speed, minor refactoring ([bb42fa3](bb42fa3c6f))
* fuzzy resolver warning params were turned around ([d49df10](d49df10a3c))
* incorrect pattern offset ([03700ff](03700ffa51))
* make `methodMetadata` nullable in `MethodSignatureMetadata` ([864e38c](864e38c069))
* make warnings nullable instead of lateinit ([04b49b8](04b49b8b66))
* match to correct signature method parameters ([c49071a](c49071aff7))
* MethodSignature#resolved throwing an exception ([82b1e66](82b1e66d54))
* Move proxy package out of cache package ([6bc4e7e](6bc4e7eab7))
* null check causing an exception ([560c485](560c485ab0))
* Patcher not writing resolved methods ([d15240d](d15240d033))
* reaching all constructors not possible ([37fa994](37fa9949ec))
* remove leftover debug code ([4458141](4458141d6d))
* return mutable set of classes ([84bc7e0](84bc7e0dc7))
* returning failure on success ([3b68d5c](3b68d5c65e))
* Search method map for existing class proxy ([d5e694c](d5e694c306))
* string signature in `SignatureResolver` ([ac36d19](ac36d19693))
* Suppress unused for addFiles ([a0d6d46](a0d6d46217))
* throwing in case the opcode patterns do not match ([f72dd68](f72dd68ec5))
* use Array instead of Iterable for methodParameters ([312235b](312235b194))
* write all classes ([6ad51aa](6ad51aad9a))

### Code Refactoring

* bump multidexlib2 to 2.5.2.r2 ([32e6458](32e645850d))
* Change all references from Array to Iterable ([264989f](264989f488))

### Features

* add `MethodWalker` ([659e108](659e1087c9))
* add `p` naming scheme to smali compiler ([38556d6](38556d61ab))
* add extensions for cloning methods ([df7503b](df7503b47b))
* add findClass method with className ([78235d1](78235d1abe))
* Add first tests ([6767c8f](6767c8fbc1))
* add fuzzy resolver ([a492808](a492808021))
* add immutableMethod ([eed1cfd](eed1cfda7b))
* add inline smali compiler ([dbafe2a](dbafe2ab37))
* add missing test for fields ([4022b8b](4022b8b847))
* add or extension for AccessFlags ([aec5eeb](aec5eeb597))
* Add patch metadata ([8544fc4](8544fc4cbc)), closes [ReVancedTeam/revanced-patches#1](https://github.com/ReVancedTeam/revanced-patches/issues/1)
* Add warnings for Fuzzy resolver ([643a14e](643a14e664))
* allow classes to be overwritten in addFiles and resolve signatures when applyPatches is called ([5f71a34](5f71a342ac))
* Allow unknown opcodes using `null` ([f4a47d4](f4a47d4dc8))
* Finish first patcher test ([a9e4e8a](a9e4e8ac32))
* Improve `SignatureResolver` ([88a6a27](88a6a27302))
* migrate to dexlib ([be51f42](be51f42710))
* Minor refactor and return proxy, if class has been proxied already ([2d3c611](2d3c61113d))
* properly manage `ClassProxy` & add `ProxyBackedClassList` ([2319787](23197879b2))
* remaining mutable `EncodedValue` classes ([7d38bb0](7d38bb0baa))
* string signature ([#22](https://github.com/revanced/revanced-patcher/issues/22)) ([c245edb](c245edb0c5))

### Performance Improvements

* depend on `androlib` instead of `ApkDecoder` ([e5c054a](e5c054ac2f))
* do not resolve empty signatures list ([1f7bf3a](1f7bf3ac6c))
* lazy-ify all mutable clones ([05e4400](05e44007d8))
* optimize indexOf call away ([f8e978a](f8e978af88))
* use Set instead of List since there are no dupes ([6221387](622138736d))
* use String List and compare instead of any lambda ([aed4fd9](aed4fd9a3c))

### Reverts

* AccessFlag extensions not working with IDE ([e161f7f](e161f7fea4))
* previous commits check for dupes in dexFile, not cache ([433914f](433914feda))

### BREAKING CHANGES

* arrayOf has to be changed to listOf.
* Method signature of Patcher#save() was changed to comply with the changes of multidexlib2.
* Removed usage of ASM library
2022-05-07 03:19:37 +00:00
oSumAtrIX
83a8a48176 Merge pull request #16 from revanced/dalvik-patcher
feat: Dalvik patcher
2022-05-07 05:17:23 +02:00
oSumAtrIX
66b08f8b3a fix: failing tests temporarily
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-07 05:13:53 +02:00
oSumAtrIX
e286ba5090 Merge remote-tracking branch 'origin/dalvik-patcher' into dalvik-patcher 2022-05-07 05:07:35 +02:00
oSumAtrIX
e5c054ac2f perf: depend on androlib instead of ApkDecoder
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-07 05:07:27 +02:00
oSumAtrIX
cb0741d05f Merge pull request #30 from j4k0xb/dalvik-patcher
Add `p` naming scheme to smali compiler
2022-05-07 02:34:05 +02:00
j4k0xb
38556d61ab feat: add p naming scheme to smali compiler 2022-05-07 02:22:18 +02:00
oSumAtrIX
ce8021b482 Merge pull request #29 from autergame/dalvik-patcher
Replace ReVancedTeam with revanced in build.gradle.kts
2022-05-07 01:22:14 +02:00
autergame
243dba7751 Replace ReVancedTeam with revanced in build.gradle.kts 2022-05-06 20:17:10 -03:00
oSumAtrIX
698f759979 Merge pull request #28 from ReVancedTeam/resource-patcher
add: resource patcher
2022-05-04 23:59:04 +02:00
oSumAtrIX
1701da3dde add: resource patcher
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-05-04 23:46:04 +02:00
oSumAtrIX
37fa9949ec fix: reaching all constructors not possible
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-27 03:13:45 +02:00
oSumAtrIX
ac36d19693 fix: string signature in SignatureResolver
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-20 02:45:50 +02:00
oSumAtrIX
c245edb0c5 feat: string signature (#22)
* feat: string signature

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>

* fix: signature in test

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>

* fix: make string signature optional

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>

* fix: use of `compareOpcodes` when comparing string signatures

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>

* add: `PackageMetadata` for signatures

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-19 21:51:50 +02:00
oSumAtrIX
1f7bf3ac6c perf: do not resolve empty signatures list
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-19 20:17:56 +02:00
oSumAtrIX
bfeeaf4435 fix: ConcurrentModificationException while iterating through proxies and modifying it
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-19 20:07:31 +02:00
oSumAtrIX
748d0abad0 refactor: resolve signatures automatically
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-19 19:54:59 +02:00
oSumAtrIX
569238ab76 add: applyProxies method
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-19 19:47:35 +02:00
oSumAtrIX
23197879b2 feat: properly manage ClassProxy & add ProxyBackedClassList
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-18 21:37:57 +02:00
oSumAtrIX
305a81793a fix: PackageMetadata
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-18 18:41:46 +02:00
oSumAtrIX
33f9211f98 add: PackageMetadata for signatures
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-18 18:24:56 +02:00
oSumAtrIX
864e38c069 fix: make methodMetadata nullable in MethodSignatureMetadata
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-18 03:43:08 +02:00
oSumAtrIX
659e1087c9 feat: add MethodWalker
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-17 18:43:54 +02:00
Lucaskyy
03700ffa51 fix: incorrect pattern offset 2022-04-16 21:38:06 +02:00
Lucaskyy
ae06d826e8 docs: fix improper docs for fuzzy resolver Warning 2022-04-15 10:38:24 +02:00
oSumAtrIX
5ca5188fc2 refactor: better naming for resolver warning parameters
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-15 08:51:56 +02:00
oSumAtrIX
f88c11820d fix: applying no patches throwing error
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-15 06:03:08 +02:00
oSumAtrIX
93e81ff047 refact: better parameter names for Warning
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-15 04:59:10 +02:00
Lucaskyy
d49df10a3c fix: fuzzy resolver warning params were turned around 2022-04-14 20:51:48 +02:00
Lucaskyy
04b49b8b66 fix: make warnings nullable instead of lateinit 2022-04-14 19:26:43 +02:00
Lucaskyy
5ddc63f979 refactor: remove all parameter names 2022-04-14 19:11:55 +02:00
Lucaskyy
82b1e66d54 fix: MethodSignature#resolved throwing an exception 2022-04-14 19:11:38 +02:00
Lucaskyy
fd630cd429 test: Add tests for unknown opcodes 2022-04-14 18:37:43 +02:00
Lucaskyy
f4a47d4dc8 feat: Allow unknown opcodes using null
This is the same as `??` in IDA signatures.
2022-04-14 18:29:37 +02:00
Lucaskyy
3bfc24fc16 chore: remove todo 2022-04-14 18:23:26 +02:00
Lucaskyy
25bba2c1d8 refactor: remove all @Suppression's 2022-04-14 16:45:16 +02:00
Lucaskyy
4dea27e831 refactor: format code 2022-04-14 16:44:02 +02:00
Lucaskyy
a0d6d46217 fix: Suppress unused for addFiles 2022-04-14 16:42:51 +02:00
Lucaskyy
643a14e664 feat: Add warnings for Fuzzy resolver 2022-04-14 16:42:16 +02:00
Lucaskyy
355e6d82cc docs: fix wrong wording 2022-04-14 12:33:31 +02:00
Lucaskyy
df7503b47b feat: add extensions for cloning methods 2022-04-14 12:31:38 +02:00
Lucaskyy
a01dded092 test: fix outdated test 2022-04-14 12:02:40 +02:00
Lucaskyy
9ae95174e6 refactor: replace asInstructions with toInstruction to follow proper naming scheme 2022-04-14 12:00:50 +02:00
Lucaskyy
e161f7fea4 revert: AccessFlag extensions not working with IDE 2022-04-14 11:59:23 +02:00
Lucaskyy
200e3c9fdb refactor: replace Array with Iterable 2022-04-14 11:53:08 +02:00
oSumAtrIX
f0f34031dd fix: replaceWith not replacing classes with used class proxies
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-14 11:00:25 +02:00
oSumAtrIX
560c485ab0 fix: null check causing an exception
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-14 10:44:15 +02:00
oSumAtrIX
cc5a414692 add: throw on getting result of MethodSignature if null
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-14 09:44:32 +02:00
oSumAtrIX
c2a334eb3f refact: include each signature in its corresponding patch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-14 08:48:05 +02:00
Lucaskyy
1b2fbbca26 refactor: rename method to resolverMethod 2022-04-13 21:04:26 +02:00
Lucaskyy
4458141d6d fix: remove leftover debug code 2022-04-13 20:26:43 +02:00
Lucaskyy
8544fc4cbc feat: Add patch metadata
Fixes ReVancedTeam/revanced-patches#1
2022-04-13 20:25:51 +02:00
Lucaskyy
a492808021 feat: add fuzzy resolver
fixed docs for MethodSignature & added tests for fuzzy resolver
2022-04-13 20:17:31 +02:00
Lucaskyy
0204eee79e refactor: migrate signature schema changes to Patcher
also updated Extensions, for good measure.
2022-04-13 19:42:50 +02:00
oSumAtrIX
4022b8b847 feat: add missing test for fields
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-13 02:59:06 +02:00
oSumAtrIX
8daf877fac style: reformat code
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-04-13 02:47:53 +02:00
oSumAtrIX
7d38bb0baa feat: remaining mutable EncodedValue classes 2022-04-13 00:19:09 +02:00
Lucaskyy
5f71a342ac feat: allow classes to be overwritten in addFiles and resolve signatures when applyPatches is called 2022-04-12 19:11:07 +02:00
Lucaskyy
866b03af21 fix: always return PatchResultSuccess on patch success 2022-04-11 17:34:43 +02:00
Lucaskyy
4c1a42b216 add: optional callback for CLI 2022-04-11 17:27:12 +02:00
Lucaskyy
264989f488 refactor: Change all references from Array to Iterable
BREAKING CHANGE: arrayOf has to be changed to listOf.
2022-04-11 16:29:53 +02:00
oSumAtrIX
4281546f69 fix: adding existing classes to the patchers cache 2022-04-11 03:52:04 +02:00
Lucaskyy
af4f2396c7 chore: update kotlin, don't shade deps, publish to maven local, make deps api instead of implementation 2022-04-10 00:52:32 +02:00
Lucaskyy
147195647c fix: Classes not being written properly because of array shifting
We now use a MutableList to replace it at the proper index, and use a ListBackedSet, so we don't copy List's to Set's for no reason.
This was a very bad issue. The array was shifted every time we removed the original class, the fact we even got a "working" dex file surprises me. Thankfully, this issue is now solved, and we lived happily after.
2022-04-09 23:41:54 +02:00
Lucaskyy
433914feda revert: previous commits check for dupes in dexFile, not cache
This reverts commit aed4fd9a3c.
This reverts commit 622138736d.
2022-04-09 22:46:24 +02:00
Lucaskyy
622138736d perf: use Set instead of List since there are no dupes 2022-04-09 22:31:32 +02:00
Lucaskyy
aed4fd9a3c perf: use String List and compare instead of any lambda 2022-04-09 22:04:00 +02:00
Lucaskyy
32e645850d refactor: bump multidexlib2 to 2.5.2.r2
BREAKING CHANGE: Method signature of Patcher#save() was changed to comply with the changes of multidexlib2.
2022-04-09 20:33:22 +02:00
Lucaskyy
e45fc02aae ci: Fix Unauthorized error 2022-04-09 19:38:21 +02:00
Lucaskyy
e0d29cf450 refactor: bump multidexlib2, dexlib2 and smali 2022-04-09 18:20:12 +02:00
oSumAtrIX
2b888e381c add: addFiles method to merge additional dex containers 2022-04-09 04:51:31 +02:00
oSumAtrIX
f72dd68ec5 fix: throwing in case the opcode patterns do not match 2022-04-09 04:50:38 +02:00
Lucaskyy
3b68d5c65e fix: returning failure on success
oh wow, that's an oopsie
2022-04-09 00:03:21 +02:00
Lucaskyy
eed1cfda7b feat: add immutableMethod
added docs
2022-04-08 23:51:31 +02:00
Lucaskyy
8b70bb4290 fix: applyPatches not returning successful patches 2022-04-08 23:50:26 +02:00
Lucaskyy
dbda641d0c chore: format code 2022-04-08 23:28:32 +02:00
oSumAtrIX
5ae5e98f1f fix: compareSignatureToMethod not matching correctly in case opcodes are null 2022-04-08 23:25:44 +02:00
Lucaskyy
1ba40ab1cb refactor: make method a property 2022-04-08 23:15:40 +02:00
Lucaskyy
e9c119ebb1 refactor: cleanup SignatureResolver.kt 2022-04-08 22:59:20 +02:00
Lucaskyy
1bd6d1d5b8 test: fix test with previous changes 2022-04-08 22:59:03 +02:00
Lucaskyy
4e7378bd79 refactor: rename resolveAndGetMethod to method 2022-04-08 22:58:39 +02:00
Lucaskyy
28ed4793e3 refactor: cleanup Patcher.kt 2022-04-08 22:56:24 +02:00
Lucaskyy
312235b194 fix: use Array instead of Iterable for methodParameters 2022-04-08 22:55:40 +02:00
Lucaskyy
6ab21e5891 chore: move replace extension method to Extensions.kt 2022-04-08 22:55:12 +02:00
Lucaskyy
db8d1150c3 docs: fixup 2022-04-08 22:54:23 +02:00
Lucaskyy
8f778f38fe chore: publish jar with dependencies 2022-04-08 22:49:37 +02:00
oSumAtrIX
88a6a27302 feat: Improve SignatureResolver 2022-04-08 18:19:48 +02:00
oSumAtrIX
a9e4e8ac32 feat: Finish first patcher test 2022-04-06 23:10:52 +02:00
oSumAtrIX
d5e694c306 fix: Search method map for existing class proxy 2022-04-06 23:09:58 +02:00
oSumAtrIX
dde0a22642 add: MutableMethodImplementation.addInstructions extension 2022-04-06 23:09:16 +02:00
oSumAtrIX
9a67aa3ff4 add: TODO for mutable encoded value clones 2022-04-06 23:08:31 +02:00
oSumAtrIX
e69708f21e refactor: lazy initialize implementation field for mutable methods 2022-04-06 19:37:29 +02:00
oSumAtrIX
c49071aff7 fix: match to correct signature method parameters 2022-04-06 19:36:44 +02:00
oSumAtrIX
d15240d033 fix: Patcher not writing resolved methods 2022-04-06 19:36:02 +02:00
oSumAtrIX
6767c8fbc1 feat: Add first tests 2022-04-06 02:15:40 +02:00
oSumAtrIX
4543b36616 refactor: Improve SignatureResolver 2022-04-06 01:25:45 +02:00
oSumAtrIX
ec6d462ade refactor: Use String instead of CharSequence for method parameter signature 2022-04-06 01:25:10 +02:00
oSumAtrIX
84bc7e0dc7 fix: return mutable set of classes 2022-04-06 01:23:53 +02:00
oSumAtrIX
6ad51aad9a fix: write all classes 2022-04-05 04:45:43 +02:00
oSumAtrIX
b711b8001e fix: fix classes having multiple instances of fields 2022-04-05 03:54:16 +02:00
oSumAtrIX
12c10d8c64 fix: fix classes having multiple method instances 2022-04-05 03:52:00 +02:00
Lucaskyy
05e44007d8 perf: lazy-ify all mutable clones 2022-04-03 23:52:36 +02:00
Lucaskyy
dbafe2ab37 feat: add inline smali compiler 2022-04-03 23:51:01 +02:00
Lucaskyy
45a885dbde test: use findClass with className & cleanup 2022-03-31 23:22:57 +02:00
Lucaskyy
78235d1abe feat: add findClass method with className 2022-03-31 23:22:14 +02:00
Lucaskyy
aec5eeb597 feat: add or extension for AccessFlags 2022-03-31 22:46:46 +02:00
Lucaskyy
d98c9eeb30 style: reformat code 2022-03-31 22:46:12 +02:00
Lucaskyy
f8e978af88 perf: optimize indexOf call away 2022-03-31 22:45:22 +02:00
oSumAtrIX
86cb053566 docs: Document important parts of the code 2022-03-31 19:25:46 +02:00
oSumAtrIX
c1ccb70de4 refactor: Replacing original classes with mutated ones 2022-03-31 18:56:36 +02:00
oSumAtrIX
bb42fa3c6f fix: Fixed writer & signature resolver, improved tests & speed, minor refactoring 2022-03-31 18:37:35 +02:00
oSumAtrIX
2d3c61113d feat: Minor refactor and return proxy, if class has been proxied already 2022-03-30 19:15:00 +02:00
oSumAtrIX
6bc4e7eab7 fix: Move proxy package out of cache package 2022-03-30 15:12:47 +02:00
oSumAtrIX
be51f42710 feat: migrate to dexlib
BREAKING CHANGE: Removed usage of ASM library
2022-03-30 15:10:18 +02:00
semantic-release-bot
fa0412985c chore(release): 1.0.0-dev.8 [skip ci]
# [1.0.0-dev.8](https://github.com/ReVancedTeam/revanced-patcher/compare/v1.0.0-dev.7...v1.0.0-dev.8) (2022-03-24)

### Performance Improvements

* check type instead of class ([47eb493](47eb493f54))
2022-03-24 22:38:45 +00:00
Lucaskyy
0048788dd0 Merge remote-tracking branch 'origin/dev' into dev 2022-03-24 23:37:34 +01:00
Lucaskyy
47eb493f54 perf: check type instead of class
this is way better, thank you oSumAtrIX!
2022-03-24 23:37:28 +01:00
semantic-release-bot
6b1337e4fc chore(release): 1.0.0-dev.7 [skip ci]
# [1.0.0-dev.7](https://github.com/ReVancedTeam/revanced-patcher/compare/v1.0.0-dev.6...v1.0.0-dev.7) (2022-03-24)

### Bug Fixes

* **MethodResolver:** fix cd57a8c9a0 ([1af31b2](1af31b2aa3))
2022-03-24 22:31:58 +00:00
Lucaskyy
f4589db3a9 test: fix assert message 2022-03-24 23:31:01 +01:00
Lucaskyy
1af31b2aa3 fix(MethodResolver): fix cd57a8c9a0 2022-03-24 23:29:32 +01:00
semantic-release-bot
14f7667156 chore(release): 1.0.0-dev.6 [skip ci]
# [1.0.0-dev.6](https://github.com/ReVancedTeam/revanced-patcher/compare/v1.0.0-dev.5...v1.0.0-dev.6) (2022-03-24)

### Bug Fixes

* **MethodResolver:** strip labels nodes so opcode patterns match ([cd57a8c](cd57a8c9a0))
2022-03-24 21:49:47 +00:00
Lucaskyy
cd57a8c9a0 fix(MethodResolver): strip labels nodes so opcode patterns match
this commit is also a fix for 8d1bb5f3d9 because it corrupted the stack by completely removing the nodes
2022-03-24 22:48:34 +01:00
Lucaskyy
0d3beb353d Merge remote-tracking branch 'origin/dev' into dev 2022-03-24 21:38:22 +01:00
Lucaskyy
ddef338631 refactor: log as trace instead of debug
so there's less spam in console
2022-03-24 21:38:13 +01:00
semantic-release-bot
fc4b673087 chore(release): 1.0.0-dev.5 [skip ci]
# [1.0.0-dev.5](https://github.com/ReVancedTeam/revanced-patcher/compare/v1.0.0-dev.4...v1.0.0-dev.5) (2022-03-24)

### Bug Fixes

* **MethodResolver:** strip labels and line numbers so opcode patterns match ([8d1bb5f](8d1bb5f3d9))
2022-03-24 20:30:54 +00:00
Lucaskyy
8d1bb5f3d9 fix(MethodResolver): strip labels and line numbers so opcode patterns match 2022-03-24 21:27:44 +01:00
Lucaskyy
c8a017a4c0 refactor: only compute maxs and use existing stack frames 2022-03-24 19:45:13 +01:00
semantic-release-bot
51fb59a43c chore(release): 1.0.0-dev.4 [skip ci]
# [1.0.0-dev.4](https://github.com/ReVancedTeam/revanced-patcher/compare/v1.0.0-dev.3...v1.0.0-dev.4) (2022-03-23)

### Bug Fixes

* give ClassWriter a ClassReader for symtable ([e8f6973](e8f6973938))
2022-03-23 22:02:18 +00:00
Lucaskyy
a78715133c Merge remote-tracking branch 'origin/dev' into dev 2022-03-23 23:01:20 +01:00
Lucaskyy
e8f6973938 fix: give ClassWriter a ClassReader for symtable
removed SafeClassWriter as it was unused
2022-03-23 23:01:13 +01:00
semantic-release-bot
3cb1e01587 chore(release): 1.0.0-dev.3 [skip ci]
# [1.0.0-dev.3](https://github.com/ReVancedTeam/revanced-patcher/compare/v1.0.0-dev.2...v1.0.0-dev.3) (2022-03-23)

### Features

* add SafeClassWriter ([ca6b94d](ca6b94d943))
2022-03-23 21:34:05 +00:00
Lucaskyy
cb4ee207e1 Merge remote-tracking branch 'origin/dev' into dev 2022-03-23 22:32:58 +01:00
Lucaskyy
ca6b94d943 feat: add SafeClassWriter
the standard ClassWriter implementation uses the ClassLoader to find a common superclass. this won't work for us since we are not loading the JAR into the classpath. using this SafeClassWriter should fix that issue.
2022-03-23 22:32:50 +01:00
semantic-release-bot
6cdb6887d4 chore(release): 1.0.0-dev.2 [skip ci]
# [1.0.0-dev.2](https://github.com/ReVancedTeam/revanced-patcher/compare/v1.0.0-dev.1...v1.0.0-dev.2) (2022-03-23)

### Bug Fixes

* set marklimit to Integer.MAX_VALUE ([ab6453c](ab6453ca8a))
2022-03-23 21:10:02 +00:00
Lucaskyy
ab6453ca8a fix: set marklimit to Integer.MAX_VALUE 2022-03-23 22:08:51 +01:00
semantic-release-bot
e8182c17ad chore(release): 1.0.0-dev.1 [skip ci]
# 1.0.0-dev.1 (2022-03-23)

### Bug Fixes

* avoid ignoring test resources (fixes [#1](https://github.com/ReVancedTeam/revanced-patcher/issues/1)) ([d5a3c76](d5a3c76389))
* current must be calculated after increment ([5f12bab](5f12bab5df))
* **gradle:** publish source and javadocs ([87bbde5](87bbde5e06))
* **Io:** fix finding classes by name ([460d62a](460d62a24c))
* **Io:** JAR loading and saving ([#8](https://github.com/ReVancedTeam/revanced-patcher/issues/8)) ([4d98cbc](4d98cbc9e8))
* nullable signature members ([#10](https://github.com/ReVancedTeam/revanced-patcher/issues/10)) ([8db8893](8db8893ab1))
* Patch should have access to the Cache ([6c0f082](6c0f0823c9))
* remove broken code ([0e72a6e](0e72a6e85f))
* set index for insertAt to 0 by default ([1769132](1769132a9e))
* workflow on dev branch ([7e67daf](7e67daf878))

### Code Refactoring

* convert Patch to abstract class ([23e897a](23e897a7a9))
* Optimize Signature class ([#11](https://github.com/ReVancedTeam/revanced-patcher/issues/11)) ([49beec9](49beec9fc6))
* Rename `net.revanced` to `app.revanced` ([3ab42a9](3ab42a932c))

### Features

* Add `findParentMethod` utility method ([#4](https://github.com/ReVancedTeam/revanced-patcher/issues/4)) ([00c6ab7](00c6ab7faf))

### BREAKING CHANGES

* Array<Int> was changed to IntArray. This breaks existing patches.
* Package name was changed from "net.revanced" to "app.revanced"
* Method signature of execute() was changed to include the cache, this will break existing implementations of the Patch class.
* Patch class is now an abstract class. You must implement it. You can use anonymous implements, like done in the tests.
2022-03-23 19:01:41 +00:00
Lucaskyy
49beec9fc6 refactor: Optimize Signature class (#11)
BREAKING CHANGE: Array<Int> was changed to IntArray. This breaks existing patches.
2022-03-23 20:00:35 +01:00
Lucaskyy
3ab42a932c refactor: Rename net.revanced to app.revanced
BREAKING CHANGE: Package name was changed from "net.revanced" to "app.revanced"
2022-03-23 19:56:37 +01:00
oSumAtrIX
4d98cbc9e8 fix(Io): JAR loading and saving (#8)
* refactor: Complete rewrite of `Io`

* style: format code

* style: rewrite todos

* fix: use lateinit instead of nonnull assert for zipEntry

* fix: use lateinit instead of nonnull assert for jarEntry & reuse zipEntry

* docs: add docs to `Patcher`

* test: match output of patcher

* chore: add todo to `Io` for removing non-class files

Co-authored-by: Sculas <contact@sculas.xyz>
2022-03-23 19:56:35 +01:00
Lucaskyy
87bbde5e06 fix(gradle): publish source and javadocs 2022-03-23 19:56:34 +01:00
oSumAtrIX
8db8893ab1 fix: nullable signature members (#10)
This commit will allow "partial" signatures, basically we will be allowed to exclude members to match for the signature
2022-03-23 19:56:33 +01:00
oSumAtrIX
00c6ab7faf feat: Add findParentMethod utility method (#4)
* feat: Add `findParentMethod` utitly method

* refactor: add `resolveMethod` to `MethodResolver`

added some assertions and some tests

Co-authored-by: Lucaskyy <contact@sculas.xyz>
2022-03-23 19:56:31 +01:00
Bleuzen
460d62a24c fix(Io): fix finding classes by name 2022-03-23 19:55:40 +01:00
Lucaskyy
89e4b9f762 chore: push IntelliJ project files 2022-03-23 19:55:39 +01:00
Lucaskyy
a8fd7c00c3 refactor: target java 8 instead of java 17 2022-03-23 19:55:38 +01:00
Lucaskyy
1769132a9e fix: set index for insertAt to 0 by default 2022-03-23 19:55:37 +01:00
Lucaskyy
6c0f0823c9 fix: Patch should have access to the Cache
BREAKING CHANGE: Method signature of execute() was changed to include the cache, this will break existing implementations of the Patch class.
2022-03-23 19:55:35 +01:00
Lucaskyy
23e897a7a9 refactor: convert Patch to abstract class
BREAKING CHANGE: Patch class is now an abstract class. You must implement it. You can use anonymous implements, like done in the tests.
2022-03-23 19:55:34 +01:00
Lucaskyy
7e67daf878 fix: workflow on dev branch 2022-03-20 20:42:55 +01:00
Lucaskyy
593c83f29f style: remove tab 2022-03-20 20:39:47 +01:00
Sculas
72e123dd01 Merge pull request #3 from ReVancedTeam/ci-semantic-release
ci: add semantic-release
2022-03-20 20:34:31 +01:00
she11sh0cked
599a401ed9 ci: add gradle-semantic-release-plugin and remove the github release assets 2022-03-20 19:32:20 +01:00
she11sh0cked
3f8500b059 ci: add semantic-release 2022-03-20 19:03:05 +01:00
130 changed files with 2344 additions and 17596 deletions

View File

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

9
.gitattributes vendored
View File

@@ -1,9 +0,0 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf
# These are Windows script files and should use crlf
*.bat text eol=crlf

View File

@@ -1,109 +0,0 @@
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,8 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: 📃 Documentation
url: https://github.com/revanced/revanced-documentation/
about: Don't know how or where to start? Check out our documentation!
- name: 🗨 Discussions
url: https://github.com/revanced/revanced-suggestions/discussions
about: Got something you think should change or be added? Search for or start a new discussion!

View File

@@ -1,107 +0,0 @@
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 +0,0 @@
firstPRMergeComment: >
Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) to receive a role for your contribution.

View File

@@ -1,22 +0,0 @@
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

@@ -1,25 +0,0 @@
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,26 +0,0 @@
name: Open a PR to main
on:
push:
branches:
- dev
workflow_dispatch:
env:
MESSAGE: Merge branch `${{ github.head_ref || github.ref_name }}` to `main`
jobs:
pull-request:
name: Open pull request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Open pull request
uses: repo-sync/pull-request@v2
with:
destination_branch: 'main'
pr_title: 'chore: ${{ env.MESSAGE }}'
pr_body: 'This pull request will ${{ env.MESSAGE }}.'
pr_draft: true

View File

@@ -1,53 +1,42 @@
name: Release
on:
workflow_dispatch:
push:
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@v4
uses: actions/checkout@v2
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 Gradle
uses: burrunan/gradle-cache-action@v1
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build clean
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v2
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: Make gradlew executable
run: chmod +x gradlew
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build
- name: Setup semantic-release
run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin -D
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm exec semantic-release
run: npx semantic-release

View File

@@ -1,19 +0,0 @@
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 }}"}'

7
.gitignore vendored
View File

@@ -74,7 +74,6 @@ cmake-build-*/
# IntelliJ
out/
.idea/
# mpeltonen/sbt-idea plugin
.idea_modules/
@@ -116,9 +115,3 @@ gradle-app.setting
# Avoid ignoring test resources
!src/test/resources/*
# Dependency directories
node_modules/
# Gradle props, to avoid sharing the gpr key
gradle.properties

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

10
.idea/codeStyles/Project.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View File

@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

7
.idea/discord.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="PROJECT_FILES" />
<option name="description" value="" />
</component>
</project>

15
.idea/git_toolbox_prj.xml generated Normal file
View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxProjectSettings">
<option name="commitMessageIssueKeyValidationOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
<option name="commitMessageValidationEnabledOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
</component>
</project>

View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="UnusedSymbol" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>

10
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="azul-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

12
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CommitMessageInspectionProfile">
<profile version="1.0">
<inspection_tool class="CommitFormat" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CommitNamingConvention" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -7,13 +7,7 @@
}
],
"plugins": [
[
"@semantic-release/commit-analyzer", {
"releaseRules": [
{ "type": "build", "scope": "Needs bump", "release": "patch" }
]
}
],
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"gradle-semantic-release-plugin",
@@ -23,22 +17,9 @@
"assets": [
"CHANGELOG.md",
"gradle.properties"
],
"message": "chore: Release v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
]
}
],
[
"@saithodev/semantic-release-backmerge",
{
backmergeBranches: [{"from": "main", "to": "dev"}],
clearWorkspace: true
}
],
[
"@semantic-release/github",
{
successComment: false
}
]
"@semantic-release/github"
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,99 +0,0 @@
<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

126
README.md
View File

@@ -1,125 +1 @@
<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.
# Patcher

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,19 +1,41 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.binary.compatibility.validator)
kotlin("jvm") version "1.6.21"
java
`maven-publish`
signing
}
group = "app.revanced"
tasks {
processResources {
expand("projectVersion" to project.version)
repositories {
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/revanced/multidexlib2")
credentials {
// DO NOT set these variables in the project's gradle.properties.
// Instead, you should set them in:
// Windows: %homepath%\.gradle\gradle.properties
// Linux: ~/.gradle/gradle.properties
username =
project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR") // DO NOT CHANGE!
password =
project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN") // DO NOT CHANGE!
}
}
}
dependencies {
implementation(kotlin("stdlib"))
api("xpp3:xpp3:1.1.4c")
api("org.apktool:apktool-lib:2.6.1")
api("app.revanced:multidexlib2:2.5.2.r2")
api("org.smali:smali:2.5.2")
testImplementation(kotlin("test"))
implementation(kotlin("reflect"))
}
tasks {
test {
useJUnitPlatform()
testLogging {
@@ -22,96 +44,31 @@ tasks {
}
}
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)
}
}
java {
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
withJavadocJar()
}
val isGitHubCI = System.getenv("GITHUB_ACTOR") != null
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
if (isGitHubCI) {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
} else {
mavenLocal()
}
}
publications {
create<MavenPublication>("revanced-patcher-publication") {
register<MavenPublication>("gpr") {
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"
}
}
}
}
}
signing {
useGpgCmd()
sign(publishing.publications["revanced-patcher-publication"])
}
}

View File

@@ -1,111 +0,0 @@
<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)

View File

@@ -1,108 +0,0 @@
<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.
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

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