refactor: make use of named arguments

This commit is contained in:
oSumAtrIX 2022-08-31 20:37:21 +02:00
parent bcef48c8e2
commit e678115b24
93 changed files with 160 additions and 393 deletions

View File

@ -3,9 +3,9 @@ package app.revanced.patches.music.audio.codecs.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@ -19,7 +19,7 @@ import org.jf.dexlib2.Opcode
@CodecsUnlockCompatibility
@Version("0.0.1")
object CodecsLockFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, null, listOf(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, opcodes = listOf(
Opcode.INVOKE_DIRECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
@ -35,5 +35,5 @@ object CodecsLockFingerprint : MethodFingerprint(
Opcode.INVOKE_DIRECT,
Opcode.RETURN_OBJECT
),
listOf("eac3_supported")
strings = listOf("eac3_supported")
)

View File

@ -2,9 +2,9 @@ package app.revanced.patches.music.misc.microg.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
@Name("cast-context-fetch-fingerprint")
@ -15,6 +15,5 @@ import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibi
@MicroGPatchCompatibility
@Version("0.0.1")
object CastContextFetchFingerprint : MethodFingerprint(
null, null, null, null,
listOf("Error fetching CastContext.")
strings = listOf("Error fetching CastContext.")
)

View File

@ -2,9 +2,9 @@ package app.revanced.patches.music.misc.microg.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
@Name("cast-module-fingerprint")
@ -15,6 +15,5 @@ import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibi
@MicroGPatchCompatibility
@Version("0.0.1")
object CastDynamiteModuleFingerprint : MethodFingerprint(
null, null, null, null,
listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
strings = listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
)

View File

@ -2,9 +2,9 @@ package app.revanced.patches.music.misc.microg.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
@Name("cast-context-fetch-fingerprint")
@ -15,6 +15,5 @@ import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibi
@MicroGPatchCompatibility
@Version("0.0.1")
object CastDynamiteModuleV2Fingerprint : MethodFingerprint(
null, null, null, null,
listOf("Failed to load module via V2: ")
strings = listOf("Failed to load module via V2: ")
)

View File

@ -3,9 +3,9 @@ package app.revanced.patches.music.misc.microg.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
import org.jf.dexlib2.AccessFlags
@ -17,5 +17,14 @@ import org.jf.dexlib2.AccessFlags
@MusicMicroGPatchCompatibility
@Version("0.0.1")
object GooglePlayUtilityFingerprint : MethodFingerprint(
"I", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), null, listOf("This should never happen.", "MetadataValueReader", "GooglePlayServicesUtil", "com.android.vending", "android.hardware.type.embedded")
"I",
AccessFlags.PUBLIC or AccessFlags.STATIC,
listOf("L", "I"),
strings = listOf(
"This should never happen.",
"MetadataValueReader",
"GooglePlayServicesUtil",
"com.android.vending",
"android.hardware.type.embedded"
)
)

View File

@ -2,9 +2,9 @@ package app.revanced.patches.music.misc.microg.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
@Name("google-play-prime-fingerprint")
@ -15,5 +15,5 @@ import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompat
@MusicMicroGPatchCompatibility
@Version("0.0.1")
object PrimeFingerprint : MethodFingerprint(
null, null, null, null, listOf("com.google.android.GoogleCamera", "com.android.vending")
strings = listOf("com.google.android.GoogleCamera", "com.android.vending")
)

View File

@ -3,9 +3,9 @@ package app.revanced.patches.music.misc.microg.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
import org.jf.dexlib2.AccessFlags
@ -17,5 +17,8 @@ import org.jf.dexlib2.AccessFlags
@MusicMicroGPatchCompatibility
@Version("0.0.1")
object ServiceCheckFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), null, listOf("Google Play Services not available")
"V",
AccessFlags.PUBLIC or AccessFlags.STATIC,
listOf("L", "I"),
strings = listOf("Google Play Services not available")
)

View File

@ -3,11 +3,7 @@ package app.revanced.patches.reddit.ad.general.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.reddit.frontpage", arrayOf()
)]
)
@Compatibility([Package("com.reddit.frontpage")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class GeneralAdsCompatibility

View File

@ -3,11 +3,7 @@ package app.revanced.patches.reddit.layout.premiumicon.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.reddit.frontpage", arrayOf()
)]
)
@Compatibility([Package("com.reddit.frontpage")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class PremiumIconCompatibility

View File

@ -2,8 +2,8 @@ package app.revanced.patches.reddit.layout.premiumicon.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.reddit.layout.premiumicon.annotations.PremiumIconCompatibility
@Name("premium-icon-fingerprint")
@ -14,11 +14,7 @@ import app.revanced.patches.reddit.layout.premiumicon.annotations.PremiumIconCom
@Version("0.0.1")
object PremiumIconFingerprint : MethodFingerprint(
"Z",
null,
null,
null,
null,
{ methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("MyAccount;") && methodDef.name == "isPremiumSubscriber"
}
)

View File

@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[
Package("com.ss.android.ugc.trill", arrayOf()),
Package("com.zhiliaoapp.musically", arrayOf())
Package("com.ss.android.ugc.trill"),
Package("com.zhiliaoapp.musically")
]
)
@Target(AnnotationTarget.CLASS)

View File

@ -14,7 +14,7 @@ import app.revanced.patches.tiktok.ad.annotations.TiktokAdsCompatibility
@TiktokAdsCompatibility
@Version("0.0.1")
object FeedItemListCloneFingerprint : MethodFingerprint(
null, null, null, null,null, { methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("/FeedItemList;") && methodDef.name == "clone"
}
)

View File

@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[
Package("com.ss.android.ugc.trill", arrayOf()),
Package("com.zhiliaoapp.musically", arrayOf())
Package("com.ss.android.ugc.trill"),
Package("com.zhiliaoapp.musically")
]
)
@Target(AnnotationTarget.CLASS)

