parent
ab08bc92d9
commit
f7352feb6e
496 changed files with 2425 additions and 2551 deletions
|
|
@ -3,14 +3,12 @@ package app.revanced.util.patch
|
|||
import app.revanced.extensions.findMutableMethodOf
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import org.jf.dexlib2.iface.ClassDef
|
||||
import org.jf.dexlib2.iface.Method
|
||||
import org.jf.dexlib2.iface.instruction.Instruction
|
||||
import com.android.tools.smali.dexlib2.iface.ClassDef
|
||||
import com.android.tools.smali.dexlib2.iface.Method
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
||||
|
||||
internal abstract class AbstractTransformInstructionsPatch<T> : BytecodePatch() {
|
||||
abstract class AbstractTransformInstructionsPatch<T> : BytecodePatch() {
|
||||
|
||||
abstract fun filterMap(
|
||||
classDef: ClassDef,
|
||||
|
|
@ -28,7 +26,7 @@ internal abstract class AbstractTransformInstructionsPatch<T> : BytecodePatch()
|
|||
}
|
||||
}
|
||||
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
// Find all methods to patch
|
||||
buildMap {
|
||||
context.classes.forEach { classDef ->
|
||||
|
|
@ -62,7 +60,5 @@ internal abstract class AbstractTransformInstructionsPatch<T> : BytecodePatch()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package app.revanced.util.patch
|
|||
|
||||
import app.revanced.extensions.containsConstantInstructionValue
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
abstract class LiteralValueFingerprint(
|
||||
returnType: String? = null,
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@ package app.revanced.util.patch
|
|||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.ClassDef
|
||||
import org.jf.dexlib2.iface.instruction.Instruction
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
import org.jf.dexlib2.iface.reference.MethodReference
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.ClassDef
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
|
||||
internal typealias Instruction35cInfo = Triple<IMethodCall, Instruction35c, Int>
|
||||
typealias Instruction35cInfo = Triple<IMethodCall, Instruction35c, Int>
|
||||
|
||||
internal interface IMethodCall {
|
||||
interface IMethodCall {
|
||||
val definedClassName: String
|
||||
val methodName: String
|
||||
val methodParams: Array<String>
|
||||
|
|
@ -62,14 +62,14 @@ internal interface IMethodCall {
|
|||
}
|
||||
}
|
||||
|
||||
internal inline fun <reified E> fromMethodReference(methodReference: MethodReference)
|
||||
inline fun <reified E> fromMethodReference(methodReference: MethodReference)
|
||||
where E : Enum<E>, E : IMethodCall = enumValues<E>().firstOrNull { search ->
|
||||
search.definedClassName == methodReference.definingClass
|
||||
&& search.methodName == methodReference.name
|
||||
&& methodReference.parameterTypes.toTypedArray().contentEquals(search.methodParams)
|
||||
}
|
||||
|
||||
internal inline fun <reified E> filterMapInstruction35c(
|
||||
inline fun <reified E> filterMapInstruction35c(
|
||||
integrationsClassDescriptorPrefix: String,
|
||||
classDef: ClassDef,
|
||||
instruction: Instruction,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue