mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2026-01-27 13:11:03 +00:00
Convert typed Object & Array types to Object types
Commit name is a bit superfluous, but it means that types such as "Ljava/lang/String;" get converted to "Ljava/lang/Object;". This is so we don't need to know the mappings, which are random in YT's code. This is done in MethodResolver's "convertObject" and "convertObjects" for arrays. Also changed ExtraTypes.ArrayAny to Object instead of String, that was a mistake. (which caused the test to pass at first)
This commit is contained in:
@@ -4,6 +4,7 @@ import net.revanced.patcher.patch.Patch
|
||||
import net.revanced.patcher.patch.PatchResultSuccess
|
||||
import net.revanced.patcher.signature.Signature
|
||||
import net.revanced.patcher.util.ExtraTypes
|
||||
import net.revanced.patcher.writer.ASMWriter.testingWow
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.objectweb.asm.Opcodes.*
|
||||
import org.objectweb.asm.Type
|
||||
@@ -11,12 +12,10 @@ import org.objectweb.asm.Type
|
||||
internal class PatcherTest {
|
||||
private val testSigs: Array<Signature> = arrayOf(
|
||||
Signature(
|
||||
"testMethod",
|
||||
"mainMethod",
|
||||
Type.VOID_TYPE,
|
||||
ACC_PUBLIC or ACC_STATIC,
|
||||
arrayOf(
|
||||
ExtraTypes.ArrayAny,
|
||||
),
|
||||
arrayOf(ExtraTypes.ArrayAny),
|
||||
arrayOf(
|
||||
GETSTATIC,
|
||||
LDC,
|
||||
@@ -32,7 +31,8 @@ internal class PatcherTest {
|
||||
|
||||
patcher.addPatches(
|
||||
Patch ("TestPatch") {
|
||||
patcher.cache.methods["testMethod"]
|
||||
val main = patcher.cache.methods["mainMethod"]
|
||||
//main.method.instructions!!.testingWow()
|
||||
PatchResultSuccess()
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user