mirror of
https://github.com/revanced/revanced-patches
synced 2024-06-02 11:26:20 +02:00
862a7ec5b0
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
21 lines
745 B
Kotlin
21 lines
745 B
Kotlin
package app.revanced.patches.pixiv.ads.fingerprints
|
|
|
|
import app.revanced.patcher.extensions.or
|
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
import org.jf.dexlib2.AccessFlags
|
|
|
|
|
|
object IsNotPremiumFingerprint : MethodFingerprint(
|
|
"V",
|
|
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
|
listOf("L"),
|
|
strings = listOf("pixivAccountManager"),
|
|
customFingerprint = custom@{ _, classDef ->
|
|
// The "isNotPremium" method is the only method in the class.
|
|
if (classDef.virtualMethods.count() != 1) return@custom false
|
|
|
|
classDef.virtualMethods.first().let { isNotPremiumMethod ->
|
|
isNotPremiumMethod.parameterTypes.size == 0 && isNotPremiumMethod.returnType == "Z"
|
|
}
|
|
}
|
|
) |