mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-04-30 14:44:33 +02:00
24 lines
847 B
Kotlin
24 lines
847 B
Kotlin
package app.revanced.util.patch
|
|
|
|
import app.revanced.extensions.containsWideLiteralInstructionValue
|
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
import com.android.tools.smali.dexlib2.Opcode
|
|
|
|
abstract class LiteralValueFingerprint(
|
|
returnType: String? = null,
|
|
accessFlags: Int? = null,
|
|
parameters: Iterable<String>? = null,
|
|
opcodes: Iterable<Opcode>? = null,
|
|
strings: Iterable<String>? = null,
|
|
// Has to be a supplier because the fingerprint is created before patches can set literals.
|
|
literalSupplier: () -> Long
|
|
) : MethodFingerprint(
|
|
returnType = returnType,
|
|
accessFlags = accessFlags,
|
|
parameters = parameters,
|
|
opcodes = opcodes,
|
|
strings = strings,
|
|
customFingerprint = { methodDef, _ ->
|
|
methodDef.containsWideLiteralInstructionValue(literalSupplier())
|
|
}
|
|
) |