View File

@ -15,10 +15,7 @@ import org.jf.dexlib2.AccessFlags
object ACLCommonShareFingerprint : MethodFingerprint(
"I",
AccessFlags.PUBLIC or AccessFlags.FINAL,
null,
null,
null,
{ methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("/ACLCommonShare;") &&
methodDef.name == "getCode"
}

View File

@ -15,10 +15,7 @@ import org.jf.dexlib2.AccessFlags
object ACLCommonShareFingerprint2 : MethodFingerprint(
"I",
AccessFlags.PUBLIC or AccessFlags.FINAL,
null,
null,
null,
{ methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("/ACLCommonShare;") &&
methodDef.name == "getShowType"
}

View File

@ -15,10 +15,7 @@ import org.jf.dexlib2.AccessFlags
object ACLCommonShareFingerprint3 : MethodFingerprint(
"I",
AccessFlags.PUBLIC or AccessFlags.FINAL,
null,
null,
null,
{ methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("/ACLCommonShare;") &&
methodDef.name == "getTranscode"
}

View File

@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[
Package("com.ss.android.ugc.trill", arrayOf()),
Package("com.zhiliaoapp.musically", arrayOf())
Package("com.ss.android.ugc.trill"),
Package("com.zhiliaoapp.musically")
]
)
@Target(AnnotationTarget.CLASS)

View File

@ -14,10 +14,7 @@ import org.jf.dexlib2.AccessFlags
object AwemeGetVideoControlFingerprint : MethodFingerprint(
"L",
AccessFlags.PUBLIC.value,
null,
null,
null,
{ methodDef ->
methodDef.definingClass.endsWith("/Aweme;") && methodDef.name == "getVideoControl"
}
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("/Aweme;") && methodDef.name == "getVideoControl"
}
)

View File

@ -3,11 +3,7 @@ package app.revanced.patches.twitter.ad.timeline.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.twitter.android", arrayOf()
)]
)
@Compatibility([Package("com.twitter.android")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class TimelineAdsCompatibility

View File

@ -12,7 +12,7 @@ import org.jf.dexlib2.Opcode
@TimelineAdsCompatibility
@Version("0.0.1")
object TimelineTweetJsonParserFingerprint : MethodFingerprint(
null, null, null, listOf(
opcodes = listOf(
Opcode.IPUT_OBJECT,
Opcode.GOTO,
Opcode.SGET_OBJECT,
@ -21,6 +21,6 @@ object TimelineTweetJsonParserFingerprint : MethodFingerprint(
Opcode.CHECK_CAST,
Opcode.IPUT_OBJECT,
Opcode.RETURN_VOID,
), listOf("tweetPromotedMetadata", "promotedMetadata", "hasModeratedReplies", "conversationAnnotation"),
{ methodDef -> methodDef.name == "parseField" }
), strings = listOf("tweetPromotedMetadata", "promotedMetadata", "hasModeratedReplies", "conversationAnnotation"),
customFingerprint = { methodDef -> methodDef.name == "parseField" }
)

View File

@ -3,11 +3,7 @@ package app.revanced.patches.warnwetter.misc.firebasegetcert.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"de.dwd.warnapp", arrayOf()
)]
)
@Compatibility([Package("de.dwd.warnapp")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class FirebaseGetCertPatchCompatibility

View File

@ -14,10 +14,7 @@ import app.revanced.patches.warnwetter.misc.firebasegetcert.annotations.Firebase
@Version("0.0.1")
object GetMessagingCertFingerprint : MethodFingerprint(
"Ljava/lang/String;",
null,
null,
null,
listOf(
strings = listOf(
"ContentValues",
"Could not get fingerprint hash for package: ",
"No such package: "

View File

@ -14,10 +14,7 @@ import app.revanced.patches.warnwetter.misc.firebasegetcert.annotations.Firebase
@Version("0.0.1")
object GetReqistrationCertFingerprint : MethodFingerprint(
"Ljava/lang/String;",
null,
null,
null,
listOf(
strings = listOf(
"FirebaseRemoteConfig",
"Could not get fingerprint hash for package: ",
"No such package: "

View File

@ -3,11 +3,7 @@ package app.revanced.patches.warnwetter.misc.promocode.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"de.dwd.warnapp", arrayOf()
)]
)
@Compatibility([Package("de.dwd.warnapp")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class PromoCodeUnlockCompatibility

View File

@ -2,8 +2,8 @@ package app.revanced.patches.warnwetter.misc.promocode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.warnwetter.misc.promocode.annotations.PromoCodeUnlockCompatibility
@Name("promo-code-unlock-fingerprint")
@ -13,12 +13,7 @@ import app.revanced.patches.warnwetter.misc.promocode.annotations.PromoCodeUnloc
@PromoCodeUnlockCompatibility
@Version("0.0.1")
object PromoCodeUnlockFingerprint : MethodFingerprint(
null,
null,
null,
null,
null,
{ methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("PromoTokenVerification;") && methodDef.name == "isValid"
}
)

View File

@ -17,8 +17,5 @@ import org.jf.dexlib2.AccessFlags
object HideInfocardSuggestionsFingerprint : MethodFingerprint(
"Ljava/lang/Boolean;",
AccessFlags.PUBLIC or AccessFlags.FINAL,
null,
null,
listOf("vibrator"),
null
strings = listOf("vibrator")
)

View File

@ -3,9 +3,9 @@ package app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.ad.infocardsuggestions.annotations.HideInfocardSuggestionsCompatibility
import org.jf.dexlib2.AccessFlags
@ -17,8 +17,5 @@ import org.jf.dexlib2.AccessFlags
object HideInfocardSuggestionsParentFingerprint : MethodFingerprint(
"Ljava/lang/String;",
AccessFlags.PUBLIC or AccessFlags.FINAL,
listOf(),
null,
listOf("player_overlay_info_card_teaser"),
null
strings = listOf("player_overlay_info_card_teaser"),
)

View File

@ -17,5 +17,5 @@ import org.jf.dexlib2.AccessFlags
@VideoAdsCompatibility
@Version("0.0.1")
object ShowVideoAdsFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), null
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z")
)

View File

@ -15,7 +15,7 @@ import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeCo
@SwipeControlsCompatibility
@Version("0.0.1")
object SwipeControlsHostActivityFingerprint : MethodFingerprint(
null, null, null, null, null, { methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass == "Lapp/revanced/integrations/swipecontrols/SwipeControlsHostActivity;" && methodDef.name == "<init>"
}
)

View File

@ -15,7 +15,7 @@ import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeCo
@SwipeControlsCompatibility
@Version("0.0.1")
object WatchWhileActivityFingerprint : MethodFingerprint(
null, null, null, null, null, { methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("WatchWhileActivity;") && methodDef.name == "<init>"
}
)

View File

@ -92,8 +92,6 @@ class SwipeControlsResourcePatch : ResourcePatch() {
)
)
val resourcesDir = "swipecontrols"
data.copyResources(
"swipecontrols",
ResourceUtils.ResourceGroup(

View File

@ -3,11 +3,7 @@ package app.revanced.patches.youtube.layout.amoled.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf()
)]
)
@Compatibility([Package("com.google.android.youtube")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class AmoledCompatibility

View File

@ -3,7 +3,6 @@ package app.revanced.patches.youtube.layout.autoplaybutton.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.autoplaybutton.annotations.AutoplayButtonCompatibility
@ -19,8 +18,7 @@ import org.jf.dexlib2.Opcode
object AutoNavInformerFingerprint : MethodFingerprint(
"Z",
AccessFlags.PUBLIC or AccessFlags.FINAL,
null,
listOf(
opcodes = listOf(
Opcode.IGET_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT,
@ -28,6 +26,5 @@ object AutoNavInformerFingerprint : MethodFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
),
null,
{ it.definingClass.endsWith("WillAutonavInformer;") }
customFingerprint = { it.definingClass.endsWith("WillAutonavInformer;") }
)

View File

@ -13,8 +13,8 @@ import app.revanced.patches.youtube.layout.autoplaybutton.annotations.AutoplayBu
@AutoplayButtonCompatibility
@Version("0.0.1")
object LayoutConstructorFingerprint : MethodFingerprint(
null, null, null, null, listOf("1.0x"),
{ methodDef ->
strings = listOf("1.0x"),
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("YouTubeControlsOverlay;")
}
)

View File

@ -3,11 +3,7 @@ package app.revanced.patches.youtube.layout.branding.header.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf()
)]
)
@Compatibility([Package("com.google.android.youtube")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class PremiumHeadingCompatibility

View File

@ -3,11 +3,7 @@ package app.revanced.patches.youtube.layout.branding.icon.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf()
)]
)
@Compatibility([Package("com.google.android.youtube")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class CustomBrandingCompatibility

View File

@ -3,11 +3,7 @@ package app.revanced.patches.youtube.layout.castbutton.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf()
)]
)
@Compatibility([Package("com.google.android.youtube")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class CastButtonCompatibility

View File

@ -16,10 +16,7 @@ import org.jf.dexlib2.Opcode
@ShortsButtonCompatibility
@Version("0.0.1")
object FullscreenViewAdderFingerprint : MethodFingerprint(
null,
null,
null,
listOf(
opcodes = listOf(
Opcode.IGET_BOOLEAN
)
)

View File

@ -16,10 +16,8 @@ import org.jf.dexlib2.Opcode
@ShortsButtonCompatibility
@Version("0.0.1")
object FullscreenViewAdderParentFingerprint : MethodFingerprint(
null,
null,
listOf("L", "L"),
listOf(
parameters = listOf("L", "L"),
opcodes = listOf(
Opcode.GOTO,
Opcode.IGET_BOOLEAN,
Opcode.IF_EQ,
@ -27,6 +25,5 @@ object FullscreenViewAdderParentFingerprint : MethodFingerprint(
Opcode.CONST_4,
Opcode.INVOKE_VIRTUAL,
),
null,
{ it.definingClass.endsWith("FullscreenEngagementPanelOverlay;") }
customFingerprint = { it.definingClass.endsWith("FullscreenEngagementPanelOverlay;") }
)

View File

@ -3,9 +3,9 @@ package app.revanced.patches.youtube.layout.reels.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
import org.jf.dexlib2.AccessFlags
@ -17,6 +17,6 @@ import org.jf.dexlib2.AccessFlags
@HideReelsCompatibility
@Version("0.0.1")
object HideReelsFingerprint : MethodFingerprint(
null, AccessFlags.PROTECTED or AccessFlags.FINAL, listOf("L", "L"), null,
listOf("multiReelDismissalCallback", "reelItemRenderers", "reelDismissalInfo")
access = AccessFlags.PROTECTED or AccessFlags.FINAL, parameters = listOf("L", "L"),
strings = listOf("multiReelDismissalCallback", "reelItemRenderers", "reelDismissalInfo")
)

View File

@ -19,7 +19,5 @@ import org.jf.dexlib2.AccessFlags
object DislikeFingerprint : MethodFingerprint(
"V",
AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR,
null,
null,
listOf("like/dislike")
strings = listOf("like/dislike")
)

View File

@ -19,7 +19,5 @@ import org.jf.dexlib2.AccessFlags
object LikeFingerprint : MethodFingerprint(
"V",
AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR,
null,
null,
listOf("like/like")
strings = listOf("like/like")
)

View File

@ -19,7 +19,5 @@ import org.jf.dexlib2.AccessFlags
object RemoveLikeFingerprint : MethodFingerprint(
"V",
AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR,
null,
null,
listOf("like/removelike")
strings = listOf("like/removelike")
)

View File

@ -15,9 +15,5 @@ import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.Retu
@ReturnYouTubeDislikeCompatibility
@Version("0.0.1")
object TextComponentSpecParentFingerprint : MethodFingerprint(
null,
null,
null,
null,
listOf("TextComponentSpec: No converter for extension: ")
strings = listOf("TextComponentSpec: No converter for extension: ")
)

View File

@ -15,7 +15,6 @@ import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlock
@SponsorBlockCompatibility
@Version("0.0.1")
object CreateVideoPlayerSeekbarFingerprint : MethodFingerprint(
"V", null, null,
null,
listOf("timed_markers_width")
"V",
strings = listOf("timed_markers_width")
)

View File

@ -17,8 +17,5 @@ import org.jf.dexlib2.util.MethodUtil
@Version("0.0.1")
object NextGenWatchLayoutFingerprint : MethodFingerprint(
"V", // constructors return void, in favour of speed of matching, this fingerprint has been added
null,
null,
null,
customFingerprint = { methodDef -> MethodUtil.isConstructor(methodDef) && methodDef.parameterTypes.size == 3 && methodDef.definingClass.endsWith("NextGenWatchLayout;") }
)

View File

@ -16,7 +16,6 @@ import org.jf.dexlib2.Opcode
@SponsorBlockCompatibility
@Version("0.0.1")
object PlayerControllerSetTimeReferenceFingerprint : MethodFingerprint(
null, null, null,
listOf(Opcode.INVOKE_DIRECT_RANGE, Opcode.IGET_OBJECT),
listOf("Media progress reported outside media playback: ")
opcodes = listOf(Opcode.INVOKE_DIRECT_RANGE, Opcode.IGET_OBJECT),
strings = listOf("Media progress reported outside media playback: ")
)

View File

@ -15,8 +15,6 @@ import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlock
@SponsorBlockCompatibility
@Version("0.0.1")
object PlayerInitFingerprint : MethodFingerprint(
null, null, null,
null,
strings = listOf(
"playVideo called on player response with no videoStreamingData."
),

View File

@ -15,8 +15,6 @@ import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlock
@SponsorBlockCompatibility
@Version("0.0.1")
object PlayerOverlaysLayoutInitFingerprint : MethodFingerprint(
null, null, null,
null,
null,
{ methodDef -> methodDef.returnType.endsWith("YouTubePlayerOverlaysLayout;") }
customFingerprint = { methodDef -> methodDef.returnType.endsWith("YouTubePlayerOverlaysLayout;") }
)

View File

@ -18,11 +18,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
@Version("0.0.1")
object RectangleFieldInvalidatorFingerprint : MethodFingerprint(
"V",
null,
null,
null,
null,
custom@{ methodDef ->
customFingerprint = custom@{ methodDef ->
val instructions = methodDef.implementation?.instructions!!
val instructionCount = instructions.count()

View File

@ -15,9 +15,5 @@ import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlock
@SponsorBlockCompatibility
@Version("0.0.1")
object SeekFingerprint : MethodFingerprint(
null,
null,
null,
null,
listOf("Attempting to seek during an ad")
strings = listOf("Attempting to seek during an ad")
)

View File

@ -16,8 +16,7 @@ import org.jf.dexlib2.Opcode
@SponsorBlockCompatibility
@Version("0.0.1")
object VideoLengthFingerprint : MethodFingerprint(
null, null, null,
listOf(
opcodes = listOf(
Opcode.MOVE_RESULT_WIDE,
Opcode.CMP_LONG,
Opcode.IF_LEZ,

View File

@ -15,6 +15,5 @@ import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlock
@SponsorBlockCompatibility
@Version("0.0.1")
object VideoTimeFingerprint : MethodFingerprint(
null, null, null, null,
listOf("MedialibPlayerTimeInfo{currentPositionMillis=")
strings = listOf("MedialibPlayerTimeInfo{currentPositionMillis=")
)

View File

@ -16,6 +16,6 @@ import org.jf.dexlib2.Opcode
@TabletMiniPlayerCompatibility
@Version("0.0.1")
object MiniPlayerOverrideFingerprint : MethodFingerprint(
"Z", AccessFlags.STATIC or AccessFlags.PUBLIC ,null,
listOf(Opcode.RETURN), // anchor to insert the instruction
"Z", AccessFlags.STATIC or AccessFlags.PUBLIC,
opcodes = listOf(Opcode.RETURN), // anchor to insert the instruction
)

View File

@ -16,6 +16,6 @@ import org.jf.dexlib2.Opcode
@TabletMiniPlayerCompatibility
@Version("0.0.1")
object MiniPlayerOverrideNoContextFingerprint : MethodFingerprint(
"Z", AccessFlags.FINAL or AccessFlags.PRIVATE ,null,
listOf(Opcode.RETURN), // anchor to insert the instruction
"Z", AccessFlags.FINAL or AccessFlags.PRIVATE,
opcodes = listOf(Opcode.RETURN), // anchor to insert the instruction
)

View File

@ -32,6 +32,5 @@ object MiniPlayerResponseModelSizeCheckFingerprint : MethodFingerprint(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT,
Opcode.IF_NEZ,
),
null
)
)

View File

@ -17,5 +17,5 @@ import org.jf.dexlib2.AccessFlags
@HideWatermarkCompatibility
@Version("0.0.1")
object HideWatermarkFingerprint : MethodFingerprint (
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L"), null ,null, null
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L")
)

View File

@ -17,5 +17,5 @@ import org.jf.dexlib2.AccessFlags
@HideWatermarkCompatibility
@Version("0.0.1")
object HideWatermarkParentFingerprint : MethodFingerprint (
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, null, null, listOf("player_overlay_in_video_programming"), null
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, strings = listOf("player_overlay_in_video_programming")
)

View File

@ -6,7 +6,6 @@ import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@ -18,31 +17,7 @@ import org.jf.dexlib2.Opcode
@DirectPatternScanMethod
@WideSearchbarCompatibility
@Version("0.0.1")
/*
This finds the following method:
public final View i(akrl akrlVar, adpd adpdVar) {
}
Method we search for is located in smali now.
See:
.method public final i(Lakrl;Ladpd;)Landroid/view/View;
iget-object v0, p0, Ljkg;->a:Landroid/app/Activity;
invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
move-result-object v0
iget-object v1, p0, Ljkg;->g:Ljis;
const/4 v2, 0x0
invoke-interface {v1, v2}, Ljis;->h(Z)V
iget-object p1, p1, Lakrl;->f:Lahnq;
if-nez p1, :cond_12
sget-object p1, Lahnq;->a:Lahnq;
:cond_12
iget-object v1, p0, Ljkg;->x:Ltxm;
invoke-static {v1}, Lfbn;->aF(Ltxm;)Z //THIS IS WHAT WE SEARCH FOR (Method fbn.aF)
move-result v1
*/
object WideSearchbarOneFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L"), listOf(Opcode.IF_NEZ, Opcode.SGET_OBJECT, Opcode.IGET_OBJECT, Opcode.INVOKE_STATIC),
null, null
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L"),
listOf(Opcode.IF_NEZ, Opcode.SGET_OBJECT, Opcode.IGET_OBJECT, Opcode.INVOKE_STATIC)
)

View File

@ -3,10 +3,9 @@ package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility
import org.jf.dexlib2.AccessFlags
@ -17,31 +16,7 @@ import org.jf.dexlib2.AccessFlags
@FuzzyPatternScanMethod(3)
@WideSearchbarCompatibility
@Version("0.0.1")
/*
* This finds the following method:
private final void l(PaneDescriptor paneDescriptor) {
Class cls = null;
ahat f = paneDescriptor != null ? paneDescriptor.f() : null;
if (paneDescriptor != null) {
cls = paneDescriptor.a;
}
ftu k = k();
if ((k == null || !k.bk()) && ((!frx.k(f) && !((Boolean) aqer.S(this.n).X(new fac(this, f, 19)).K(irx.i).aH(false)).booleanValue()) || (f != null && f.qA(ReelWatchEndpointOuterClass$ReelWatchEndpoint.reelWatchEndpoint)))) {
String j = frx.j(f);
if ((j != null && ("FEhistory".equals(j) || "FEmy_videos".equals(j) || "FEpurchases".equals(j) || j.startsWith("VL"))) || cls == this.I.E() || cls == this.G.a) {
this.F = 3;
return;
} else {
this.F = 2;
return;
}
}
this.F = 1;
}
*/
object WideSearchbarOneParentFingerprint : MethodFingerprint(
"V", AccessFlags.PRIVATE or AccessFlags.FINAL, listOf("L"), null,
listOf("FEhistory", "FEmy_videos", "FEpurchases")
"V", AccessFlags.PRIVATE or AccessFlags.FINAL, listOf("L"),
strings = listOf("FEhistory", "FEmy_videos", "FEpurchases")
)

View File

@ -6,7 +6,6 @@ import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@ -18,32 +17,8 @@ import org.jf.dexlib2.Opcode
@DirectPatternScanMethod
@WideSearchbarCompatibility
@Version("0.0.1")
/*
public static jis h(Context context, txm txmVar, uag uagVar, txp txpVar) {
return fbn.aB(txmVar) ? new jhx(context, txmVar, uagVar, txpVar) : jis.d;
}
Method we search for is located in smali now.
See:
.method public static h(Landroid/content/Context;Ltxm;Luag;Ltxp;)Ljis;
invoke-static {p1}, Lfbn;->aB(Ltxm;)Z //this is the method we want to change. fbn.aB
move-result v0
if-eqz v0, :cond_c
new-instance v0, Ljhx;
invoke-direct {v0, p0, p1, p2, p3}, Ljhx;-><init>(Landroid/content/Context;Ltxm;Luag;Ltxp;)V
goto :goto_e
:cond_c
sget-object v0, Ljis;->d:Ljis;
:goto_e
return-object v0
.end method
*/
object WideSearchbarTwoFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, null, listOf(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, opcodes = listOf(
Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT, Opcode.IF_EQZ, Opcode.NEW_INSTANCE
),
null, null
)
)

View File

@ -14,19 +14,7 @@ import org.jf.dexlib2.AccessFlags
)
@WideSearchbarCompatibility
@Version("0.0.1")
/*
This finds following method:
public static ies i(br brVar) {
bp f = brVar.getSupportFragmentManager().f("VIDEO_QUALITIES_QUICK_MENU_BOTTOM_SHEET_FRAGMENT");
if (f != null) {
return (kga) f;
}
return new kga();
}
*/
object WideSearchbarTwoParentFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), null,
listOf("VIDEO_QUALITIES_QUICK_MENU_BOTTOM_SHEET_FRAGMENT")
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"),
strings = listOf("VIDEO_QUALITIES_QUICK_MENU_BOTTOM_SHEET_FRAGMENT")
)

View File

@ -26,7 +26,5 @@ object AutoRepeatFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.FINAL,
listOf(),
null,
null,
customFingerprint = { methodDef -> methodDef.implementation!!.instructions.count() == 3 && methodDef.annotations.isEmpty()}
)

View File

@ -3,9 +3,9 @@ package app.revanced.patches.youtube.misc.autorepeat.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.autorepeat.annotations.AutoRepeatCompatibility
import org.jf.dexlib2.AccessFlags
@ -16,20 +16,11 @@ import org.jf.dexlib2.AccessFlags
@FuzzyPatternScanMethod(2)
@AutoRepeatCompatibility
@Version("0.0.1")
//This Fingerprints finds the play() method needed to be called when AutoRepeatPatch.shouldAutoRepeat() == true
/*
public final void E() {
Stuff happens
String str = "play() called when the player wasn't loaded.";
String str2 = "play() blocked because Background Playability failed";
Stuff happens again
}
*/
object AutoRepeatParentFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.FINAL,
null,
null,
listOf("play() called when the player wasn't loaded.", "play() blocked because Background Playability failed"),
null
strings = listOf(
"play() called when the player wasn't loaded.",
"play() blocked because Background Playability failed"
)
)

View File

@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[
Package("com.google.android.youtube", arrayOf()),
Package("com.vanced.android.youtube", arrayOf())
Package("com.google.android.youtube"),
Package("com.vanced.android.youtube")
]
)
@Target(AnnotationTarget.CLASS)

View File

@ -12,9 +12,7 @@ import org.jf.dexlib2.Opcode
@DirectPatternScanMethod
@Version("0.0.1")
object UserAgentHeaderBuilderFingerprint : MethodFingerprint(
null,
null,
listOf("L", "L", "L"),
listOf(Opcode.MOVE_RESULT_OBJECT, Opcode.INVOKE_VIRTUAL),
listOf("(Linux; U; Android "),
parameters = listOf("L", "L", "L"),
opcodes = listOf(Opcode.MOVE_RESULT_OBJECT, Opcode.INVOKE_VIRTUAL),
strings = listOf("(Linux; U; Android "),
)

View File

@ -12,7 +12,6 @@ import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.misc.clientspoof.annotations.ClientSpoofCompatibility
import app.revanced.patches.youtube.misc.clientspoof.fingerprints.UserAgentHeaderBuilderFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
@Patch

View File

@ -3,9 +3,9 @@ package app.revanced.patches.youtube.misc.customplaybackspeed.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.customplaybackspeed.annotations.CustomPlaybackSpeedCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@ -20,8 +20,7 @@ import org.jf.dexlib2.Opcode
object SpeedArrayGeneratorFingerprint : MethodFingerprint(
"[L",
AccessFlags.PUBLIC or AccessFlags.STATIC,
null,
listOf(
opcodes = listOf(
Opcode.IF_NEZ,
Opcode.SGET_OBJECT,
Opcode.GOTO,
@ -29,5 +28,5 @@ object SpeedArrayGeneratorFingerprint : MethodFingerprint(
Opcode.MOVE_RESULT_OBJECT,
Opcode.IGET_OBJECT,
),
listOf("0.0#")
strings = listOf("0.0#")
)

View File

@ -3,11 +3,7 @@ package app.revanced.patches.youtube.misc.enabledebugging.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf()
)]
)
@Compatibility([Package("com.google.android.youtube")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class EnableDebuggingCompatibility

View File

@ -32,7 +32,6 @@ object HDRBrightnessFingerprintYEL : MethodFingerprint(
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL
),
null,
customFingerprint = { methodDef ->
methodDef.implementation!!.instructions.any {
((it as? ReferenceInstruction)?.reference as? FieldReference)?.let { field ->

View File

@ -16,8 +16,8 @@ import org.jf.dexlib2.Opcode
@HDRBrightnessCompatibility
@Version("0.0.1")
object HDRBrightnessFingerprintYJK : MethodFingerprint(
"V", null, null,
listOf(
"V",
opcodes = listOf(
Opcode.SGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
@ -27,5 +27,5 @@ object HDRBrightnessFingerprintYJK : MethodFingerprint(
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL
),
listOf("c.SettingNotFound;", "screen_brightness", "android.mediaview"),
strings = listOf("c.SettingNotFound;", "screen_brightness", "android.mediaview"),
)

View File

@ -2,8 +2,8 @@ package app.revanced.patches.youtube.misc.integrations.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.integrations.annotations.IntegrationsCompatibility
@Name("init-fingerprint")
@ -13,6 +13,5 @@ import app.revanced.patches.youtube.misc.integrations.annotations.IntegrationsCo
@IntegrationsCompatibility
@Version("0.0.1")
object InitFingerprint : MethodFingerprint(
null, null, null, null,
listOf("Application creation")
strings = listOf("Application creation")
)

View File

@ -3,11 +3,7 @@ package app.revanced.patches.youtube.misc.manifest.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf()
)]
)
@Compatibility([Package("com.google.android.youtube")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class FixLocaleConfigErrorCompatibility

View File

@ -2,9 +2,9 @@ package app.revanced.patches.youtube.misc.microg.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
@Name("cast-context-fetch-fingerprint")
@ -15,6 +15,5 @@ import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibi
@MicroGPatchCompatibility
@Version("0.0.1")
object CastContextFetchFingerprint : MethodFingerprint(
null, null, null, null,
listOf("Error fetching CastContext.")
strings = listOf("Error fetching CastContext.")
)

View File

@ -2,9 +2,9 @@ package app.revanced.patches.youtube.misc.microg.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
@Name("cast-module-fingerprint")
@ -15,6 +15,5 @@ import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibi
@MicroGPatchCompatibility
@Version("0.0.1")
object CastDynamiteModuleFingerprint : MethodFingerprint(
null, null, null, null,
listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
strings = listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
)

View File

@ -2,9 +2,9 @@ package app.revanced.patches.youtube.misc.microg.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
@Name("cast-context-fetch-fingerprint")
@ -15,6 +15,5 @@ import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibi
@MicroGPatchCompatibility
@Version("0.0.1")
object CastDynamiteModuleV2Fingerprint : MethodFingerprint(
null, null, null, null,
listOf("Failed to load module via V2: ")
strings = listOf("Failed to load module via V2: ")
)

View File

@ -17,5 +17,8 @@ import org.jf.dexlib2.AccessFlags
@MicroGPatchCompatibility
@Version("0.0.1")
object GooglePlayUtilityFingerprint : MethodFingerprint(
"I", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L"), null, listOf("This should never happen.", "MetadataValueReader", "com.google.android.gms")
"I",
AccessFlags.PUBLIC or AccessFlags.STATIC,
listOf("L", "L"),
strings = listOf("This should never happen.", "MetadataValueReader", "com.google.android.gms")
)

View File

@ -17,5 +17,6 @@ import org.jf.dexlib2.AccessFlags
@MicroGPatchCompatibility
@Version("0.0.1")
object IntegrityCheckFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L"), null, listOf("This should never happen.", "GooglePlayServicesUtil", "Google Play Store signature invalid.")
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L"),
strings = listOf("This should never happen.", "GooglePlayServicesUtil", "Google Play Store signature invalid.")
)

View File

@ -2,9 +2,9 @@ package app.revanced.patches.youtube.misc.microg.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
@Name("google-play-prime-fingerprint")
@ -15,5 +15,5 @@ import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibi
@MicroGPatchCompatibility
@Version("0.0.1")
object PrimeFingerprint : MethodFingerprint(
null, null, null, null, listOf("com.google.android.GoogleCamera", "com.android.vending")
strings = listOf("com.google.android.GoogleCamera", "com.android.vending")
)

View File

@ -17,6 +17,6 @@ import org.jf.dexlib2.AccessFlags
@MicroGPatchCompatibility
@Version("0.0.1")
object ServiceCheckFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), null
, listOf("Google Play Services not available", "GooglePlayServices not available due to error ")
"V", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"),
strings = listOf("Google Play Services not available", "GooglePlayServices not available due to error ")
)

View File

@ -29,6 +29,5 @@ object MinimizedPlaybackKidsFingerprint : MethodFingerprint(
Opcode.IGET,
Opcode.INVOKE_STATIC
),
null,
{ it.definingClass.endsWith("MinimizedPlaybackPolicyController;") }
customFingerprint = { it.definingClass.endsWith("MinimizedPlaybackPolicyController;") }
)

View File

@ -20,8 +20,7 @@ import org.jf.dexlib2.Opcode
object MinimizedPlaybackSettingsFingerprint : MethodFingerprint(
"L",
AccessFlags.PUBLIC or AccessFlags.FINAL,
null,
listOf(
opcodes = listOf(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.INVOKE_VIRTUAL,

View File

@ -18,12 +18,12 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
@PlayerControlsCompatibility
@Version("0.0.1")
object BottomControlsInflateFingerprint : MethodFingerprint(
null, null, null, listOf(
opcodes = listOf(
Opcode.CHECK_CAST,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT
), null,
{ methodDef ->
),
customFingerprint = { methodDef ->
methodDef.implementation?.instructions?.any { instruction ->
(instruction as? WideLiteralInstruction)?.wideLiteral == PlayerControlsBytecodePatch.bottomUiContainerResourceId
} == true

View File

@ -15,7 +15,9 @@ import app.revanced.patches.youtube.misc.playercontrols.annotation.PlayerControl
@PlayerControlsCompatibility
@Version("0.0.1")
object PlayerControlsVisibilityFingerprint : MethodFingerprint(
"V", null, listOf("Z", "Z"), null, null, { methodDef ->
"V",
parameters = listOf("Z", "Z"),
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("YouTubeControlsOverlay;")
}
)

View File

@ -15,7 +15,7 @@ import app.revanced.patches.youtube.misc.playeroverlay.annotation.PlayerOverlays
@PlayerOverlaysHookCompatibility
@Version("0.0.1")
object PlayerOverlaysOnFinishInflateFingerprint : MethodFingerprint(
null, null, null, null, null, { methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("YouTubePlayerOverlaysLayout;") && methodDef.name == "onFinishInflate"
}
)

View File

@ -22,8 +22,7 @@ import org.jf.dexlib2.Opcode
object UpdatePlayerTypeFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.FINAL,
null,
listOf(
opcodes = listOf(
Opcode.INVOKE_VIRTUAL,
Opcode.IGET_OBJECT,
Opcode.IF_NE,

View File

@ -3,11 +3,7 @@ package app.revanced.patches.youtube.misc.settings.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf()
)]
)
@Compatibility([Package("com.google.android.youtube")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class SettingsCompatibility

View File

@ -15,12 +15,7 @@ import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibil
@SettingsCompatibility
@Version("0.0.1")
object LicenseActivityFingerprint : MethodFingerprint(
null,
null,
null,
null,
null,
{ methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("LicenseActivity;") && methodDef.name == "onCreate"
}
)

View File

@ -15,12 +15,7 @@ import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibil
@SettingsCompatibility
@Version("0.0.1")
object ReVancedSettingsActivityFingerprint : MethodFingerprint(
null,
null,
null,
null,
null,
{ methodDef ->
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("ReVancedSettingActivity;") && methodDef.name == "initializeSettings"
}
)

View File

@ -17,11 +17,8 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
@Version("0.0.1")
object ThemeSetterFingerprint : MethodFingerprint(
"L",
null,
null,
listOf(Opcode.RETURN_OBJECT),
null,
{ methodDef ->
opcodes = listOf(Opcode.RETURN_OBJECT),
customFingerprint = { methodDef ->
methodDef.implementation?.instructions?.any {
it.opcode.ordinal == Opcode.CONST.ordinal && (it as WideLiteralInstruction).wideLiteral == SettingsPatch.appearanceStringId
} == true

View File

@ -21,12 +21,11 @@ import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
object MaxBufferFingerprint : MethodFingerprint(
"I", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(),
listOf(Opcode.SGET_OBJECT, Opcode.IGET, Opcode.IF_EQZ, Opcode.RETURN),
null,
customFingerprint = { methodDef ->
methodDef.definingClass.equals("Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;")
methodDef.definingClass == "Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;"
&& methodDef.implementation!!.instructions.any {
((it as? NarrowLiteralInstruction)?.narrowLiteral == 120000)
&& methodDef.name.equals("r")
&& methodDef.name == "r"
}
}
)

View File

@ -21,9 +21,8 @@ import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
object PlaybackBufferFingerprint : MethodFingerprint(
"I", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(),
listOf(Opcode.IF_LEZ, Opcode.RETURN),
null,
customFingerprint = { methodDef ->
methodDef.definingClass.equals("Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;")
methodDef.definingClass == "Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;"
&& methodDef.implementation!!.instructions.any {
((it as? NarrowLiteralInstruction)?.narrowLiteral == 1600)
}

View File

@ -21,9 +21,8 @@ import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
object ReBufferFingerprint : MethodFingerprint(
"I", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(),
listOf(Opcode.IF_LEZ, Opcode.RETURN),
null,
customFingerprint = { methodDef ->
methodDef.definingClass.equals("Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;")
methodDef.definingClass == "Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;"
&& methodDef.implementation!!.instructions.any {
((it as? NarrowLiteralInstruction)?.narrowLiteral == 5000)
}