Compare commits

..

18 Commits

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

### Bug Fixes

* **YouTube - Hide ads:** rename `Hide paid content` to `Hide paid promotion label` ([#3026](https://github.com/ReVanced/revanced-patches/issues/3026)) ([58ce37b](58ce37b0d3))
2024-04-15 15:21:08 +00:00
LisoUseInAIKyrios
58ce37b0d3 fix(YouTube - Hide ads): rename Hide paid content to Hide paid promotion label (#3026) 2024-04-15 19:18:57 +04:00
semantic-release-bot
4b7e12f995 chore(release): 4.7.0-dev.8 [skip ci]
# [4.7.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.7...v4.7.0-dev.8) (2024-04-14)

### Features

* **YouTube - Hide Shorts components:** Hide tagged products, hide search suggestions ([#3019](https://github.com/ReVanced/revanced-patches/issues/3019)) ([2e59965](2e59965bb5))
2024-04-14 14:56:15 +00:00
LisoUseInAIKyrios
2e59965bb5 feat(YouTube - Hide Shorts components): Hide tagged products, hide search suggestions (#3019) 2024-04-14 18:54:00 +04:00
semantic-release-bot
426f405407 chore(release): 4.7.0-dev.7 [skip ci]
# [4.7.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.6...v4.7.0-dev.7) (2024-04-14)

### Features

* **YouTube - Hide layout components:** Hide playables ([f85f518](f85f518fc9))
2024-04-14 00:09:07 +00:00
oSumAtrIX
f85f518fc9 feat(YouTube - Hide layout components): Hide playables 2024-04-14 02:06:41 +02:00
LisoUseInAIKyrios
f3972d313f chore: fix typo 2024-04-12 23:52:21 +04:00
semantic-release-bot
04a72d52de chore(release): 4.7.0-dev.6 [skip ci]
# [4.7.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.5...v4.7.0-dev.6) (2024-04-12)

### Features

* **YouTube - Hide Shorts components:** Hide `Shop`, `Location` and `Save sound to playlist` buttons ([#3018](https://github.com/ReVanced/revanced-patches/issues/3018)) ([be76e49](be76e49a8b))
2024-04-12 19:46:09 +00:00
LisoUseInAIKyrios
be76e49a8b feat(YouTube - Hide Shorts components): Hide Shop, Location and Save sound to playlist buttons (#3018) 2024-04-12 23:44:00 +04:00
semantic-release-bot
fa1c616014 chore(release): 4.7.0-dev.5 [skip ci]
# [4.7.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.4...v4.7.0-dev.5) (2024-04-10)

### Bug Fixes

* **YouTube - Hide Shorts components:** Correctly hide Shorts if navigation tab is changed using device back button ([#3007](https://github.com/ReVanced/revanced-patches/issues/3007)) ([e97aaf4](e97aaf4aae))
2024-04-10 08:31:43 +00:00
LisoUseInAIKyrios
e97aaf4aae fix(YouTube - Hide Shorts components): Correctly hide Shorts if navigation tab is changed using device back button (#3007) 2024-04-10 12:29:39 +04:00
semantic-release-bot
92c90ec208 chore(release): 4.7.0-dev.4 [skip ci]
# [4.7.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.3...v4.7.0-dev.4) (2024-04-09)

### Features

* **Amazon:** Add `Always allow deep-linking` patch ([#3000](https://github.com/ReVanced/revanced-patches/issues/3000)) ([f2fe0d5](f2fe0d5c6f))
* **Twitter:** Add `Sanitize sharing links` patch ([#3003](https://github.com/ReVanced/revanced-patches/issues/3003)) ([b4e8beb](b4e8beb8ec))
2024-04-09 17:45:11 +00:00
Twin
b4e8beb8ec feat(Twitter): Add Sanitize sharing links patch (#3003) 2024-04-09 19:42:51 +02:00
1fexd
f2fe0d5c6f feat(Amazon): Add Always allow deep-linking patch (#3000) 2024-04-09 19:41:45 +02:00
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
18 changed files with 312 additions and 58 deletions

View File

@@ -1,3 +1,53 @@
# [4.7.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.8...v4.7.0-dev.9) (2024-04-15)
### Bug Fixes
* **YouTube - Hide ads:** rename `Hide paid content` to `Hide paid promotion label` ([#3026](https://github.com/ReVanced/revanced-patches/issues/3026)) ([17e4ac9](https://github.com/ReVanced/revanced-patches/commit/17e4ac978a2f109fd62469a3163b636cd63c55ae))
# [4.7.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.7...v4.7.0-dev.8) (2024-04-14)
### Features
* **YouTube - Hide Shorts components:** Hide tagged products, hide search suggestions ([#3019](https://github.com/ReVanced/revanced-patches/issues/3019)) ([e0d2fe5](https://github.com/ReVanced/revanced-patches/commit/e0d2fe5bd2e681b9a5252a8e4ad582cc019b1606))
# [4.7.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.6...v4.7.0-dev.7) (2024-04-14)
### Features
* **YouTube - Hide layout components:** Hide playables ([8423515](https://github.com/ReVanced/revanced-patches/commit/842351548baa33737db09be1cbca9f87c1951341))
# [4.7.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.5...v4.7.0-dev.6) (2024-04-12)
### Features
* **YouTube - Hide Shorts components:** Hide `Shop`, `Location` and `Save sound to playlist` buttons ([#3018](https://github.com/ReVanced/revanced-patches/issues/3018)) ([5210ac4](https://github.com/ReVanced/revanced-patches/commit/5210ac431c191987264865bf8e789ea9f3fdd360))
# [4.7.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.4...v4.7.0-dev.5) (2024-04-10)
### Bug Fixes
* **YouTube - Hide Shorts components:** Correctly hide Shorts if navigation tab is changed using device back button ([#3007](https://github.com/ReVanced/revanced-patches/issues/3007)) ([e5848e9](https://github.com/ReVanced/revanced-patches/commit/e5848e99c4cc838595164ef673a77fe60d28086b))
# [4.7.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v4.7.0-dev.3...v4.7.0-dev.4) (2024-04-09)
### Features
* **Amazon:** Add `Always allow deep-linking` patch ([#3000](https://github.com/ReVanced/revanced-patches/issues/3000)) ([a92b7fb](https://github.com/ReVanced/revanced-patches/commit/a92b7fb43c8b1b45577360cdc6d883fe2815c2f2))
* **Twitter:** Add `Sanitize sharing links` patch ([#3003](https://github.com/ReVanced/revanced-patches/issues/3003)) ([186b887](https://github.com/ReVanced/revanced-patches/commit/186b8874157eef1b882b05d491ba1d4ca2809535))
# [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

@@ -152,6 +152,12 @@ public final class app/revanced/patches/all/telephony/sim/spoof/SpoofSimCountryP
public fun transform (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;Lkotlin/Pair;)V public fun transform (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;Lkotlin/Pair;)V
} }
public final class app/revanced/patches/amazon/deeplinking/DeepLinkingPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/amazon/deeplinking/DeepLinkingPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
public final class app/revanced/patches/backdrops/misc/pro/ProUnlockPatch : app/revanced/patcher/patch/BytecodePatch { public final class app/revanced/patches/backdrops/misc/pro/ProUnlockPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/backdrops/misc/pro/ProUnlockPatch; public static final field INSTANCE Lapp/revanced/patches/backdrops/misc/pro/ProUnlockPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
@@ -1062,10 +1068,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
@@ -1200,6 +1202,12 @@ public final class app/revanced/patches/twitter/misc/links/OpenLinksWithAppChoos
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/twitter/misc/links/SanitizeSharingLinksPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/twitter/misc/links/SanitizeSharingLinksPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
public final class app/revanced/patches/vsco/misc/pro/UnlockProPatch : app/revanced/patcher/patch/BytecodePatch { public final class app/revanced/patches/vsco/misc/pro/UnlockProPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/vsco/misc/pro/UnlockProPatch; public static final field INSTANCE Lapp/revanced/patches/vsco/misc/pro/UnlockProPatch;
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.9

View File

@@ -0,0 +1,11 @@
package app.revanced.patches.amazon.deeplinking
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
internal object DeepLinkingFingerprint : MethodFingerprint(
"Z",
parameters = listOf("L"),
accessFlags = AccessFlags.PRIVATE.value,
strings = listOf("https://www.", "android.intent.action.VIEW")
)

View File

@@ -0,0 +1,28 @@
package app.revanced.patches.amazon.deeplinking
import app.revanced.patcher.data.BytecodeContext
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.util.exception
@Patch(
name = "Always allow deep-linking",
description = "Open Amazon links, even if the app is not set to handle Amazon links.",
compatiblePackages = [CompatiblePackage("com.amazon.mShop.android.shopping")]
)
@Suppress("unused")
object DeepLinkingPatch : BytecodePatch(
setOf(DeepLinkingFingerprint)
) {
override fun execute(context: BytecodeContext) {
DeepLinkingFingerprint.result?.mutableMethod?.addInstructions(
0,
"""
const/4 v0, 0x1
return v0
"""
) ?: throw DeepLinkingFingerprint.exception
}
}

View File

@@ -5,6 +5,7 @@ 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
@@ -17,22 +18,50 @@ import app.revanced.util.exception
) )
@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.
for (liveQueryParameter in liveQueryParameters) {
it.mutableMethod.addInstructions( it.mutableMethod.addInstructions(
endIndex + 1, endIndex + 1,
""" """
# Remove "?live_now" from the request path p2. # urlPath = urlPath.replace(liveQueryParameter, "")
# p2 = p2.replace(p1, p3) const-string p1, "$liveQueryParameter"
const-string p1, ",?live_now"
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

@@ -0,0 +1,29 @@
package app.revanced.patches.twitter.misc.links
import app.revanced.patcher.data.BytecodeContext
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.twitter.misc.links.fingerprints.SanitizeSharingLinksFingerprint
import app.revanced.util.exception
@Patch(
name = "Sanitize sharing links",
description = "Removes the tracking query parameters from links before they are shared.",
compatiblePackages = [CompatiblePackage("com.twitter.android")],
)
object SanitizeSharingLinksPatch : BytecodePatch(
setOf(SanitizeSharingLinksFingerprint),
) {
override fun execute(context: BytecodeContext) {
SanitizeSharingLinksFingerprint.result?.mutableMethod?.addInstructions(
0,
"""
# Method takes in a link (string, param 0) and then appends the tracking query params,
# so all we need to do is return back the passed-in string
return-object p0
""",
) ?: throw SanitizeSharingLinksFingerprint.exception
}
}

View File

@@ -0,0 +1,8 @@
package app.revanced.patches.twitter.misc.links.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint
internal object SanitizeSharingLinksFingerprint : MethodFingerprint(
strings = listOf("<this>", "shareParam", "sessionToken"),
returnType = "Ljava/lang/String;",
)

View File

@@ -30,7 +30,7 @@ object HideAdsResourcePatch : ResourcePatch() {
SwitchPreference("revanced_hide_general_ads"), SwitchPreference("revanced_hide_general_ads"),
SwitchPreference("revanced_hide_fullscreen_ads"), SwitchPreference("revanced_hide_fullscreen_ads"),
SwitchPreference("revanced_hide_buttoned_ads"), SwitchPreference("revanced_hide_buttoned_ads"),
SwitchPreference("revanced_hide_paid_content_ads"), SwitchPreference("revanced_hide_paid_promotion_label"),
SwitchPreference("revanced_hide_self_sponsor_ads"), SwitchPreference("revanced_hide_self_sponsor_ads"),
SwitchPreference("revanced_hide_products_banner"), SwitchPreference("revanced_hide_products_banner"),
SwitchPreference("revanced_hide_shopping_links"), SwitchPreference("revanced_hide_shopping_links"),

View File

@@ -12,12 +12,8 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.all.misc.resources.AddResourcesPatch
import app.revanced.patches.shared.misc.settings.preference.InputType import app.revanced.patches.shared.misc.settings.preference.*
import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen.Sorting import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen.Sorting
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
import app.revanced.patches.shared.misc.settings.preference.TextPreference
import app.revanced.patches.youtube.layout.hide.general.fingerprints.HideShowMoreButtonFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.HideShowMoreButtonFingerprint
import app.revanced.patches.youtube.layout.hide.general.fingerprints.ParseElementFromBufferFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.ParseElementFromBufferFingerprint
import app.revanced.patches.youtube.layout.hide.general.fingerprints.PlayerOverlayFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.PlayerOverlayFingerprint
@@ -105,6 +101,7 @@ object HideLayoutComponentsPatch : BytecodePatch(
SwitchPreference("revanced_hide_info_panels"), SwitchPreference("revanced_hide_info_panels"),
SwitchPreference("revanced_hide_join_membership_button"), SwitchPreference("revanced_hide_join_membership_button"),
SwitchPreference("revanced_hide_medical_panels"), SwitchPreference("revanced_hide_medical_panels"),
SwitchPreference("revanced_hide_playables"),
SwitchPreference("revanced_hide_quick_actions"), SwitchPreference("revanced_hide_quick_actions"),
SwitchPreference("revanced_hide_related_videos"), SwitchPreference("revanced_hide_related_videos"),
SwitchPreference("revanced_hide_subscribers_community_guidelines"), SwitchPreference("revanced_hide_subscribers_community_guidelines"),

View File

@@ -34,10 +34,14 @@ object HideShortsComponentsResourcePatch : ResourcePatch() {
SwitchPreference("revanced_hide_shorts_sound_button"), SwitchPreference("revanced_hide_shorts_sound_button"),
// Everything else. // Everything else.
SwitchPreference("revanced_hide_shorts_thanks_button"),
SwitchPreference("revanced_hide_shorts_join_button"), SwitchPreference("revanced_hide_shorts_join_button"),
SwitchPreference("revanced_hide_shorts_subscribe_button"), SwitchPreference("revanced_hide_shorts_subscribe_button"),
SwitchPreference("revanced_hide_shorts_subscribe_button_paused"), SwitchPreference("revanced_hide_shorts_paused_overlay_buttons"),
SwitchPreference("revanced_hide_shorts_save_sound_button"),
SwitchPreference("revanced_hide_shorts_shop_button"),
SwitchPreference("revanced_hide_shorts_tagged_products"),
SwitchPreference("revanced_hide_shorts_search_suggestions"),
SwitchPreference("revanced_hide_shorts_location_label"),
SwitchPreference("revanced_hide_shorts_channel_bar"), SwitchPreference("revanced_hide_shorts_channel_bar"),
SwitchPreference("revanced_hide_shorts_info_panel"), SwitchPreference("revanced_hide_shorts_info_panel"),
SwitchPreference("revanced_hide_shorts_full_video_link_label"), SwitchPreference("revanced_hide_shorts_full_video_link_label"),

View File

@@ -36,7 +36,9 @@ object NavigationBarHookPatch : BytecodePatch(
NavigationEnumFingerprint, NavigationEnumFingerprint,
PivotBarButtonsCreateDrawableViewFingerprint, PivotBarButtonsCreateDrawableViewFingerprint,
PivotBarButtonsCreateResourceViewFingerprint, PivotBarButtonsCreateResourceViewFingerprint,
PivotBarButtonsViewSetSelectedFingerprint,
NavigationBarHookCallbackFingerprint, NavigationBarHookCallbackFingerprint,
MainActivityOnBackPressedFingerprint,
ActionBarSearchResultsFingerprint, ActionBarSearchResultsFingerprint,
), ),
) { ) {
@@ -90,6 +92,29 @@ object NavigationBarHookPatch : BytecodePatch(
} }
} }
PivotBarButtonsViewSetSelectedFingerprint.resultOrThrow().mutableMethod.apply {
val index = PivotBarButtonsViewSetSelectedFingerprint.indexOfSetViewSelectedInstruction(this)
val instruction = getInstruction<FiveRegisterInstruction>(index)
val viewRegister = instruction.registerC
val isSelectedRegister = instruction.registerD
addInstruction(
index + 1,
"invoke-static { v$viewRegister, v$isSelectedRegister }, " +
"$INTEGRATIONS_CLASS_DESCRIPTOR->navigationTabSelected(Landroid/view/View;Z)V",
)
}
// Hook onto back button pressed. Needed to fix race problem with
// litho filtering based on navigation tab before the tab is updated.
MainActivityOnBackPressedFingerprint.resultOrThrow().mutableMethod.apply {
addInstruction(
0,
"invoke-static { p0 }, " +
"$INTEGRATIONS_CLASS_DESCRIPTOR->onBackPressed(Landroid/app/Activity;)V",
)
}
// Hook the search bar. // Hook the search bar.
// Two different layouts are used at the hooked code. // Two different layouts are used at the hooked code.

View File

@@ -0,0 +1,17 @@
package app.revanced.patches.youtube.misc.navigation.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
internal object MainActivityOnBackPressedFingerprint : MethodFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "V",
parameters = listOf(),
customFingerprint = { methodDef, _ ->
(methodDef.definingClass.endsWith("MainActivity;") ||
// Old versions of YouTube called this class "WatchWhileActivity" instead.
methodDef.definingClass.endsWith("WatchWhileActivity;"))
&& methodDef.name == "onBackPressed"
}
)

View File

@@ -0,0 +1,27 @@
package app.revanced.patches.youtube.misc.navigation.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.youtube.misc.navigation.fingerprints.PivotBarButtonsViewSetSelectedFingerprint.indexOfSetViewSelectedInstruction
import app.revanced.util.getReference
import app.revanced.util.indexOfFirstInstruction
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.Method
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
internal object PivotBarButtonsViewSetSelectedFingerprint : MethodFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("I", "Z"),
returnType = "V",
customFingerprint = { methodDef, classDef ->
classDef.type == "Lcom/google/android/libraries/youtube/rendering/ui/pivotbar/PivotBar;" &&
indexOfSetViewSelectedInstruction(methodDef) >= 0
}
) {
fun indexOfSetViewSelectedInstruction(methodDef: Method) =
methodDef.indexOfFirstInstruction {
opcode == Opcode.INVOKE_VIRTUAL && getReference<MethodReference>()?.name == "setSelected"
}
}

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>
--> -->
@@ -166,6 +166,9 @@
<string name="revanced_hide_channel_bar_title">Hide channel bar</string> <string name="revanced_hide_channel_bar_title">Hide channel bar</string>
<string name="revanced_hide_channel_bar_summary_on">Channel bar is hidden</string> <string name="revanced_hide_channel_bar_summary_on">Channel bar is hidden</string>
<string name="revanced_hide_channel_bar_summary_off">Channel bar is shown</string> <string name="revanced_hide_channel_bar_summary_off">Channel bar is shown</string>
<string name="revanced_hide_playables_title">Hide playables</string>
<string name="revanced_hide_playables_summary_on">Playables are hidden</string>
<string name="revanced_hide_playables_summary_off">Playables are shown</string>
<string name="revanced_hide_quick_actions_title">Hide quick actions in fullscreen</string> <string name="revanced_hide_quick_actions_title">Hide quick actions in fullscreen</string>
<string name="revanced_hide_quick_actions_summary_on">Quick actions are hidden</string> <string name="revanced_hide_quick_actions_summary_on">Quick actions are hidden</string>
<string name="revanced_hide_quick_actions_summary_off">Quick actions are shown</string> <string name="revanced_hide_quick_actions_summary_off">Quick actions are shown</string>
@@ -213,6 +216,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>
@@ -245,9 +249,9 @@
<string name="revanced_hide_buttoned_ads_title">Hide buttoned ads</string> <string name="revanced_hide_buttoned_ads_title">Hide buttoned ads</string>
<string name="revanced_hide_buttoned_ads_summary_on">Buttoned ads are hidden</string> <string name="revanced_hide_buttoned_ads_summary_on">Buttoned ads are hidden</string>
<string name="revanced_hide_buttoned_ads_summary_off">Buttoned ads are shown</string> <string name="revanced_hide_buttoned_ads_summary_off">Buttoned ads are shown</string>
<string name="revanced_hide_paid_content_ads_title">Hide paid content</string> <string name="revanced_hide_paid_promotion_label_title">Hide paid promotion label</string>
<string name="revanced_hide_paid_content_ads_summary_on">Paid content is hidden</string> <string name="revanced_hide_paid_promotion_label_summary_on">Paid promotion label is hidden</string>
<string name="revanced_hide_paid_content_ads_summary_off">Paid content is shown</string> <string name="revanced_hide_paid_promotion_label_summary_off">Paid promotion label is shown</string>
<string name="revanced_hide_self_sponsor_ads_title">Hide self sponsored cards</string> <string name="revanced_hide_self_sponsor_ads_title">Hide self sponsored cards</string>
<string name="revanced_hide_self_sponsor_ads_summary_on">Self sponsored cards are hidden</string> <string name="revanced_hide_self_sponsor_ads_summary_on">Self sponsored cards are hidden</string>
<string name="revanced_hide_self_sponsor_ads_summary_off">Self sponsored cards are shown</string> <string name="revanced_hide_self_sponsor_ads_summary_off">Self sponsored cards are shown</string>
@@ -548,6 +552,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>
@@ -566,15 +571,24 @@
<string name="revanced_hide_shorts_subscribe_button_title">Hide subscribe button</string> <string name="revanced_hide_shorts_subscribe_button_title">Hide subscribe button</string>
<string name="revanced_hide_shorts_subscribe_button_summary_on">Subscribe button is hidden</string> <string name="revanced_hide_shorts_subscribe_button_summary_on">Subscribe button is hidden</string>
<string name="revanced_hide_shorts_subscribe_button_summary_off">Subscribe button is shown</string> <string name="revanced_hide_shorts_subscribe_button_summary_off">Subscribe button is shown</string>
<!-- 'subscribe' should be translated using the same localized wording YouTube displays for the button. --> <string name="revanced_hide_shorts_paused_overlay_buttons_title">Hide paused overlay buttons</string>
<string name="revanced_hide_shorts_subscribe_button_paused_title">Hide subscribe button when paused</string> <string name="revanced_hide_shorts_paused_overlay_buttons_summary_on">Paused overlay buttons are hidden</string>
<string name="revanced_hide_shorts_subscribe_button_paused_summary_on">Subscribe button is hidden</string> <string name="revanced_hide_shorts_paused_overlay_buttons_summary_off">Paused overlay buttons are shown</string>
<string name="revanced_hide_shorts_subscribe_button_paused_summary_off">Subscribe button is shown</string> <string name="revanced_hide_shorts_shop_button_title">Hide shop button</string>
<!-- 'thanks' should be translated using the same localized wording YouTube displays for the button. <string name="revanced_hide_shorts_shop_button_summary_on">Shop button is hidden</string>
If the button never shows up, then translate the button name normally. --> <string name="revanced_hide_shorts_shop_button_summary_off">Shop button is shown</string>
<string name="revanced_hide_shorts_thanks_button_title">Hide thanks button</string> <string name="revanced_hide_shorts_tagged_products_title">Hide tagged products</string>
<string name="revanced_hide_shorts_thanks_button_summary_on">Thanks button is hidden</string> <string name="revanced_hide_shorts_tagged_products_summary_on">Tagged products are hidden</string>
<string name="revanced_hide_shorts_thanks_button_summary_off">Thanks button is shown</string> <string name="revanced_hide_shorts_tagged_products_summary_off">Tagged products are shown</string>
<string name="revanced_hide_shorts_location_label_title">Hide location label</string>
<string name="revanced_hide_shorts_location_label_summary_on">Location label is hidden</string>
<string name="revanced_hide_shorts_location_label_summary_off">Location label is shown</string>
<string name="revanced_hide_shorts_save_sound_button_title">Hide save sound to playlist button</string>
<string name="revanced_hide_shorts_save_sound_button_summary_on">Save sound to playlist is hidden</string>
<string name="revanced_hide_shorts_save_sound_button_summary_off">Save sound to playlist is shown</string>
<string name="revanced_hide_shorts_search_suggestions_title">Hide search suggestions</string>
<string name="revanced_hide_shorts_search_suggestions_summary_on">Search suggestions are hidden</string>
<string name="revanced_hide_shorts_search_suggestions_summary_off">Search suggestions are shown</string>
<string name="revanced_hide_shorts_like_button_title">Hide like button</string> <string name="revanced_hide_shorts_like_button_title">Hide like button</string>
<string name="revanced_hide_shorts_like_button_summary_on">Like button is hidden</string> <string name="revanced_hide_shorts_like_button_summary_on">Like button is hidden</string>
<string name="revanced_hide_shorts_like_button_summary_off">Like button is shown</string> <string name="revanced_hide_shorts_like_button_summary_off">Like button is shown</string>
@@ -647,11 +661,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>
@@ -740,16 +752,14 @@
<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 +1052,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">