mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-12 06:06:18 +00:00
Compare commits
4 Commits
v4.7.0-dev
...
v4.7.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d3197701c | ||
|
|
1ac612798b | ||
|
|
e1ed1aee69 | ||
|
|
795ccac990 |
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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 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 static final field INSTANCE Lapp/revanced/patches/tumblr/live/DisableTumblrLivePatch;
|
||||
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||
|
||||
@@ -15,7 +15,7 @@ repositories {
|
||||
mavenLocal()
|
||||
google()
|
||||
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")
|
||||
credentials {
|
||||
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 4.7.0-dev.2
|
||||
version = 4.7.0-dev.3
|
||||
|
||||
@@ -5,34 +5,63 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
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.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Fix old versions",
|
||||
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")],
|
||||
use = false,
|
||||
)
|
||||
@Suppress("unused")
|
||||
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 {
|
||||
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
it.mutableMethod.addInstructions(
|
||||
endIndex + 1,
|
||||
"""
|
||||
# Remove "?live_now" from the request path p2.
|
||||
# p2 = p2.replace(p1, p3)
|
||||
const-string p1, ",?live_now"
|
||||
const-string p3, ""
|
||||
invoke-virtual {p2, p1, p3}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
|
||||
move-result-object p2
|
||||
""",
|
||||
)
|
||||
// Remove the live query parameters from the path when it's specified via a @METHOD annotation.
|
||||
for (liveQueryParameter in liveQueryParameters) {
|
||||
it.mutableMethod.addInstructions(
|
||||
endIndex + 1,
|
||||
"""
|
||||
# urlPath = urlPath.replace(liveQueryParameter, "")
|
||||
const-string p1, "$liveQueryParameter"
|
||||
const-string p3, ""
|
||||
invoke-virtual {p2, p1, p3}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
|
||||
move-result-object p2
|
||||
""",
|
||||
)
|
||||
}
|
||||
} ?: 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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"),
|
||||
)
|
||||
@@ -3,13 +3,13 @@ package app.revanced.patches.tumblr.fixes.fingerprints
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
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
|
||||
// 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."),
|
||||
opcodes = listOf(
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_BOOLEAN
|
||||
)
|
||||
)
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
Forgetting to do this will cause that string to appear in app with no quotation characters.
|
||||
|
||||
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:
|
||||
<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_off">Custom filter is disabled</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_toast_invalid_syntax">Invalid custom filter: %s</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>
|
||||
</patch>
|
||||
<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_summary_on">Shorts in home feed are hidden</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_off">Dislikes are not shown</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 %s</string>
|
||||
<string name="revanced_ryd_shorts_summary_on">Dislikes shown on Shorts</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>
|
||||
<!-- 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_summary_on">Dislikes shown as percentage</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_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_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_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_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_invalid">API URL is invalid</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_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 %s</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_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_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>
|
||||
<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_export_failed">Failed to export: %s</string>
|
||||
@@ -1042,7 +1040,7 @@
|
||||
<patch id="video.speed.custom.CustomPlaybackSpeedPatch">
|
||||
<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_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>
|
||||
</patch>
|
||||
<patch id="video.speed.remember.RememberPlaybackSpeedPatch">
|
||||
|
||||
Reference in New Issue
Block a user