mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-28 19:05:49 +01:00
fix(trakt): bump compatibility to newer version (#2554)
This commit is contained in:
parent
a9060954c7
commit
2a2897dc9e
@ -4,7 +4,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|||||||
|
|
||||||
object IsVIPEPFingerprint : MethodFingerprint(
|
object IsVIPEPFingerprint : MethodFingerprint(
|
||||||
customFingerprint = custom@{ methodDef, _ ->
|
customFingerprint = custom@{ methodDef, _ ->
|
||||||
if (!methodDef.definingClass.endsWith("RealmUserSettings;")) return@custom false
|
if (!methodDef.definingClass.endsWith("RemoteUser;")) return@custom false
|
||||||
|
|
||||||
methodDef.name == "isVIPEP"
|
methodDef.name == "isVIPEP"
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|||||||
|
|
||||||
object IsVIPFingerprint : MethodFingerprint(
|
object IsVIPFingerprint : MethodFingerprint(
|
||||||
customFingerprint = custom@{ methodDef, _ ->
|
customFingerprint = custom@{ methodDef, _ ->
|
||||||
if (!methodDef.definingClass.endsWith("RealmUserSettings;")) return@custom false
|
if (!methodDef.definingClass.endsWith("RemoteUser;")) return@custom false
|
||||||
|
|
||||||
methodDef.name == "isVIP"
|
methodDef.name == "isVIP"
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@ package app.revanced.patches.trakt.fingerprints
|
|||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
object RealmUserSettingsFingerprint : MethodFingerprint(
|
object RemoteUserFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef, _ ->
|
customFingerprint = { methodDef, _ ->
|
||||||
methodDef.definingClass.endsWith("RealmUserSettings;")
|
methodDef.definingClass.endsWith("RemoteUser;")
|
||||||
}
|
}
|
||||||
)
|
)
|
@ -14,7 +14,7 @@ import app.revanced.patcher.patch.annotations.Patch
|
|||||||
import app.revanced.patches.trakt.annotations.UnlockProCompatibility
|
import app.revanced.patches.trakt.annotations.UnlockProCompatibility
|
||||||
import app.revanced.patches.trakt.fingerprints.IsVIPEPFingerprint
|
import app.revanced.patches.trakt.fingerprints.IsVIPEPFingerprint
|
||||||
import app.revanced.patches.trakt.fingerprints.IsVIPFingerprint
|
import app.revanced.patches.trakt.fingerprints.IsVIPFingerprint
|
||||||
import app.revanced.patches.trakt.fingerprints.RealmUserSettingsFingerprint
|
import app.revanced.patches.trakt.fingerprints.RemoteUserFingerprint
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("unlock-pro")
|
@Name("unlock-pro")
|
||||||
@ -22,20 +22,20 @@ import app.revanced.patches.trakt.fingerprints.RealmUserSettingsFingerprint
|
|||||||
@UnlockProCompatibility
|
@UnlockProCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class UnlockProPatch : BytecodePatch(
|
class UnlockProPatch : BytecodePatch(
|
||||||
listOf(RealmUserSettingsFingerprint)
|
listOf(RemoteUserFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
RealmUserSettingsFingerprint.result?.classDef?.let { realUserSettingsClass ->
|
RemoteUserFingerprint.result?.classDef?.let { remoteUserClass ->
|
||||||
arrayOf(IsVIPFingerprint, IsVIPEPFingerprint).onEach { fingerprint ->
|
arrayOf(IsVIPFingerprint, IsVIPEPFingerprint).onEach { fingerprint ->
|
||||||
// Resolve both fingerprints on the same class.
|
// Resolve both fingerprints on the same class.
|
||||||
if (!fingerprint.resolve(context, realUserSettingsClass))
|
if (!fingerprint.resolve(context, remoteUserClass))
|
||||||
throw fingerprint.toErrorResult()
|
throw fingerprint.toErrorResult()
|
||||||
}.forEach { fingerprint ->
|
}.forEach { fingerprint ->
|
||||||
// Return true for both VIP check methods.
|
// Return true for both VIP check methods.
|
||||||
fingerprint.result?.mutableMethod?.addInstructions(0, RETURN_TRUE_INSTRUCTIONS)
|
fingerprint.result?.mutableMethod?.addInstructions(0, RETURN_TRUE_INSTRUCTIONS)
|
||||||
?: return fingerprint.toErrorResult()
|
?: return fingerprint.toErrorResult()
|
||||||
}
|
}
|
||||||
} ?: return RealmUserSettingsFingerprint.toErrorResult()
|
} ?: return RemoteUserFingerprint.toErrorResult()
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user