Compare commits

...

4 Commits

Author SHA1 Message Date
semantic-release-bot
3d3197701c chore(release): 4.7.0-dev.3 [skip ci]
# [4.7.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.2...v4.7.0-dev.3) (2024-04-09)

### Bug Fixes

* **Tumblr - Fix old versions:** Improve reliability by removing remnances of Tumblr Live  ([#2988](https://github.com/ReVanced/revanced-patches/issues/2988)) ([1ac6127](1ac612798b))
2024-04-09 17:40:30 +00:00
Temm
1ac612798b fix(Tumblr - Fix old versions): Improve reliability by removing remnances of Tumblr Live (#2988)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-04-09 19:38:11 +02:00
LisoUseInAIKyrios
e1ed1aee69 chore(YouTube): Fix typos, simplify some strings for translating 2024-04-07 23:56:09 +04:00
oSumAtrIX
795ccac990 chore: Fix spelling mistake 2024-04-07 17:36:01 +02:00
8 changed files with 79 additions and 38 deletions

View File

@@ -1,3 +1,10 @@
# [4.7.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.2...v4.7.0-dev.3) (2024-04-09)
### Bug Fixes
* **Tumblr - Fix old versions:** Improve reliability by removing remnances of Tumblr Live ([#2988](https://github.com/ReVanced/revanced-patches/issues/2988)) ([897b4db](https://github.com/ReVanced/revanced-patches/commit/897b4dbce984270ae1fd7de5bd30bd05153e45f2))
# [4.7.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.1...v4.7.0-dev.2) (2024-04-06) # [4.7.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.1...v4.7.0-dev.2) (2024-04-06)

View File

@@ -1062,10 +1062,6 @@ public final class app/revanced/patches/tumblr/fixes/FixOldVersionsPatch : app/r
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
} }
public final class app/revanced/patches/tumblr/fixes/fingerprints/HttpPathParserFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
public static final field INSTANCE Lapp/revanced/patches/tumblr/fixes/fingerprints/HttpPathParserFingerprint;
}
public final class app/revanced/patches/tumblr/live/DisableTumblrLivePatch : app/revanced/patcher/patch/BytecodePatch { public final class app/revanced/patches/tumblr/live/DisableTumblrLivePatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/tumblr/live/DisableTumblrLivePatch; public static final field INSTANCE Lapp/revanced/patches/tumblr/live/DisableTumblrLivePatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V

View File

@@ -15,7 +15,7 @@ repositories {
mavenLocal() mavenLocal()
google() google()
maven { maven {
// A repository must be speficied for some reason. "registry" is a dummy. // A repository must be specified for some reason. "registry" is a dummy.
url = uri("https://maven.pkg.github.com/revanced/registry") url = uri("https://maven.pkg.github.com/revanced/registry")
credentials { credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR") username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true org.gradle.parallel = true
org.gradle.caching = true org.gradle.caching = true
kotlin.code.style = official kotlin.code.style = official
version = 4.7.0-dev.2 version = 4.7.0-dev.3

View File

@@ -5,34 +5,63 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.tumblr.fixes.fingerprints.AddQueryParamFingerprint
import app.revanced.patches.tumblr.fixes.fingerprints.HttpPathParserFingerprint import app.revanced.patches.tumblr.fixes.fingerprints.HttpPathParserFingerprint
import app.revanced.util.exception import app.revanced.util.exception
@Patch( @Patch(
name = "Fix old versions", name = "Fix old versions",
description = "Fixes old versions of the app (v33.2 and earlier) breaking due to Tumblr removing remnants of Tumblr" + description = "Fixes old versions of the app (v33.2 and earlier) breaking due to Tumblr removing remnants of Tumblr" +
" Live from the API, which causes many requests to fail. This patch has no effect on newer versions of the app.", " Live from the API, which causes many requests to fail. This patch has no effect on newer versions of the app.",
compatiblePackages = [CompatiblePackage("com.tumblr")], compatiblePackages = [CompatiblePackage("com.tumblr")],
use = false, use = false,
) )
@Suppress("unused") @Suppress("unused")
object FixOldVersionsPatch : BytecodePatch( object FixOldVersionsPatch : BytecodePatch(
setOf(HttpPathParserFingerprint), setOf(HttpPathParserFingerprint, AddQueryParamFingerprint),
) { ) {
override fun execute(context: BytecodeContext) = override fun execute(context: BytecodeContext) {
val liveQueryParameters = listOf(
",?live_now",
",?live_streaming_user_id",
)
HttpPathParserFingerprint.result?.let { HttpPathParserFingerprint.result?.let {
val endIndex = it.scanResult.patternScanResult!!.endIndex val endIndex = it.scanResult.patternScanResult!!.endIndex
// Remove the live query parameters from the path when it's specified via a @METHOD annotation.
it.mutableMethod.addInstructions( for (liveQueryParameter in liveQueryParameters) {
endIndex + 1, it.mutableMethod.addInstructions(
""" endIndex + 1,
# Remove "?live_now" from the request path p2. """
# p2 = p2.replace(p1, p3) # urlPath = urlPath.replace(liveQueryParameter, "")
const-string p1, ",?live_now" const-string p1, "$liveQueryParameter"
const-string p3, "" const-string p3, ""
invoke-virtual {p2, p1, p3}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; invoke-virtual {p2, p1, p3}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object p2 move-result-object p2
""", """,
) )
}
} ?: throw HttpPathParserFingerprint.exception } ?: throw HttpPathParserFingerprint.exception
AddQueryParamFingerprint.result?.let {
// Remove the live query parameters when passed via a parameter which has the @Query annotation.
// e.g. an API call could be defined like this:
// @GET("api/me/info")
// ApiResponse getCurrentUserInfo(@Query("fields[blog]") String value)
// which would result in the path "api/me/inf0?fields[blog]=${value}"
// Here we make sure that this value doesn't contain the broken query parameters.
for (liveQueryParameter in liveQueryParameters) {
it.mutableMethod.addInstructions(
0,
"""
# queryParameterValue = queryParameterValue.replace(liveQueryParameter, "")
const-string v0, "$liveQueryParameter"
const-string v1, ""
invoke-virtual {p2, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object p2
""",
)
}
} ?: throw AddQueryParamFingerprint.exception
}
} }

View File

@@ -0,0 +1,11 @@
package app.revanced.patches.tumblr.fixes.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint
// Fingerprint for the addQueryParam method from retrofit2
// https://github.com/square/retrofit/blob/trunk/retrofit/src/main/java/retrofit2/RequestBuilder.java#L186
// Injecting here allows modifying dynamically set query parameters
internal object AddQueryParamFingerprint : MethodFingerprint(
strings = listOf("Malformed URL. Base: ", ", Relative: "),
parameters = listOf("Ljava/lang/String;", "Ljava/lang/String;", "Z"),
)

View File

@@ -3,13 +3,13 @@ package app.revanced.patches.tumblr.fixes.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.Opcode
// Fingerprint for the parseHttpMethodAndPath from retrofit2 // Fingerprint for the parseHttpMethodAndPath method from retrofit2
// https://github.com/square/retrofit/blob/ebf87b10997e2136af4d335276fa950221852c64/retrofit/src/main/java/retrofit2/RequestFactory.java#L270-L302 // https://github.com/square/retrofit/blob/ebf87b10997e2136af4d335276fa950221852c64/retrofit/src/main/java/retrofit2/RequestFactory.java#L270-L302
// Injecting here allows modifying the path/query params of API endpoints defined via annotations // Injecting here allows modifying the path/query params of API endpoints defined via annotations
object HttpPathParserFingerprint : MethodFingerprint( internal object HttpPathParserFingerprint : MethodFingerprint(
strings = listOf("Only one HTTP method is allowed. Found: %s and %s."), strings = listOf("Only one HTTP method is allowed. Found: %s and %s."),
opcodes = listOf( opcodes = listOf(
Opcode.IPUT_OBJECT, Opcode.IPUT_OBJECT,
Opcode.IPUT_BOOLEAN Opcode.IPUT_BOOLEAN,
) ),
) )

View File

@@ -22,7 +22,7 @@
Forgetting to do this will cause that string to appear in app with no quotation characters. Forgetting to do this will cause that string to appear in app with no quotation characters.
Correct: Correct:
<string name="revanced_string">You\'re correct. This is the \"correct\" way and this text will as expected in the app</string> <string name="revanced_string">You\'re correct. This is the \"correct\" way and this text will appear as expected in the app</string>
Not correct: Not correct:
<string name="revanced_string">You're not correct. This is not the "correct" way and this text will not appear as expected the in app</string> <string name="revanced_string">You're not correct. This is not the "correct" way and this text will not appear as expected the in app</string>
--> -->
@@ -213,6 +213,7 @@
<string name="revanced_custom_filter_summary_on">Custom filter is enabled</string> <string name="revanced_custom_filter_summary_on">Custom filter is enabled</string>
<string name="revanced_custom_filter_summary_off">Custom filter is disabled</string> <string name="revanced_custom_filter_summary_off">Custom filter is disabled</string>
<string name="revanced_custom_filter_strings_title">Custom filter</string> <string name="revanced_custom_filter_strings_title">Custom filter</string>
<!-- 'Component path builder strings' is the technical name for identifying the Litho UI layout items to hide. This is an advanced feature and most users will never use this. -->
<string name="revanced_custom_filter_strings_summary">List of component path builder strings to filter separated by new line</string> <string name="revanced_custom_filter_strings_summary">List of component path builder strings to filter separated by new line</string>
<string name="revanced_custom_filter_toast_invalid_syntax">Invalid custom filter: %s</string> <string name="revanced_custom_filter_toast_invalid_syntax">Invalid custom filter: %s</string>
<string name="revanced_hide_keyword_content_screen_title">Hide keyword content</string> <string name="revanced_hide_keyword_content_screen_title">Hide keyword content</string>
@@ -548,6 +549,7 @@
<string name="revanced_hide_seekbar_thumbnail_summary_off">Thumbnail seekbar is shown</string> <string name="revanced_hide_seekbar_thumbnail_summary_off">Thumbnail seekbar is shown</string>
</patch> </patch>
<patch id="layout.hide.shorts.HideShortsComponentsResourcePatch"> <patch id="layout.hide.shorts.HideShortsComponentsResourcePatch">
<!-- 'home' should be translated using the same localized wording YouTube displays for the home tab. -->
<string name="revanced_hide_shorts_home_title">Hide Shorts in home feed</string> <string name="revanced_hide_shorts_home_title">Hide Shorts in home feed</string>
<string name="revanced_hide_shorts_home_summary_on">Shorts in home feed are hidden</string> <string name="revanced_hide_shorts_home_summary_on">Shorts in home feed are hidden</string>
<string name="revanced_hide_shorts_home_summary_off">Shorts in home feed are shown</string> <string name="revanced_hide_shorts_home_summary_off">Shorts in home feed are shown</string>
@@ -647,11 +649,9 @@
<string name="revanced_ryd_enable_summary_on">Dislikes are shown</string> <string name="revanced_ryd_enable_summary_on">Dislikes are shown</string>
<string name="revanced_ryd_enable_summary_off">Dislikes are not shown</string> <string name="revanced_ryd_enable_summary_off">Dislikes are not shown</string>
<string name="revanced_ryd_shorts_title">Show dislikes on Shorts</string> <string name="revanced_ryd_shorts_title">Show dislikes on Shorts</string>
<!-- %s is either an empty blank string, or it is 'revanced_ryd_shorts_summary_disclaimer'. This text should read normally in both situations. --> <string name="revanced_ryd_shorts_summary_on">Dislikes shown on Shorts</string>
<string name="revanced_ryd_shorts_summary_on">Dislikes shown on Shorts %s</string> <string name="revanced_ryd_shorts_summary_on_disclaimer">Dislikes shown on Shorts\n\nLimitation: Dislikes may not appear in incognito mode</string>
<string name="revanced_ryd_shorts_summary_off">Dislikes hidden on Shorts</string> <string name="revanced_ryd_shorts_summary_off">Dislikes hidden on Shorts</string>
<!-- Shown only when used with 'revanced_ryd_shorts_summary_on' and it is never displayed alone. -->
<string name="revanced_ryd_shorts_summary_disclaimer">Limitation: Dislikes may not appear in incognito mode</string>
<string name="revanced_ryd_dislike_percentage_title">Dislikes as percentage</string> <string name="revanced_ryd_dislike_percentage_title">Dislikes as percentage</string>
<string name="revanced_ryd_dislike_percentage_summary_on">Dislikes shown as percentage</string> <string name="revanced_ryd_dislike_percentage_summary_on">Dislikes shown as percentage</string>
<string name="revanced_ryd_dislike_percentage_summary_off">Dislikes shown as number</string> <string name="revanced_ryd_dislike_percentage_summary_off">Dislikes shown as number</string>
@@ -735,21 +735,19 @@
<string name="revanced_sb_general_skipcount_sum_on">Lets the SponsorBlock leaderboard know how much time is saved. A message is sent to the leaderboard each time a segment is skipped</string> <string name="revanced_sb_general_skipcount_sum_on">Lets the SponsorBlock leaderboard know how much time is saved. A message is sent to the leaderboard each time a segment is skipped</string>
<string name="revanced_sb_general_skipcount_sum_off">Skip count tracking is not enabled</string> <string name="revanced_sb_general_skipcount_sum_off">Skip count tracking is not enabled</string>
<string name="revanced_sb_general_min_duration">Minimum segment duration</string> <string name="revanced_sb_general_min_duration">Minimum segment duration</string>
<string name="revanced_sb_general_min_duration_sum">Segments shorter than this value (in seconds) will not be shown or skipped </string> <string name="revanced_sb_general_min_duration_sum">Segments shorter than this value (in seconds) will not be shown or skipped</string>
<string name="revanced_sb_general_uuid">Your private user id</string> <string name="revanced_sb_general_uuid">Your private user id</string>
<string name="revanced_sb_general_uuid_sum">This should be kept private. This is like a password and should not be shared with anyone. If someone has this, they can impersonate you</string> <string name="revanced_sb_general_uuid_sum">This should be kept private. This is like a password and should not be shared with anyone. If someone has this, they can impersonate you</string>
<string name="revanced_sb_general_uuid_invalid">Private user id must be at least 30 characters long</string> <string name="revanced_sb_general_uuid_invalid">Private user id must be at least 30 characters long</string>
<string name="revanced_sb_general_api_url">Change API URL</string> <string name="revanced_sb_general_api_url">Change API URL</string>
<string name="revanced_sb_general_api_url_sum">The address SponsorBlock uses to make calls to the server. Do not change this unless you know what you\'re doing</string> <string name="revanced_sb_general_api_url_sum">The address SponsorBlock uses to make calls to the server</string>
<string name="revanced_sb_api_url_reset">API URL reset</string> <string name="revanced_sb_api_url_reset">API URL reset</string>
<string name="revanced_sb_api_url_invalid">API URL is invalid</string> <string name="revanced_sb_api_url_invalid">API URL is invalid</string>
<string name="revanced_sb_api_url_changed">API URL changed</string> <string name="revanced_sb_api_url_changed">API URL changed</string>
<string name="revanced_sb_settings_ie">Import/Export settings</string> <string name="revanced_sb_settings_ie">Import/Export settings</string>
<string name="revanced_sb_settings_copy">Copy</string> <string name="revanced_sb_settings_copy">Copy</string>
<!-- %s is either an empty blank string, or it is 'revanced_sb_settings_ie_sum_warning'. This text should read normally in both situations. --> <string name="revanced_sb_settings_ie_sum">Your SponsorBlock JSON configuration that can be imported/exported to ReVanced and other SponsorBlock platforms</string>
<string name="revanced_sb_settings_ie_sum">Your SponsorBlock JSON configuration that can be imported/exported to ReVanced and other SponsorBlock platforms %s</string> <string name="revanced_sb_settings_ie_sum_warning">Your SponsorBlock JSON configuration that can be imported/exported to ReVanced and other SponsorBlock platforms. This includes your private user id. Be sure to share this wisely</string>
<!-- Shown only when used with 'revanced_sb_settings_ie_sum' and it is never displayed alone. -->
<string name="revanced_sb_settings_ie_sum_warning">This includes your private user id. Be sure to share this wisely</string>
<string name="revanced_sb_settings_import_successful">Settings imported successfully</string> <string name="revanced_sb_settings_import_successful">Settings imported successfully</string>
<string name="revanced_sb_settings_import_failed">Failed to import: %s</string> <string name="revanced_sb_settings_import_failed">Failed to import: %s</string>
<string name="revanced_sb_settings_export_failed">Failed to export: %s</string> <string name="revanced_sb_settings_export_failed">Failed to export: %s</string>
@@ -1042,7 +1040,7 @@
<patch id="video.speed.custom.CustomPlaybackSpeedPatch"> <patch id="video.speed.custom.CustomPlaybackSpeedPatch">
<string name="revanced_custom_playback_speeds_title">Custom playback speeds</string> <string name="revanced_custom_playback_speeds_title">Custom playback speeds</string>
<string name="revanced_custom_playback_speeds_summary">Add or change the available playback speeds</string> <string name="revanced_custom_playback_speeds_summary">Add or change the available playback speeds</string>
<string name="revanced_custom_playback_speeds_invalid">Custom speeds must be less than %s Using default values.</string> <string name="revanced_custom_playback_speeds_invalid">Custom speeds must be less than %s. Using default values.</string>
<string name="revanced_custom_playback_speeds_parse_exception">Invalid custom playback speeds. Using default values.</string> <string name="revanced_custom_playback_speeds_parse_exception">Invalid custom playback speeds. Using default values.</string>
</patch> </patch>
<patch id="video.speed.remember.RememberPlaybackSpeedPatch"> <patch id="video.speed.remember.RememberPlaybackSpeedPatch">