48 Commits

Author SHA1 Message Date
Sculas
1b42f65d95
refactor: migrate to custom exceptions for patch options 2022-08-02 22:16:37 +02:00
Sculas
67a5237541
test: refactor & add more tests 2022-08-02 22:00:32 +02:00
Sculas
2431785d0e
feat: registry for patch options
BREAKING CHANGE: Patch options now use the PatchOptions registry class instead of an Iterable. This change requires modifications to existing patches using this API.
2022-08-02 21:10:14 +02:00
Sculas
ec1d8a8fba
refactor: remove DependencyType.SOFT (#82)
BREAKING-CHANGE: DependencyType.SOFT has now been removed after it was deprecated. There is no direct replacement for this. Please look into Patch Options instead, which supersedes this.
2022-08-02 00:47:32 +02:00
Sculas
fbb09f38dc
feat: patch options (#81)
* feat: Patch Options

* refactor: remove delegate property

* feat: List patch options

* refactor: add setter example to PatchOptionsUsage.kt

* docs: add docs for PatchOptions

* docs: tidy docs
2022-08-02 00:31:00 +02:00
Sculas
8c12f8d488
feat: Soft Dependencies for Patches 2022-07-31 16:50:59 +02:00
Sculas
4813a8b48e
chore: remove import 2022-07-31 15:01:38 +02:00
Sculas
d5c66022c9
refactor: get rid of package names in example 2022-07-31 15:01:13 +02:00
oSumAtrIX
dd941233ca
refactor: improve the addInstructions extension method further more 2022-07-09 06:26:05 +02:00
Lucaskyy
6bfe5716c3
feat: Improve Smali Compiler
- Branching support has been added. See InlineSmaliCompilerTest.kt for an example.
- Some other improvements have been made too.
2022-06-27 21:11:59 +02:00
Lucaskyy
f565c4f6a7
refactor: improve ResourceData.kt
Old methods have been marked as deprecated, and will be removed in the future.

- ResourceData.kt was made an Iterable<File>, and the forEach method was removed in favor of Kotlin's forEach function. (no modifications required)
- The resolve method was deprecated in favor of a new operator getter function, which can be either called using get(path) or data[path]. This keeps backwards compatibility with the old get method.
- The getXmlEditor method was deprecated in favor of the new xmlEditor variable, which is a XmlFileHolder which has an operator getter which acts like an array. This is syntactically better.
2022-06-26 17:14:38 +02:00
Lucaskyy
35749454ab
refactor: remove deprecated methods in ResourceData.kt 2022-06-26 16:53:25 +02:00
Lucaskyy
081a5a6849
refactor: fmt ExampleBytecodePatch.kt 2022-06-26 16:21:55 +02:00
oSumAtrIX
efa8ea1445 refactor: migrate from Signature to Fingerprint
BREAKING CHANGE: Not backwards compatible, since a lot of classes where renamed.
2022-06-26 15:10:54 +02:00
oSumAtrIX
e47b67d7ec
feat: simplify adding instructions 2022-06-20 21:20:51 +02:00
oSumAtrIX
5535eb4f01
refactor: improve ExampleResourcePatch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:33 +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
oSumAtrIX
024fa867e1
fix: qualifying Element with wrong package
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:31 +02:00
oSumAtrIX
fc05fe79de
fix: failing tests temporarily
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:29 +02:00
oSumAtrIX
99319e63da
add: resource patcher
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:28 +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
6cb1fdf617
feat: properly manage ClassProxy & add ProxyBackedClassList
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-05 08:03:25 +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
bca948658e
test: Add tests for unknown opcodes 2022-06-05 08:03:20 +02:00
Lucaskyy
715a2ad025
feat: Add warnings for Fuzzy resolver 2022-06-05 08:03:18 +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
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
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
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
Lucaskyy
94dbb573cf
refactor: bump multidexlib2, dexlib2 and smali 2022-06-05 08:03:07 +02:00
Lucaskyy
c267b12a7d
refactor: make method a property 2022-06-05 08:03:04 +02:00
Lucaskyy
45303f66ec
test: fix test with previous changes 2022-06-05 08:03:03 +02:00
oSumAtrIX
0d8d19e708
feat: Finish first patcher test 2022-06-05 08:03:00 +02:00
oSumAtrIX
544bcf76bd
feat: Add first tests 2022-06-05 08:02:58 +02:00
oSumAtrIX
3651981161
feat: migrate to dexlib
BREAKING CHANGE: Removed usage of ASM library
2022-06-05 08:02:51 +02:00
Lucaskyy
fa6e454ae9
test: fix assert message 2022-06-05 08:02:50 +02:00
Lucaskyy
cbd8df2df0
fix(MethodResolver): fix cd57a8c9a0db7e3ae5ad0bca202e5955930319ab 2022-06-05 08:02:49 +02:00
Lucaskyy
699c730a7c
fix(MethodResolver): strip labels and line numbers so opcode patterns match 2022-06-05 08:02:48 +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
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