180 Commits

Author SHA1 Message Date
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
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
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 cd57a8c9a0db7e3ae5ad0bca202e5955930319ab 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 8d1bb5f3d9da544cf6e3e3848bfcc56327cde810 because it corrupted the stack by completely removing the nodes
2022-06-05 08:02:49 +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
Lucaskyy
41749ba829
fix: give ClassWriter a ClassReader for symtable
removed SafeClassWriter as it was unused
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
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
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
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