Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Twitch): Make patches compatible with latest versions #4099

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ val audioAdsPatch = bytecodePatch(
addResourcesPatch,
)

compatibleWith("tv.twitch.android.app"("15.4.1", "16.1.0", "16.9.1"))
compatibleWith("tv.twitch.android.app")

execute {
addResources("twitch", "ad.audio.audioAdsPatch")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ val embeddedAdsPatch = bytecodePatch(
settingsPatch,
)

compatibleWith("tv.twitch.android.app"("15.4.1", "16.1.0", "16.9.1"))
compatibleWith("tv.twitch.android.app")

execute {
addResources("twitch", "ad.embedded.embeddedAdsPatch")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import app.revanced.patcher.fingerprint

internal val createsUsherClientFingerprint = fingerprint {
custom { method, _ ->
method.definingClass.endsWith("Ltv/twitch/android/network/OkHttpClientFactory;") && method.name == "buildOkHttpClient"
method.name == "buildOkHttpClient" && method.definingClass.endsWith("Ltv/twitch/android/network/OkHttpClientFactory;")
LisoUseInAIKyrios marked this conversation as resolved.
Show resolved Hide resolved
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,15 @@ val videoAdsPatch = bytecodePatch(
)

// Spoof showAds JSON field.
contentConfigShowAdsFingerprint.method.addInstructions(
// Late versions of the app don't have the method anymore.
contentConfigShowAdsFingerprint.methodOrNull?.addInstructions(
0,
"""
${createConditionInstructions("v0")}
const/4 v0, 0
:$skipLabelName
return v0
""",
${createConditionInstructions("v0")}
const/4 v0, 0
:$skipLabelName
return v0
""",
)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ val showDeletedMessagesPatch = bytecodePatch(
addResourcesPatch,
)

compatibleWith("tv.twitch.android.app"("15.4.1", "16.1.0", "16.9.1"))
compatibleWith("tv.twitch.android.app")

fun createSpoilerConditionInstructions(register: String = "v0") = """
invoke-static {}, Lapp/revanced/extension/twitch/patches/ShowDeletedMessagesPatch;->shouldUseSpoiler()Z
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ val autoClaimChannelPointsPatch = bytecodePatch(
addResourcesPatch,
)

compatibleWith("tv.twitch.android.app"("15.4.1", "16.1.0", "16.9.1"))
compatibleWith("tv.twitch.android.app")

execute {
addResources("twitch", "chat.autoclaim.autoClaimChannelPointsPatch")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@ val settingsPatch = bytecodePatch(
settingsPatch(preferences = preferences),
)

compatibleWith(
"tv.twitch.android.app"(
"15.4.1",
"16.1.0",
"16.9.1",
),
)
compatibleWith("tv.twitch.android.app")

execute {
addResources("twitch", "misc.settings.settingsPatch")
Expand Down
Loading