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

Compare commits

..

201 Commits

Author SHA1 Message Date
semantic-release-bot
9e0a74fcfb chore(release): 1.2.5 [skip ci]
## [1.2.5](https://github.com/revanced/revanced-patcher/compare/v1.2.4...v1.2.5) (2022-06-17)

### Bug Fixes

* goodbye security ([8f3ac77](8f3ac7702a))
2022-06-17 16:13:47 +00:00
Sculas
8f3ac7702a fix: goodbye security 2022-06-17 18:12:18 +02:00
semantic-release-bot
7b65f2d02c chore(release): 1.2.4 [skip ci]
## [1.2.4](https://github.com/revanced/revanced-patcher/compare/v1.2.3...v1.2.4) (2022-06-15)

### Reverts

* "fix: enforce aapt v1" ([dfd8a24](dfd8a24512))
2022-06-15 19:41:28 +00:00
Lucaskyy
2a1b2df56b Merge remote-tracking branch 'origin/main' into main 2022-06-15 21:39:42 +02:00
Lucaskyy
dfd8a24512 revert: "fix: enforce aapt v1"
This reverts commit cff87ff077.
2022-06-15 21:39:27 +02:00
semantic-release-bot
a3efd212fc chore(release): 1.2.3 [skip ci]
## [1.2.3](https://github.com/revanced/revanced-patcher/compare/v1.2.2...v1.2.3) (2022-06-14)

### Bug Fixes

* enforce aapt v1 ([cff87ff](cff87ff077))
2022-06-14 22:26:32 +00:00
Lucaskyy
3e610f7ba9 Merge remote-tracking branch 'origin/main' into main 2022-06-15 00:25:21 +02:00
Lucaskyy
cff87ff077 fix: enforce aapt v1 2022-06-15 00:25:06 +02:00
semantic-release-bot
54aa04ca34 chore(release): 1.2.2 [skip ci]
## [1.2.2](https://github.com/revanced/revanced-patcher/compare/v1.2.1...v1.2.2) (2022-06-14)

### Bug Fixes

* enforce aapt v2 ([b68b0bf](b68b0bf3d7))
2022-06-14 20:35:38 +00:00
Lucaskyy
0eda84eaef Merge remote-tracking branch 'origin/main' into main 2022-06-14 22:34:21 +02:00
Lucaskyy
b68b0bf3d7 fix: enforce aapt v2 2022-06-14 22:34:10 +02:00
semantic-release-bot
c692202f67 chore(release): 1.2.1 [skip ci]
## [1.2.1](https://github.com/revanced/revanced-patcher/compare/v1.2.0...v1.2.1) (2022-06-14)

### Bug Fixes

* Patcher setting BuildOptions too late ([6a5c873](6a5c8735fb))
2022-06-14 16:25:08 +00:00
Lucaskyy
8ce3535427 Merge remote-tracking branch 'origin/main' into main 2022-06-14 18:23:49 +02:00
Lucaskyy
6a5c8735fb fix: Patcher setting BuildOptions too late
This causes the Manager to crash, due to a stupid bug in Apktool which is prevented by setting a valid frameworkFolderLocation.
2022-06-14 18:23:40 +02:00
semantic-release-bot
8f32bc9c08 chore(release): 1.2.0 [skip ci]
# [1.2.0](https://github.com/revanced/revanced-patcher/compare/v1.1.0...v1.2.0) (2022-06-14)

### Features

* allow custom framework path to be specified ([d3a580e](d3a580ea19))
2022-06-14 15:50:24 +00:00
Lucaskyy
d3a580ea19 feat: allow custom framework path to be specified 2022-06-14 17:49:07 +02:00
oSumAtrIX
4c8eb0e5c7 refactor: gradle build script 2022-06-14 01:34:48 +02:00
semantic-release-bot
bc92eb7fd8 chore(release): 1.1.0 [skip ci]
# [1.1.0](https://github.com/revanced/revanced-patcher/compare/v1.0.0...v1.1.0) (2022-06-11)

### Bug Fixes

* resource patcher ([31815ca](31815ca9ea))
* update apktool to fork ([566ecef](566ecefa2b))

### Features

* allow custom aapt path to be specified ([8eb4a8f](8eb4a8f87a))
2022-06-11 23:25:19 +00:00
oSumAtrIX
cf89bd4171 Merge pull request #39 from revanced/non-root
fix: resource patcher
2022-06-12 01:24:04 +02:00
Lucaskyy
566ecefa2b fix: update apktool to fork 2022-06-11 20:39:29 +02:00
Lucaskyy
8eb4a8f87a feat: allow custom aapt path to be specified 2022-06-11 20:08:00 +02:00
oSumAtrIX
afcba5c212 refactor: simplify code by removing the with block 2022-06-11 19:45:11 +02:00
oSumAtrIX
2dcbd8d079 refactor: use include annotation parameter instead of excludeByDefault 2022-06-11 19:14:19 +02:00
oSumAtrIX
81895c7d5c Merge remote-tracking branch 'origin/non-root' into non-root
# Conflicts:
#	src/main/kotlin/app/revanced/patcher/Patcher.kt
2022-06-11 18:56:38 +02:00
Lucaskyy
22267883b1 refactor: get rid of all useless let blocks 2022-06-11 16:56:05 +02:00
oSumAtrIX
26fca60b53 refactor: use also instead of let where possible 2022-06-11 16:24:49 +02:00
oSumAtrIX
31815ca9ea fix: resource patcher 2022-06-11 06:36:13 +02:00
semantic-release-bot
1ce6098cad chore(release): 1.0.0 [skip ci]
# 1.0.0 (2022-06-05)

### Bug Fixes

* `compareSignatureToMethod` not matching correctly in case opcodes are null ([cca12aa](cca12aa34a))
* `ConcurrentModificationException` while iterating through `proxies` and modifying it ([6cb7cdb](6cb7cdb0b2))
* `JarPatchBundle` loading non-class files to class loader ([849616d](849616dc2b))
* `PackageMetadata` ([7399450](7399450139))
* `replaceWith` not replacing classes with used class proxies ([4178a1e](4178a1eedc))
* adding existing classes to the patchers cache ([9659a61](9659a61c5c))
* always return PatchResultSuccess on patch success ([996c4ac](996c4acb20))
* applying no patches throwing error ([5ca5a1c](5ca5a1c29e))
* applyPatches not returning successful patches ([f806cb3](f806cb38c5))
* avoid ignoring test resources (fixes [#1](https://github.com/revanced/revanced-patcher/issues/1)) ([d5a3c76](d5a3c76389))
* Classes not being written properly because of array shifting ([6e4db11](6e4db110c8))
* current must be calculated after increment ([5f12bab](5f12bab5df))
* failing tests temporarily ([fc05fe7](fc05fe79de))
* fix classes having multiple instances of fields ([7cc8a7d](7cc8a7dec3))
* fix classes having multiple method instances ([398239d](398239dc10))
* Fixed writer & signature resolver, improved tests & speed, minor refactoring ([e6c2501](e6c2501539))
* fuzzy resolver warning params were turned around ([e5bea06](e5bea06353))
* give ClassWriter a ClassReader for symtable ([41749ba](41749ba829))
* **gradle:** publish source and javadocs ([c236ebe](c236ebe078))
* incorrect pattern offset ([f3b5f67](f3b5f67b39))
* **Io:** fix finding classes by name ([b957501](b957501e70))
* **Io:** JAR loading and saving ([#8](https://github.com/revanced/revanced-patcher/issues/8)) ([310a7c4](310a7c446b))
* make `methodMetadata` nullable in `MethodSignatureMetadata` ([4e56652](4e56652429))
* make warnings nullable instead of lateinit ([8f1a629](8f1a629191))
* match to correct signature method parameters ([1ee2e4b](1ee2e4ba56))
* **MethodResolver:** fix cd57a8c9a0 ([cbd8df2](cbd8df2df0))
* **MethodResolver:** strip labels and line numbers so opcode patterns match ([699c730](699c730a7c))
* **MethodResolver:** strip labels nodes so opcode patterns match ([82c5306](82c530650f))
* MethodSignature#resolved throwing an exception ([c612676](c612676543))
* Move proxy package out of cache package ([ce21bd6](ce21bd60f3))
* null check causing an exception ([338bd9f](338bd9f739))
* nullable signature members ([#10](https://github.com/revanced/revanced-patcher/issues/10)) ([674461f](674461f08d))
* Patch should have access to the Cache ([4dd820f](4dd820ffdf))
* Patcher not writing resolved methods ([fac44a5](fac44a50c3))
* qualifying `Element` with wrong package ([024fa86](024fa867e1))
* reaching all constructors not possible ([c459beb](c459beb5f8))
* reformat (trigger release) ([bf48945](bf4894592b))
* remove broken code ([0e72a6e](0e72a6e85f))
* remove dependency to fork of Apktool ([11abc67](11abc67d9a))
* remove leftover debug code ([0f30eac](0f30eac32c))
* return mutable set of classes ([66a9b76](66a9b76845))
* returning failure on success ([48c4ea2](48c4ea2f6d))
* Search method map for existing class proxy ([a1e909b](a1e909b163))
* set index for insertAt to 0 by default ([d5b4c99](d5b4c99c00))
* set marklimit to Integer.MAX_VALUE ([e6e468f](e6e468fbb5))
* string signature in `SignatureResolver` ([e5ae970](e5ae970009))
* Suppress unused for addFiles ([3d6a1d3](3d6a1d38f3))
* throwing in case the opcode patterns do not match ([3144ec8](3144ec872a))
* use Array instead of Iterable for methodParameters ([dfac8f0](dfac8f03a3))
* using old instance of `Androlib` when saving ([a4d8be2](a4d8be20fc))
* workflow on dev branch ([428f7f4](428f7f4dec))
* write all classes ([f068fc8](f068fc87ff))

### Code Refactoring

* bump multidexlib2 to 2.5.2.r2 ([a6c6b49](a6c6b4979a))
* Change all references from Array to Iterable ([72f3cad](72f3cad3f9))
* convert Patch to abstract class ([cb9b1b9](cb9b1b9416))
* Optimize Signature class ([#11](https://github.com/revanced/revanced-patcher/issues/11)) ([7faa001](7faa001406))
* Rename `net.revanced` to `app.revanced` ([7087230](70872307e3))

### Features

* `Dependencies` annotation ([893d4c6](893d4c699b))
* `PatchLoader` ([ec9fd15](ec9fd15f9b))
* Add `findParentMethod` utility method ([#4](https://github.com/revanced/revanced-patcher/issues/4)) ([bbb2c54](bbb2c547aa))
* add `MethodWalker` ([7755bbc](7755bbc645))
* add `p` naming scheme to smali compiler ([79909cf](79909cf260))
* add extensions for cloning methods ([01bfbd6](01bfbd656e))
* add findClass method with className ([4087f49](4087f49863))
* Add first tests ([544bcf7](544bcf76bd))
* add fuzzy resolver ([7a56dca](7a56dca004))
* add immutableMethod ([c63b20f](c63b20fa65))
* add inline smali compiler ([bfe4e3e](bfe4e3e298))
* add missing test for fields ([6b8b057](6b8b0573d4))
* add or extension for AccessFlags ([00c85b5](00c85b5d75))
* Add patch metadata ([642e903](642e9031eb)), closes [ReVancedTeam/revanced-patches#1](https://github.com/ReVancedTeam/revanced-patches/issues/1)
* add SafeClassWriter ([6626014](6626014ef3))
* Add warnings for Fuzzy resolver ([715a2ad](715a2ad025))
* allow classes to be overwritten in addFiles and resolve signatures when applyPatches is called ([1db735b](1db735b1e2))
* Allow unknown opcodes using `null` ([0e5f4ba](0e5f4ba2d5))
* Finish first patcher test ([0d8d19e](0d8d19e708))
* Improve `SignatureResolver` ([139a23b](139a23b750))
* migrate to `DexPatchBundle` and `JarPatchBundle` ([8615798](8615798711))
* migrate to dexlib ([3651981](3651981161))
* Minor refactor and return proxy, if class has been proxied already ([4b26305](4b26305bd5))
* optional `forStaticMethod` parameter for `InlineSmaliCompiler.compileMethodInstructions` ([41e8860](41e88605c3))
* patch dependencies annotation and `PatcherOptions` ([6c65952](6c65952d80))
* properly manage `ClassProxy` & add `ProxyBackedClassList` ([6cb1fdf](6cb1fdf617))
* remaining mutable `EncodedValue` classes ([3f97cc8](3f97cc8e1f))
* string signature ([#22](https://github.com/revanced/revanced-patcher/issues/22)) ([612515a](612515acf8))
* use annotations instead of metadata objects ([d20f7fd](d20f7fd6e1))
* utility functions to get metadata of patch & sigs ([54511a4](54511a4fc6))

### Performance Improvements

* check type instead of class ([c7ef264](c7ef2644d8))
* decode manifest only when not using resource patcher ([4f60bea](4f60bea81e))
* depend on `androlib` instead of `ApkDecoder` ([cc9416d](cc9416dd11))
* do not resolve empty signatures list ([b1eebc9](b1eebc99a7))
* lazy-ify all mutable clones ([d18a3b6](d18a3b6a28))
* optimize indexOf call away ([9991f39](9991f39c9a))
* use Set instead of List since there are no dupes ([e65ebd2](e65ebd27c2))
* use String List and compare instead of any lambda ([5bd416b](5bd416b409))

### Reverts

* AccessFlag extensions not working with IDE ([0bfb92a](0bfb92a0cb))
* previous commits check for dupes in dexFile, not cache ([e810197](e810197e2a))

### 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
* 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-06-05 06:10:56 +00:00
semantic-release-bot
46a6396114 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-05 08:03:41 +02:00
oSumAtrIX
41e88605c3 feat: optional forStaticMethod parameter for InlineSmaliCompiler.compileMethodInstructions 2022-06-05 08:03:40 +02:00
oSumAtrIX
893d4c699b feat: Dependencies annotation 2022-06-05 08:03:40 +02:00
semantic-release-bot
bf8655ead8 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-06-05 08:03:40 +02:00
oSumAtrIX
6c65952d80 feat: patch dependencies annotation and PatcherOptions 2022-06-05 08:03:39 +02:00
semantic-release-bot
26f3e7336b 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-06-05 08:03:39 +02:00
oSumAtrIX
849616dc2b fix: JarPatchBundle loading non-class files to class loader 2022-06-05 08:03:38 +02:00
oSumAtrIX
e8a131fb08 chore: update gradlew wrapper 2022-06-05 08:03:38 +02:00
oSumAtrIX
11abc67d9a fix: remove dependency to fork of Apktool 2022-06-05 08:03:38 +02:00
oSumAtrIX
8615798711 feat: migrate to DexPatchBundle and JarPatchBundle
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:37 +02:00
semantic-release-bot
070e02ea28 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-06-05 08:03:37 +02:00
Lucaskyy
54511a4fc6 feat: utility functions to get metadata of patch & sigs 2022-06-05 08:03:37 +02:00
Lucaskyy
94f3c9116e chore: fix typo 2022-06-05 08:03:36 +02:00
semantic-release-bot
fe56c0cadb 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-06-05 08:03:36 +02:00
Lucaskyy
bf4894592b fix: reformat (trigger release) 2022-06-05 08:03:36 +02:00
Lucaskyy
5a96f2d99f refactor: use apktool fork
also fixed some compilation issues
2022-06-05 08:03:35 +02:00
semantic-release-bot
839a5ef22a 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-06-05 08:03:35 +02:00
oSumAtrIX
0ebdb100fd refactor: use resourceData.get(path) instead of a reader/writer
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:35 +02:00
oSumAtrIX
4f60bea81e perf: decode manifest only when not using resource patcher
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:34 +02:00
oSumAtrIX
1a49d9439f chore: update kotlin jvm
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:34 +02:00
oSumAtrIX
5535eb4f01 refactor: improve ExampleResourcePatch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:33 +02:00
oSumAtrIX
5dc6aa9bfd chore: update dependencies
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:33 +02:00
semantic-release-bot
6c0d28191b 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-06-05 08:03:33 +02:00
semantic-release-bot
9d067b9b0d 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-06-05 08:03:32 +02:00
oSumAtrIX
a4d8be20fc fix: using old instance of Androlib when saving
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:32 +02:00
oSumAtrIX
ec9fd15f9b feat: PatchLoader
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:32 +02:00
oSumAtrIX
d20f7fd6e1 feat: use annotations instead of metadata objects
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:31 +02:00
semantic-release-bot
ebbcf78e56 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-06-05 08:03:31 +02:00
oSumAtrIX
024fa867e1 fix: qualifying Element with wrong package
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:31 +02:00
semantic-release-bot
e506d8fd8c 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-06-05 08:03:30 +02:00
oSumAtrIX
f5b5c52e55 chore: bump java-version for action setup-java
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:30 +02:00
oSumAtrIX
fc05fe79de fix: failing tests temporarily
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:29 +02:00
j4k0xb
79909cf260 feat: add p naming scheme to smali compiler 2022-06-05 08:03:29 +02:00
autergame
8f12873200 Replace ReVancedTeam with revanced in build.gradle.kts 2022-06-05 08:03:29 +02:00
oSumAtrIX
cc9416dd11 perf: depend on androlib instead of ApkDecoder
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:28 +02:00
oSumAtrIX
99319e63da add: resource patcher
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:28 +02:00
oSumAtrIX
c459beb5f8 fix: reaching all constructors not possible
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:28 +02:00
oSumAtrIX
e5ae970009 fix: string signature in SignatureResolver
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:27 +02:00
oSumAtrIX
612515acf8 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-06-05 08:03:27 +02:00
oSumAtrIX
b1eebc99a7 perf: do not resolve empty signatures list
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:27 +02:00
oSumAtrIX
6cb7cdb0b2 fix: ConcurrentModificationException while iterating through proxies and modifying it
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:26 +02:00
oSumAtrIX
beff1df9b0 refactor: resolve signatures automatically
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:26 +02:00
oSumAtrIX
f58a498849 add: applyProxies method
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:26 +02:00
oSumAtrIX
6cb1fdf617 feat: properly manage ClassProxy & add ProxyBackedClassList
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:25 +02:00
oSumAtrIX
7399450139 fix: PackageMetadata
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:25 +02:00
oSumAtrIX
193eae298a add: PackageMetadata for signatures
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:25 +02:00
oSumAtrIX
4e56652429 fix: make methodMetadata nullable in MethodSignatureMetadata
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:24 +02:00
oSumAtrIX
7755bbc645 feat: add MethodWalker
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:24 +02:00
Lucaskyy
f3b5f67b39 fix: incorrect pattern offset 2022-06-05 08:03:24 +02:00
Lucaskyy
7f18bbf66e docs: fix improper docs for fuzzy resolver Warning 2022-06-05 08:03:23 +02:00
oSumAtrIX
c8b68e36e0 refactor: better naming for resolver warning parameters
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:23 +02:00
oSumAtrIX
5ca5a1c29e fix: applying no patches throwing error
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:23 +02:00
oSumAtrIX
d677d9e800 refact: better parameter names for Warning
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:22 +02:00
Lucaskyy
e5bea06353 fix: fuzzy resolver warning params were turned around 2022-06-05 08:03:22 +02:00
Lucaskyy
8f1a629191 fix: make warnings nullable instead of lateinit 2022-06-05 08:03:22 +02:00
Lucaskyy
e6086511e5 refactor: remove all parameter names 2022-06-05 08:03:21 +02:00
Lucaskyy
c612676543 fix: MethodSignature#resolved throwing an exception 2022-06-05 08:03:21 +02:00
Lucaskyy
bca948658e test: Add tests for unknown opcodes 2022-06-05 08:03:20 +02:00
Lucaskyy
0e5f4ba2d5 feat: Allow unknown opcodes using null
This is the same as `??` in IDA signatures.
2022-06-05 08:03:20 +02:00
Lucaskyy
6ca05769ef chore: remove todo 2022-06-05 08:03:20 +02:00
Lucaskyy
c21e5affba refactor: remove all @Suppression's 2022-06-05 08:03:19 +02:00
Lucaskyy
1c5a04caf9 refactor: format code 2022-06-05 08:03:19 +02:00
Lucaskyy
3d6a1d38f3 fix: Suppress unused for addFiles 2022-06-05 08:03:19 +02:00
Lucaskyy
715a2ad025 feat: Add warnings for Fuzzy resolver 2022-06-05 08:03:18 +02:00
Lucaskyy
9889ec9d03 docs: fix wrong wording 2022-06-05 08:03:18 +02:00
Lucaskyy
01bfbd656e feat: add extensions for cloning methods 2022-06-05 08:03:17 +02:00
Lucaskyy
6c9797583d test: fix outdated test 2022-06-05 08:03:17 +02:00
Lucaskyy
3cf07f5ce2 refactor: replace asInstructions with toInstruction to follow proper naming scheme 2022-06-05 08:03:17 +02:00
Lucaskyy
0bfb92a0cb revert: AccessFlag extensions not working with IDE 2022-06-05 08:03:16 +02:00
Lucaskyy
042638a399 refactor: replace Array with Iterable 2022-06-05 08:03:16 +02:00
oSumAtrIX
4178a1eedc fix: replaceWith not replacing classes with used class proxies
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:15 +02:00
oSumAtrIX
338bd9f739 fix: null check causing an exception
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:15 +02:00
oSumAtrIX
c55c62a57e add: throw on getting result of MethodSignature if null
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:15 +02:00
oSumAtrIX
1f08da8b2a refact: include each signature in its corresponding patch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:14 +02:00
Lucaskyy
b2dab3fabf refactor: rename method to resolverMethod 2022-06-05 08:03:14 +02:00
Lucaskyy
0f30eac32c fix: remove leftover debug code 2022-06-05 08:03:14 +02:00
Lucaskyy
642e9031eb feat: Add patch metadata
Fixes ReVancedTeam/revanced-patches#1
2022-06-05 08:03:13 +02:00
Lucaskyy
7a56dca004 feat: add fuzzy resolver
fixed docs for MethodSignature & added tests for fuzzy resolver
2022-06-05 08:03:13 +02:00
Lucaskyy
18853f70a4 refactor: migrate signature schema changes to Patcher
also updated Extensions, for good measure.
2022-06-05 08:03:13 +02:00
oSumAtrIX
6b8b0573d4 feat: add missing test for fields
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:12 +02:00
oSumAtrIX
3889d72927 style: reformat code
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:12 +02:00
oSumAtrIX
3f97cc8e1f feat: remaining mutable EncodedValue classes 2022-06-05 08:03:11 +02:00
Lucaskyy
1db735b1e2 feat: allow classes to be overwritten in addFiles and resolve signatures when applyPatches is called 2022-06-05 08:03:11 +02:00
Lucaskyy
996c4acb20 fix: always return PatchResultSuccess on patch success 2022-06-05 08:03:11 +02:00
Lucaskyy
5b28523eea add: optional callback for CLI 2022-06-05 08:03:10 +02:00
Lucaskyy
72f3cad3f9 refactor: Change all references from Array to Iterable
BREAKING CHANGE: arrayOf has to be changed to listOf.
2022-06-05 08:03:10 +02:00
oSumAtrIX
9659a61c5c fix: adding existing classes to the patchers cache 2022-06-05 08:03:10 +02:00
Lucaskyy
b892729332 chore: update kotlin, don't shade deps, publish to maven local, make deps api instead of implementation 2022-06-05 08:03:09 +02:00
Lucaskyy
6e4db110c8 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-06-05 08:03:09 +02:00
Lucaskyy
e810197e2a revert: previous commits check for dupes in dexFile, not cache
This reverts commit aed4fd9a3c.
This reverts commit 622138736d.
2022-06-05 08:03:08 +02:00
Lucaskyy
e65ebd27c2 perf: use Set instead of List since there are no dupes 2022-06-05 08:03:08 +02:00
Lucaskyy
5bd416b409 perf: use String List and compare instead of any lambda 2022-06-05 08:03:08 +02:00
Lucaskyy
a6c6b4979a 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-06-05 08:03:07 +02:00
Lucaskyy
db10ab03be ci: Fix Unauthorized error 2022-06-05 08:03:07 +02:00
Lucaskyy
94dbb573cf refactor: bump multidexlib2, dexlib2 and smali 2022-06-05 08:03:07 +02:00
oSumAtrIX
08253ee010 add: addFiles method to merge additional dex containers 2022-06-05 08:03:06 +02:00
oSumAtrIX
3144ec872a fix: throwing in case the opcode patterns do not match 2022-06-05 08:03:06 +02:00
Lucaskyy
48c4ea2f6d fix: returning failure on success
oh wow, that's an oopsie
2022-06-05 08:03:06 +02:00
Lucaskyy
c63b20fa65 feat: add immutableMethod
added docs
2022-06-05 08:03:05 +02:00
Lucaskyy
f806cb38c5 fix: applyPatches not returning successful patches 2022-06-05 08:03:05 +02:00
Lucaskyy
6c3e2d79ea chore: format code 2022-06-05 08:03:05 +02:00
oSumAtrIX
cca12aa34a fix: compareSignatureToMethod not matching correctly in case opcodes are null 2022-06-05 08:03:04 +02:00
Lucaskyy
c267b12a7d refactor: make method a property 2022-06-05 08:03:04 +02:00
Lucaskyy
eef448cc39 refactor: cleanup SignatureResolver.kt 2022-06-05 08:03:04 +02:00
Lucaskyy
45303f66ec test: fix test with previous changes 2022-06-05 08:03:03 +02:00
Lucaskyy
783fbf43f2 refactor: rename resolveAndGetMethod to method 2022-06-05 08:03:03 +02:00
Lucaskyy
59189058ac refactor: cleanup Patcher.kt 2022-06-05 08:03:03 +02:00
Lucaskyy
dfac8f03a3 fix: use Array instead of Iterable for methodParameters 2022-06-05 08:03:02 +02:00
Lucaskyy
b44bf4c267 chore: move replace extension method to Extensions.kt 2022-06-05 08:03:02 +02:00
Lucaskyy
066ad274ed docs: fixup 2022-06-05 08:03:02 +02:00
Lucaskyy
a8653fe6a0 chore: publish jar with dependencies 2022-06-05 08:03:01 +02:00
oSumAtrIX
139a23b750 feat: Improve SignatureResolver 2022-06-05 08:03:01 +02:00
oSumAtrIX
0d8d19e708 feat: Finish first patcher test 2022-06-05 08:03:00 +02:00
oSumAtrIX
a1e909b163 fix: Search method map for existing class proxy 2022-06-05 08:03:00 +02:00
oSumAtrIX
e4157332d3 add: MutableMethodImplementation.addInstructions extension 2022-06-05 08:03:00 +02:00
oSumAtrIX
923efc4caf add: TODO for mutable encoded value clones 2022-06-05 08:02:59 +02:00
oSumAtrIX
bea0cbc550 refactor: lazy initialize implementation field for mutable methods 2022-06-05 08:02:59 +02:00
oSumAtrIX
1ee2e4ba56 fix: match to correct signature method parameters 2022-06-05 08:02:59 +02:00
oSumAtrIX
fac44a50c3 fix: Patcher not writing resolved methods 2022-06-05 08:02:58 +02:00
oSumAtrIX
544bcf76bd feat: Add first tests 2022-06-05 08:02:58 +02:00
oSumAtrIX
a16c8cabf2 refactor: Improve SignatureResolver 2022-06-05 08:02:58 +02:00
oSumAtrIX
2777117da2 refactor: Use String instead of CharSequence for method parameter signature 2022-06-05 08:02:57 +02:00
oSumAtrIX
66a9b76845 fix: return mutable set of classes 2022-06-05 08:02:57 +02:00
oSumAtrIX
f068fc87ff fix: write all classes 2022-06-05 08:02:57 +02:00
oSumAtrIX
7cc8a7dec3 fix: fix classes having multiple instances of fields 2022-06-05 08:02:56 +02:00
oSumAtrIX
398239dc10 fix: fix classes having multiple method instances 2022-06-05 08:02:56 +02:00
Lucaskyy
d18a3b6a28 perf: lazy-ify all mutable clones 2022-06-05 08:02:56 +02:00
Lucaskyy
bfe4e3e298 feat: add inline smali compiler 2022-06-05 08:02:55 +02:00
Lucaskyy
a1b6b06bd3 test: use findClass with className & cleanup 2022-06-05 08:02:55 +02:00
Lucaskyy
4087f49863 feat: add findClass method with className 2022-06-05 08:02:54 +02:00
Lucaskyy
00c85b5d75 feat: add or extension for AccessFlags 2022-06-05 08:02:54 +02:00
Lucaskyy
cb78c5a86f style: reformat code 2022-06-05 08:02:54 +02:00
Lucaskyy
9991f39c9a perf: optimize indexOf call away 2022-06-05 08:02:53 +02:00
oSumAtrIX
650bf71124 docs: Document important parts of the code 2022-06-05 08:02:53 +02:00
oSumAtrIX
1dd3394ea3 refactor: Replacing original classes with mutated ones 2022-06-05 08:02:53 +02:00
oSumAtrIX
e6c2501539 fix: Fixed writer & signature resolver, improved tests & speed, minor refactoring 2022-06-05 08:02:52 +02:00
oSumAtrIX
4b26305bd5 feat: Minor refactor and return proxy, if class has been proxied already 2022-06-05 08:02:52 +02:00
oSumAtrIX
ce21bd60f3 fix: Move proxy package out of cache package 2022-06-05 08:02:51 +02:00
oSumAtrIX
3651981161 feat: migrate to dexlib
BREAKING CHANGE: Removed usage of ASM library
2022-06-05 08:02:51 +02:00
semantic-release-bot
6299b9e951 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-06-05 08:02:51 +02:00
semantic-release-bot
24b544708f 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-06-05 08:02:50 +02:00
Lucaskyy
c7ef2644d8 perf: check type instead of class
this is way better, thank you oSumAtrIX!
2022-06-05 08:02:50 +02:00
Lucaskyy
fa6e454ae9 test: fix assert message 2022-06-05 08:02:50 +02:00
Lucaskyy
cbd8df2df0 fix(MethodResolver): fix cd57a8c9a0 2022-06-05 08:02:49 +02:00
semantic-release-bot
f3d8b917de 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-06-05 08:02:49 +02:00
Lucaskyy
82c530650f 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-06-05 08:02:49 +02:00
semantic-release-bot
81d0cf20f3 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-06-05 08:02:48 +02:00
Lucaskyy
36d4f71325 refactor: log as trace instead of debug
so there's less spam in console
2022-06-05 08:02:48 +02:00
Lucaskyy
699c730a7c fix(MethodResolver): strip labels and line numbers so opcode patterns match 2022-06-05 08:02:48 +02:00
Lucaskyy
b197956e39 refactor: only compute maxs and use existing stack frames 2022-06-05 08:02:47 +02:00
semantic-release-bot
be992a3e6f 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-06-05 08:02:47 +02:00
semantic-release-bot
e0437397df 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-06-05 08:02:47 +02:00
Lucaskyy
41749ba829 fix: give ClassWriter a ClassReader for symtable
removed SafeClassWriter as it was unused
2022-06-05 08:02:46 +02:00
semantic-release-bot
8161ce4fa6 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-06-05 08:02:46 +02:00
Lucaskyy
6626014ef3 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-06-05 08:02:46 +02:00
Lucaskyy
e6e468fbb5 fix: set marklimit to Integer.MAX_VALUE 2022-06-05 08:02:45 +02:00
semantic-release-bot
2fabbdf71b 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-06-05 08:02:45 +02:00
Lucaskyy
7faa001406 refactor: Optimize Signature class (#11)
BREAKING CHANGE: Array<Int> was changed to IntArray. This breaks existing patches.
2022-06-05 08:02:44 +02:00
Lucaskyy
70872307e3 refactor: Rename net.revanced to app.revanced
BREAKING CHANGE: Package name was changed from "net.revanced" to "app.revanced"
2022-06-05 08:02:44 +02:00
oSumAtrIX
310a7c446b 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-06-05 08:02:43 +02:00
Lucaskyy
c236ebe078 fix(gradle): publish source and javadocs 2022-06-05 08:02:43 +02:00
oSumAtrIX
674461f08d 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-06-05 08:02:43 +02:00
oSumAtrIX
bbb2c547aa 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-06-05 08:02:42 +02:00
Bleuzen
b957501e70 fix(Io): fix finding classes by name 2022-06-05 08:02:42 +02:00
Lucaskyy
b6ca31a970 chore: push IntelliJ project files 2022-06-05 08:02:42 +02:00
Lucaskyy
cbcf93f7d6 refactor: target java 8 instead of java 17 2022-06-05 08:02:41 +02:00
Lucaskyy
d5b4c99c00 fix: set index for insertAt to 0 by default 2022-06-05 08:02:41 +02:00
Lucaskyy
4dd820ffdf 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-06-05 08:02:41 +02:00
Lucaskyy
cb9b1b9416 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-06-05 08:02:40 +02:00
Lucaskyy
428f7f4dec fix: workflow on dev branch 2022-06-05 08:02:40 +02:00
Lucaskyy
77536cce8f style: remove tab 2022-06-05 08:02:39 +02:00
she11sh0cked
7b6a61b674 ci: add gradle-semantic-release-plugin and remove the github release assets 2022-06-05 08:02:39 +02:00
she11sh0cked
7f5f3b217d ci: add semantic-release 2022-06-05 08:02:39 +02:00
13 changed files with 365 additions and 89 deletions

View File

@@ -1,3 +1,188 @@
## [1.2.5](https://github.com/revanced/revanced-patcher/compare/v1.2.4...v1.2.5) (2022-06-17)
### Bug Fixes
* goodbye security ([8f3ac77](https://github.com/revanced/revanced-patcher/commit/8f3ac7702a2b3ee98c55aeac6a1b9972f99664cc))
## [1.2.4](https://github.com/revanced/revanced-patcher/compare/v1.2.3...v1.2.4) (2022-06-15)
### Reverts
* "fix: enforce aapt v1" ([dfd8a24](https://github.com/revanced/revanced-patcher/commit/dfd8a245124f85b1b028bbba197c70c8dca689b6))
## [1.2.3](https://github.com/revanced/revanced-patcher/compare/v1.2.2...v1.2.3) (2022-06-14)
### Bug Fixes
* enforce aapt v1 ([cff87ff](https://github.com/revanced/revanced-patcher/commit/cff87ff0770d774d7ef79eec5a22462eadbcb9c5))
## [1.2.2](https://github.com/revanced/revanced-patcher/compare/v1.2.1...v1.2.2) (2022-06-14)
### Bug Fixes
* enforce aapt v2 ([b68b0bf](https://github.com/revanced/revanced-patcher/commit/b68b0bf3d735f54b92ad7dad8132f77e9007063f))
## [1.2.1](https://github.com/revanced/revanced-patcher/compare/v1.2.0...v1.2.1) (2022-06-14)
### Bug Fixes
* Patcher setting BuildOptions too late ([6a5c873](https://github.com/revanced/revanced-patcher/commit/6a5c8735fb8a5d6f7e9c606734b6684c7fa99e7f))
# [1.2.0](https://github.com/revanced/revanced-patcher/compare/v1.1.0...v1.2.0) (2022-06-14)
### Features
* allow custom framework path to be specified ([d3a580e](https://github.com/revanced/revanced-patcher/commit/d3a580ea19d7c2d5d8c97650b1e6396ea0a7fc25))
# [1.1.0](https://github.com/revanced/revanced-patcher/compare/v1.0.0...v1.1.0) (2022-06-11)
### Bug Fixes
* resource patcher ([31815ca](https://github.com/revanced/revanced-patcher/commit/31815ca9ea990f16b3600d61fd570c1805be1c82))
* update apktool to fork ([566ecef](https://github.com/revanced/revanced-patcher/commit/566ecefa2bd4cde5ebfb2b22dc56cd8bf9f396bd))
### Features
* allow custom aapt path to be specified ([8eb4a8f](https://github.com/revanced/revanced-patcher/commit/8eb4a8f87ae7679a272f3224273a37a31d4bb121))
# 1.0.0 (2022-06-05)
### Bug Fixes
* `compareSignatureToMethod` not matching correctly in case opcodes are null ([cca12aa](https://github.com/revanced/revanced-patcher/commit/cca12aa34a60d766c02e55241df847f7d230d4d7))
* `ConcurrentModificationException` while iterating through `proxies` and modifying it ([6cb7cdb](https://github.com/revanced/revanced-patcher/commit/6cb7cdb0b2a2b954adb04033e0f2d3ccb4604545))
* `JarPatchBundle` loading non-class files to class loader ([849616d](https://github.com/revanced/revanced-patcher/commit/849616dc2b6e30ec1fa1d8a8f9c1f881fc11676a))
* `PackageMetadata` ([7399450](https://github.com/revanced/revanced-patcher/commit/739945013962fd80d2635fff126d84046870f956))
* `replaceWith` not replacing classes with used class proxies ([4178a1e](https://github.com/revanced/revanced-patcher/commit/4178a1eedce1436ffeb3ddd6952ce0b6ec87d5a0))
* adding existing classes to the patchers cache ([9659a61](https://github.com/revanced/revanced-patcher/commit/9659a61c5c3a84714160b78b32cc337a97c8caa9))
* always return PatchResultSuccess on patch success ([996c4ac](https://github.com/revanced/revanced-patcher/commit/996c4acb2061db776430ad8b07bfdb3fe32861f6))
* applying no patches throwing error ([5ca5a1c](https://github.com/revanced/revanced-patcher/commit/5ca5a1c29e087ce7e4b6d5e593b775365803151d))
* applyPatches not returning successful patches ([f806cb3](https://github.com/revanced/revanced-patcher/commit/f806cb38c571cdd22016396ee1874ee18c91b79f))
* avoid ignoring test resources (fixes [#1](https://github.com/revanced/revanced-patcher/issues/1)) ([d5a3c76](https://github.com/revanced/revanced-patcher/commit/d5a3c76389ba902c22ddc8b7ba1a110b7ff852df))
* Classes not being written properly because of array shifting ([6e4db11](https://github.com/revanced/revanced-patcher/commit/6e4db110c8fdd16fb0c0ce81f427d84f2a3b6ee0))
* current must be calculated after increment ([5f12bab](https://github.com/revanced/revanced-patcher/commit/5f12bab5df97fbe6e2e62c1bf2814a2e682ab4f3))
* failing tests temporarily ([fc05fe7](https://github.com/revanced/revanced-patcher/commit/fc05fe79deec2486bb746d33e803ad052e68f8de))
* fix classes having multiple instances of fields ([7cc8a7d](https://github.com/revanced/revanced-patcher/commit/7cc8a7dec321774c1d3f2f1a87ac91f952c4fb7e))
* fix classes having multiple method instances ([398239d](https://github.com/revanced/revanced-patcher/commit/398239dc10a3ea04e46adb3be176c897876e5587))
* Fixed writer & signature resolver, improved tests & speed, minor refactoring ([e6c2501](https://github.com/revanced/revanced-patcher/commit/e6c2501539540301d5b70014de460e5452a09b04))
* fuzzy resolver warning params were turned around ([e5bea06](https://github.com/revanced/revanced-patcher/commit/e5bea06353805f004d607124a8ebed138f84d583))
* give ClassWriter a ClassReader for symtable ([41749ba](https://github.com/revanced/revanced-patcher/commit/41749ba8290b2dec5dd2ab6e0bc9d714887a1a05))
* **gradle:** publish source and javadocs ([c236ebe](https://github.com/revanced/revanced-patcher/commit/c236ebe0789f9c78d610769f0feda2b64fa4a128))
* incorrect pattern offset ([f3b5f67](https://github.com/revanced/revanced-patcher/commit/f3b5f67b395167c1b9411b2374f3ef584b57b6cf))
* **Io:** fix finding classes by name ([b957501](https://github.com/revanced/revanced-patcher/commit/b957501e709028005c4d6c7857022980205b6861))
* **Io:** JAR loading and saving ([#8](https://github.com/revanced/revanced-patcher/issues/8)) ([310a7c4](https://github.com/revanced/revanced-patcher/commit/310a7c446b547d84b02c5da2161958e77ce69f0d))
* make `methodMetadata` nullable in `MethodSignatureMetadata` ([4e56652](https://github.com/revanced/revanced-patcher/commit/4e566524299674426fb0344d09db3b0c1cb3d300))
* make warnings nullable instead of lateinit ([8f1a629](https://github.com/revanced/revanced-patcher/commit/8f1a629191668e05917dc797e486647e55276d59))
* match to correct signature method parameters ([1ee2e4b](https://github.com/revanced/revanced-patcher/commit/1ee2e4ba56097c5e06c93c9ce04cb5543f0e4a67))
* **MethodResolver:** fix cd57a8c9a0db7e3ae5ad0bca202e5955930319ab ([cbd8df2](https://github.com/revanced/revanced-patcher/commit/cbd8df2df008ef37c6b43e2a8442c41f24be9358))
* **MethodResolver:** strip labels and line numbers so opcode patterns match ([699c730](https://github.com/revanced/revanced-patcher/commit/699c730a7cecf31878827d645e845490a37de4cb))
* **MethodResolver:** strip labels nodes so opcode patterns match ([82c5306](https://github.com/revanced/revanced-patcher/commit/82c530650f926dd026d263cfe23a7d67cb27bbf2))
* MethodSignature#resolved throwing an exception ([c612676](https://github.com/revanced/revanced-patcher/commit/c612676543282155143471b71a095e26023806ea))
* Move proxy package out of cache package ([ce21bd6](https://github.com/revanced/revanced-patcher/commit/ce21bd60f34d78b94d6d85f2c5375bc934ed4091))
* null check causing an exception ([338bd9f](https://github.com/revanced/revanced-patcher/commit/338bd9f7394afd84e5e195a7f8155c813812cfb5))
* nullable signature members ([#10](https://github.com/revanced/revanced-patcher/issues/10)) ([674461f](https://github.com/revanced/revanced-patcher/commit/674461f08daabbf92cb54e4eadb408226fac47af))
* Patch should have access to the Cache ([4dd820f](https://github.com/revanced/revanced-patcher/commit/4dd820ffdf1b98fe41b50f7cb2670b89acfbb99d))
* Patcher not writing resolved methods ([fac44a5](https://github.com/revanced/revanced-patcher/commit/fac44a50c39d8c102bd3e7ca4dd1bb86d29f7b57))
* qualifying `Element` with wrong package ([024fa86](https://github.com/revanced/revanced-patcher/commit/024fa867e115f984cfa3e395b78f4f43aa81709b))
* reaching all constructors not possible ([c459beb](https://github.com/revanced/revanced-patcher/commit/c459beb5f898d797f2f03ed36326bd9cfad03d31))
* reformat (trigger release) ([bf48945](https://github.com/revanced/revanced-patcher/commit/bf4894592bf9ee9c6233abc91f538b7b8ef986a0))
* remove broken code ([0e72a6e](https://github.com/revanced/revanced-patcher/commit/0e72a6e85ff9a6035510680fc5e33ab0cd14144f))
* remove dependency to fork of Apktool ([11abc67](https://github.com/revanced/revanced-patcher/commit/11abc67d9ab7d7b273fd4cd4c53af54008a80585))
* remove leftover debug code ([0f30eac](https://github.com/revanced/revanced-patcher/commit/0f30eac32ce66d8b90906c02ef7e7854feeecc33))
* return mutable set of classes ([66a9b76](https://github.com/revanced/revanced-patcher/commit/66a9b768457e98fdde0b61f9a8d6aed4c1872027))
* returning failure on success ([48c4ea2](https://github.com/revanced/revanced-patcher/commit/48c4ea2f6d9de319383a49ea2d4c6ffb4f687a2b))
* Search method map for existing class proxy ([a1e909b](https://github.com/revanced/revanced-patcher/commit/a1e909b16337c538f8f8b475801d8b1804163bfe))
* set index for insertAt to 0 by default ([d5b4c99](https://github.com/revanced/revanced-patcher/commit/d5b4c99c00272e3e5afec2fa0a489ba618f2a81a))
* set marklimit to Integer.MAX_VALUE ([e6e468f](https://github.com/revanced/revanced-patcher/commit/e6e468fbb5c20b08c8bd59bafc794acea907e4b4))
* string signature in `SignatureResolver` ([e5ae970](https://github.com/revanced/revanced-patcher/commit/e5ae9700096924e63b15a08079dce40ae07202d8))
* Suppress unused for addFiles ([3d6a1d3](https://github.com/revanced/revanced-patcher/commit/3d6a1d38f339ce2c5d82b7ac46c208c6702d6d44))
* throwing in case the opcode patterns do not match ([3144ec8](https://github.com/revanced/revanced-patcher/commit/3144ec872ac8651b8c0a9311ae508d5c3cc734ce))
* use Array instead of Iterable for methodParameters ([dfac8f0](https://github.com/revanced/revanced-patcher/commit/dfac8f03a362fd273527f552d9eae121505fd4e0))
* using old instance of `Androlib` when saving ([a4d8be2](https://github.com/revanced/revanced-patcher/commit/a4d8be20fcd444b08ec9c43f9f7029f8bacbbc41))
* workflow on dev branch ([428f7f4](https://github.com/revanced/revanced-patcher/commit/428f7f4decb00d28c9bf137ef4cd1d5fd4a0821e))
* write all classes ([f068fc8](https://github.com/revanced/revanced-patcher/commit/f068fc87ff8e204826639318af39e48e683254da))
### Code Refactoring
* bump multidexlib2 to 2.5.2.r2 ([a6c6b49](https://github.com/revanced/revanced-patcher/commit/a6c6b4979af42936cb26608541a4f7a66393b3f0))
* Change all references from Array to Iterable ([72f3cad](https://github.com/revanced/revanced-patcher/commit/72f3cad3f98001b0109b07373ed9cc57a9001cfa))
* convert Patch to abstract class ([cb9b1b9](https://github.com/revanced/revanced-patcher/commit/cb9b1b9416c699c68d0fca228d4f8ca6fb634cb5))
* Optimize Signature class ([#11](https://github.com/revanced/revanced-patcher/issues/11)) ([7faa001](https://github.com/revanced/revanced-patcher/commit/7faa001406c1f28dc2182cf6d1ab19504f4e3eb9))
* Rename `net.revanced` to `app.revanced` ([7087230](https://github.com/revanced/revanced-patcher/commit/70872307e33282b37dd5fb315b56022ab73bf582))
### Features
* `Dependencies` annotation ([893d4c6](https://github.com/revanced/revanced-patcher/commit/893d4c699bad4c70002fc691c261447d01948b5c))
* `PatchLoader` ([ec9fd15](https://github.com/revanced/revanced-patcher/commit/ec9fd15f9b9b9968be7fb5cb384eb8ee2a0c9ba3))
* Add `findParentMethod` utility method ([#4](https://github.com/revanced/revanced-patcher/issues/4)) ([bbb2c54](https://github.com/revanced/revanced-patcher/commit/bbb2c547aae8dd774a1a883de24fe45da463fa35))
* add `MethodWalker` ([7755bbc](https://github.com/revanced/revanced-patcher/commit/7755bbc645773e49053fb9ad2b6fd18a7f488659))
* add `p` naming scheme to smali compiler ([79909cf](https://github.com/revanced/revanced-patcher/commit/79909cf260c0578e88ad22d63397957dbaa91702))
* add extensions for cloning methods ([01bfbd6](https://github.com/revanced/revanced-patcher/commit/01bfbd656ee06cb2cab951c43d7f76a465a40830))
* add findClass method with className ([4087f49](https://github.com/revanced/revanced-patcher/commit/4087f498638ee88ba3eaca792039fe481f404732))
* Add first tests ([544bcf7](https://github.com/revanced/revanced-patcher/commit/544bcf76bd8a8c790c2f799606ad8c9ac7d2aa82))
* add fuzzy resolver ([7a56dca](https://github.com/revanced/revanced-patcher/commit/7a56dca004cd793121a59ea854c77f4c1a01bd6f))
* add immutableMethod ([c63b20f](https://github.com/revanced/revanced-patcher/commit/c63b20fa65aba8bb060a4a7a652747cba7198c2b))
* add inline smali compiler ([bfe4e3e](https://github.com/revanced/revanced-patcher/commit/bfe4e3e298ac963936ca9621e12aefbe56260826))
* add missing test for fields ([6b8b057](https://github.com/revanced/revanced-patcher/commit/6b8b0573d479e227b45dc36a6abac622c3ccebdd))
* add or extension for AccessFlags ([00c85b5](https://github.com/revanced/revanced-patcher/commit/00c85b5d750ccc8de69ad4101220b19eeaf99bcb))
* Add patch metadata ([642e903](https://github.com/revanced/revanced-patcher/commit/642e9031eb3727ebdca22c75b7c5c602a8775da0)), closes [ReVancedTeam/revanced-patches#1](https://github.com/ReVancedTeam/revanced-patches/issues/1)
* add SafeClassWriter ([6626014](https://github.com/revanced/revanced-patcher/commit/6626014ef3dde2f98a53f75d71eeb0de85189bf3))
* Add warnings for Fuzzy resolver ([715a2ad](https://github.com/revanced/revanced-patcher/commit/715a2ad025d127b5a8225ce50202a859f53c7f50))
* allow classes to be overwritten in addFiles and resolve signatures when applyPatches is called ([1db735b](https://github.com/revanced/revanced-patcher/commit/1db735b1e2b570bdb1ddce0b9cd724c580113a84))
* Allow unknown opcodes using `null` ([0e5f4ba](https://github.com/revanced/revanced-patcher/commit/0e5f4ba2d55288415c4d1be70ab6a8ab8c1c0d10))
* Finish first patcher test ([0d8d19e](https://github.com/revanced/revanced-patcher/commit/0d8d19e708a47315e28e7493618568ea40f1e062))
* Improve `SignatureResolver` ([139a23b](https://github.com/revanced/revanced-patcher/commit/139a23b7500a2d2577df47caf3fd0c5ec891a8d8))
* migrate to `DexPatchBundle` and `JarPatchBundle` ([8615798](https://github.com/revanced/revanced-patcher/commit/8615798711185b30ce622d9d09faba21f3a92f97))
* migrate to dexlib ([3651981](https://github.com/revanced/revanced-patcher/commit/36519811610192e299834e9d00627a94faad56a9))
* Minor refactor and return proxy, if class has been proxied already ([4b26305](https://github.com/revanced/revanced-patcher/commit/4b26305bd57ba9e3eb3e34218ffe10d6c5a2f598))
* optional `forStaticMethod` parameter for `InlineSmaliCompiler.compileMethodInstructions` ([41e8860](https://github.com/revanced/revanced-patcher/commit/41e88605c33d1f0d9e7f5466cac03a3b339afb82))
* patch dependencies annotation and `PatcherOptions` ([6c65952](https://github.com/revanced/revanced-patcher/commit/6c65952d80a795a3ef4a37877123e9375025d3ae))
* properly manage `ClassProxy` & add `ProxyBackedClassList` ([6cb1fdf](https://github.com/revanced/revanced-patcher/commit/6cb1fdf6171e1ab75b7ee28163965eacc00cc5a0))
* remaining mutable `EncodedValue` classes ([3f97cc8](https://github.com/revanced/revanced-patcher/commit/3f97cc8e1fa10546d7069e01e5e66a537b0d6f7e))
* string signature ([#22](https://github.com/revanced/revanced-patcher/issues/22)) ([612515a](https://github.com/revanced/revanced-patcher/commit/612515acf8539febf952f258d30aa3d4b631e3b7))
* use annotations instead of metadata objects ([d20f7fd](https://github.com/revanced/revanced-patcher/commit/d20f7fd6e1ede6ec7baccb1500ab3fc66d78df73))
* utility functions to get metadata of patch & sigs ([54511a4](https://github.com/revanced/revanced-patcher/commit/54511a4fc6417d7fe0c868d441e7d6b0ec9e218d))
### Performance Improvements
* check type instead of class ([c7ef264](https://github.com/revanced/revanced-patcher/commit/c7ef2644d83e1d8e84decb0631a6549d394180fc))
* decode manifest only when not using resource patcher ([4f60bea](https://github.com/revanced/revanced-patcher/commit/4f60bea81e0bbe85dc6c3150238980292a1e52ab))
* depend on `androlib` instead of `ApkDecoder` ([cc9416d](https://github.com/revanced/revanced-patcher/commit/cc9416dd11b66140c2882021cbe5088659d85371))
* do not resolve empty signatures list ([b1eebc9](https://github.com/revanced/revanced-patcher/commit/b1eebc99a71269df33c37f35c1f56ea20a9d6bc0))
* lazy-ify all mutable clones ([d18a3b6](https://github.com/revanced/revanced-patcher/commit/d18a3b6a28cae4fcb1c4986903208298ee50b083))
* optimize indexOf call away ([9991f39](https://github.com/revanced/revanced-patcher/commit/9991f39c9a4fa22a221aab0bbf9e08ca7f967fa9))
* use Set instead of List since there are no dupes ([e65ebd2](https://github.com/revanced/revanced-patcher/commit/e65ebd27c250b1735acf73af0f6b03274b0137f6))
* use String List and compare instead of any lambda ([5bd416b](https://github.com/revanced/revanced-patcher/commit/5bd416b409290906a6378344f70391e8692ae27f))
### Reverts
* AccessFlag extensions not working with IDE ([0bfb92a](https://github.com/revanced/revanced-patcher/commit/0bfb92a0cbd72df5ba513264efb583e201cfcf82))
* previous commits check for dupes in dexFile, not cache ([e810197](https://github.com/revanced/revanced-patcher/commit/e810197e2aa64534f2e8637165d884cbefbce8ae))
### 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
* 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.
# [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)

View File

@@ -1,24 +1,21 @@
plugins {
kotlin("jvm") version "1.6.21"
kotlin("jvm") version "1.7.0"
java
`maven-publish`
}
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()
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!
username = githubUsername
password = githubPassword
}
}
}
@@ -27,13 +24,12 @@ dependencies {
implementation(kotlin("stdlib"))
api("xpp3:xpp3:1.1.4c")
api("org.apktool:apktool-lib:2.6.1")
api("org.apktool:apktool-lib:2.6.2-SNAPSHOT")
api("app.revanced:multidexlib2:2.5.2.r2")
api("org.smali:smali:2.5.2")
testImplementation(kotlin("test"))
implementation(kotlin("reflect"))
}
implementation(kotlin("reflect"))}
tasks {
test {
@@ -49,11 +45,8 @@ java {
withJavadocJar()
}
val isGitHubCI = System.getenv("GITHUB_ACTOR") != null
publishing {
repositories {
if (isGitHubCI) {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
@@ -62,9 +55,6 @@ publishing {
password = System.getenv("GITHUB_TOKEN")
}
}
} else {
mavenLocal()
}
}
publications {
register<MavenPublication>("gpr") {

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 1.0.0-dev.18
version = 1.2.5

File diff suppressed because it is too large Load Diff

View File

@@ -3,13 +3,17 @@ package app.revanced.patcher
import java.io.File
/**
* Options for a patcher.
* @param inputFile The input file (usually an apk file).
* @param resourceCacheDirectory Directory to cache resources.
* @param patchResources Weather to use the resource patcher. Resources will still need to be decoded.
* @param aaptPath Optional path to a custom aapt binary.
* @param frameworkFolderLocation Optional path to a custom framework folder.
*/
data class PatcherOptions(
internal val inputFile: File,
// TODO: maybe a file system in memory is better. Could cause high memory usage.
internal val resourceCacheDirectory: String,
internal val patchResources: Boolean = false
internal val patchResources: Boolean = false,
internal val aaptPath: String = "",
internal val frameworkFolderLocation: String? = null
)

View File

@@ -0,0 +1,13 @@
package app.revanced.patcher
import app.revanced.patcher.util.dex.DexFile
/**
* The result of a patcher.
* @param dexFiles The patched dex files.
* @param doNotCompress List of relative paths to files to exclude from compressing.
*/
data class PatcherResult(
val dexFiles: List<DexFile>,
val doNotCompress: List<String>? = null
)

View File

@@ -0,0 +1,13 @@
package app.revanced.patcher.data
import brut.androlib.meta.MetaInfo
/**
* Metadata about a package.
*/
class PackageMetadata {
lateinit var packageName: String
lateinit var packageVersion: String
internal val metaInfo: MetaInfo = MetaInfo()
}

View File

@@ -7,10 +7,12 @@ import app.revanced.patcher.patch.base.Patch
import org.jf.dexlib2.iface.ClassDef
import java.io.File
internal data class PatcherData(
val internalClasses: MutableList<ClassDef>,
val resourceCacheDirectory: String
data class PatcherData(
internal val internalClasses: MutableList<ClassDef>,
internal val resourceCacheDirectory: String,
val packageMetadata: PackageMetadata
) {
internal val patches = mutableListOf<Class<out Patch<Data>>>()
internal val bytecodeData = BytecodeData(internalClasses)

View File

@@ -34,7 +34,6 @@ class DomFileEditor internal constructor(private val domFile: File) : Closeable
init {
val factory = DocumentBuilderFactory.newInstance()
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true)
val builder = factory.newDocumentBuilder()

View File

@@ -41,13 +41,15 @@ object PatchExtensions {
val Class<out Patch<Data>>.patchName: String
get() = recursiveAnnotation(Name::class)?.name ?: this.javaClass.simpleName
val Class<out Patch<Data>>.version get() = recursiveAnnotation(Version::class)?.version
val Class<out Patch<Data>>.include get() = recursiveAnnotation(app.revanced.patcher.patch.annotations.Patch::class)!!.include
val Class<out Patch<Data>>.description get() = recursiveAnnotation(Description::class)?.description
val Class<out Patch<Data>>.dependencies get() = recursiveAnnotation(app.revanced.patcher.patch.annotations.Dependencies::class)?.dependencies
val Class<out Patch<Data>>.compatiblePackages get() = recursiveAnnotation(Compatibility::class)?.compatiblePackages
}
object MethodSignatureExtensions {
val MethodSignature.name: String get() = javaClass.recursiveAnnotation(Name::class)?.name ?: this.javaClass.simpleName
val MethodSignature.name: String
get() = javaClass.recursiveAnnotation(Name::class)?.name ?: this.javaClass.simpleName
val MethodSignature.version get() = javaClass.recursiveAnnotation(Version::class)?.version ?: "0.0.1"
val MethodSignature.description get() = javaClass.recursiveAnnotation(Description::class)?.description
val MethodSignature.compatiblePackages get() = javaClass.recursiveAnnotation(Compatibility::class)?.compatiblePackages

View File

@@ -6,11 +6,12 @@ import kotlin.reflect.KClass
/**
* Annotation to mark a Class as a patch.
* @param include If false, the patch should be treated as optional by default.
*/
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
annotation class Patch
annotation class Patch(val include: Boolean = true)
/**
* Annotation for dependencies of [Patch]es .

View File

@@ -76,19 +76,17 @@ internal class MethodSignatureResolver(
signature.strings?.let { strings ->
method.implementation ?: return null
method.implementation!!.instructions.let { instructions ->
val stringsList = strings.toMutableList()
val stringsList = strings.toMutableList()
for (instruction in instructions) {
if (instruction.opcode != Opcode.CONST_STRING) continue
for (instruction in method.implementation!!.instructions) {
if (instruction.opcode != Opcode.CONST_STRING) continue
val string = ((instruction as Instruction21c).reference as StringReference).string
val i = stringsList.indexOfFirst { it == string }
if (i != -1) stringsList.removeAt(i)
}
if (stringsList.isNotEmpty()) return null
val string = ((instruction as Instruction21c).reference as StringReference).string
val i = stringsList.indexOfFirst { it == string }
if (i != -1) stringsList.removeAt(i)
}
if (stringsList.isNotEmpty()) return null
}
return if (signature.opcodes == null) {

View File

@@ -0,0 +1,10 @@
package app.revanced.patcher.util.dex
import org.jf.dexlib2.writer.io.MemoryDataStore
/**
* Wrapper for dex files.
* @param name The original name of the dex file
* @param memoryDataStore The data store for the dex file.
*/
data class DexFile(val name: String, val memoryDataStore: MemoryDataStore)