mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2024-11-10 01:01:56 +01:00
chore: Merge branch dev
to main
(#3087)
This commit is contained in:
commit
266d869f6a
72 changed files with 420 additions and 137 deletions
51
CHANGELOG.md
51
CHANGELOG.md
|
@ -1,3 +1,54 @@
|
|||
# [2.193.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v2.193.0-dev.6...v2.193.0-dev.7) (2023-10-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube:** Bump compatibility to `18.38.44` ([#3071](https://github.com/ReVanced/revanced-patches/issues/3071)) ([a73868c](https://github.com/ReVanced/revanced-patches/commit/a73868cb270295c871a9f1e4d543f728d6152146))
|
||||
|
||||
# [2.193.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v2.193.0-dev.5...v2.193.0-dev.6) (2023-10-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube:** Sort settings alphabetically despite punctuation ([#3097](https://github.com/ReVanced/revanced-patches/issues/3097)) ([46e3c97](https://github.com/ReVanced/revanced-patches/commit/46e3c97d24e282e4d7d444603af4fb475ae03315))
|
||||
|
||||
# [2.193.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v2.193.0-dev.4...v2.193.0-dev.5) (2023-10-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Consolidate patches ([#3098](https://github.com/ReVanced/revanced-patches/issues/3098)) ([02f767d](https://github.com/ReVanced/revanced-patches/commit/02f767df3cd1b2d0155e7360d2b26fa5d1cfcace))
|
||||
|
||||
# [2.193.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.193.0-dev.3...v2.193.0-dev.4) (2023-10-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Boost for Reddit - Spoof client:** Set user-agent for OAuth requests to fix login ([2223951](https://github.com/ReVanced/revanced-patches/commit/2223951fa16011d735ef4c4cda11eba13403f62d))
|
||||
* **Infinity for Reddit - Spoof client:** Set user-agent for OAuth requests to fix login ([a710f05](https://github.com/ReVanced/revanced-patches/commit/a710f05bb46156e66ca56aa4731e1028f459c414))
|
||||
* **Sync for Reddit - Spoof client:** Set user-agent for OAuth requests to fix login ([a48c4a7](https://github.com/ReVanced/revanced-patches/commit/a48c4a7cc1dbb3ecfce2e345240bca8142740b77))
|
||||
|
||||
# [2.193.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.193.0-dev.2...v2.193.0-dev.3) (2023-10-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube - Return YouTube Dislike:** Support version `18.37.36` ([#3061](https://github.com/ReVanced/revanced-patches/issues/3061)) ([fe11db7](https://github.com/ReVanced/revanced-patches/commit/fe11db70eafb481db87231d3db22eafbaa479871))
|
||||
|
||||
# [2.193.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.193.0-dev.1...v2.193.0-dev.2) (2023-10-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube:** Add `Disable fine scrubbing gesture` patch ([6c9baf2](https://github.com/ReVanced/revanced-patches/commit/6c9baf22614b1be4870be684915445f7a138cf31))
|
||||
|
||||
# [2.193.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.192.0...v2.193.0-dev.1) (2023-10-05)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube - Hide shorts components:** Hide subscribe button when paused separately from subscribe button ([52d07ec](https://github.com/ReVanced/revanced-patches/commit/52d07ecd39b1c37cfbfbfa699ccbef849600d9f8))
|
||||
|
||||
# [2.192.0](https://github.com/ReVanced/revanced-patches/compare/v2.191.0...v2.192.0) (2023-10-05)
|
||||
|
||||
|
||||
|
|
|
@ -28,12 +28,15 @@
|
|||
<a href="https://t.me/app_revanced">
|
||||
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
|
||||
</a>
|
||||
<a href="https://twitter.com/revancedapp">
|
||||
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032018-6da37214-7474-4641-a1da-7af7db3a31cd.png" />
|
||||
<a href="https://x.com/revancedapp">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
|
||||
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
|
||||
<picture/>
|
||||
</a>
|
||||
<a href="https://www.youtube.com/@ReVanced">
|
||||
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
|
||||
</a>
|
||||
</a>
|
||||
<br>
|
||||
<br>
|
||||
Continuing the legacy of Vanced
|
||||
|
|
10
README.md
10
README.md
|
@ -28,18 +28,20 @@
|
|||
<a href="https://t.me/app_revanced">
|
||||
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
|
||||
</a>
|
||||
<a href="https://twitter.com/revancedapp">
|
||||
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032018-6da37214-7474-4641-a1da-7af7db3a31cd.png" />
|
||||
<a href="https://x.com/revancedapp">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
|
||||
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
|
||||
<picture/>
|
||||
</a>
|
||||
<a href="https://www.youtube.com/@ReVanced">
|
||||
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
|
||||
</a>
|
||||
</a>
|
||||
<br>
|
||||
<br>
|
||||
Continuing the legacy of Vanced
|
||||
</p>
|
||||
|
||||
|
||||
# 🧩 ReVanced Patches
|
||||
|
||||
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-patches/release.yml)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 2.192.0
|
||||
version = 2.193.0-dev.7
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,6 @@
|
|||
package app.revanced.patches.reddit.customclients
|
||||
|
||||
object Constants {
|
||||
const val OAUTH_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) " +
|
||||
"Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.60"
|
||||
}
|
|
@ -6,7 +6,9 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
|||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||
import app.revanced.patches.reddit.customclients.Constants.OAUTH_USER_AGENT
|
||||
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
||||
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.LoginActivityOnCreateFingerprint
|
||||
|
||||
@Patch(
|
||||
name = "Spoof client",
|
||||
|
@ -15,7 +17,9 @@ import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints
|
|||
)
|
||||
@Suppress("unused")
|
||||
object SpoofClientPatch : AbstractSpoofClientPatch(
|
||||
"http://rubenmayayo.com", listOf(GetClientIdFingerprint)
|
||||
"http://rubenmayayo.com",
|
||||
clientIdFingerprints = listOf(GetClientIdFingerprint),
|
||||
userAgentFingerprints = listOf(LoginActivityOnCreateFingerprint)
|
||||
) {
|
||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||
first().mutableMethod.addInstructions(
|
||||
|
@ -26,4 +30,20 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
|
|||
"""
|
||||
)
|
||||
}
|
||||
|
||||
override fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
|
||||
first().let { result ->
|
||||
result.mutableMethod.apply {
|
||||
val insertIndex = result.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
addInstructions(
|
||||
insertIndex,
|
||||
"""
|
||||
const-string v7, "$OAUTH_USER_AGENT"
|
||||
invoke-virtual {v4, v7}, Landroid/webkit/WebSettings;->setUserAgentString(Ljava/lang/String;)V
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object LoginActivityOnCreateFingerprint : MethodFingerprint(
|
||||
opcodes = listOf(
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_4
|
||||
),
|
||||
customFingerprint = { method, classDef ->
|
||||
method.name == "onCreate" && classDef.type.endsWith("LoginActivity;")
|
||||
}
|
||||
)
|
|
@ -1,14 +1,17 @@
|
|||
package app.revanced.patches.reddit.customclients.infinityforreddit.api
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||
import app.revanced.patches.reddit.customclients.Constants.OAUTH_USER_AGENT
|
||||
import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.GetHttpBasicAuthHeaderFingerprint
|
||||
import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.LoginActivityOnCreateFingerprint
|
||||
import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.SetWebViewSettingsFingerprint
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
|
@ -32,7 +35,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||
@Suppress("unused")
|
||||
object SpoofClientPatch : AbstractSpoofClientPatch(
|
||||
"infinity://localhost",
|
||||
listOf(GetHttpBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint)
|
||||
clientIdFingerprints = listOf(GetHttpBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint),
|
||||
userAgentFingerprints = listOf(SetWebViewSettingsFingerprint)
|
||||
) {
|
||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||
forEach {
|
||||
|
@ -48,4 +52,18 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
|
||||
first().let { result ->
|
||||
val insertIndex = result.scanResult.stringsScanResult!!.matches.first().index
|
||||
|
||||
result.mutableMethod.addInstructions(
|
||||
insertIndex,
|
||||
"""
|
||||
const-string v0, "$OAUTH_USER_AGENT"
|
||||
invoke-virtual {p1, v0}, Landroid/webkit/WebSettings;->setUserAgentString(Ljava/lang/String;)V
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object SetWebViewSettingsFingerprint : MethodFingerprint(
|
||||
strings= listOf("https://www.reddit.com/api/v1/authorize.compact")
|
||||
)
|
|
@ -10,9 +10,11 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
|||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||
import app.revanced.patches.reddit.customclients.Constants.OAUTH_USER_AGENT
|
||||
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetAuthorizationStringFingerprint
|
||||
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetBearerTokenFingerprint
|
||||
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.ImgurImageAPIFingerprint
|
||||
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.LoadBrowserURLFingerprint
|
||||
import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.DisablePiracyDetectionPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
|
@ -33,6 +35,7 @@ import java.util.*
|
|||
object SpoofClientPatch : AbstractSpoofClientPatch(
|
||||
"http://redditsync/auth",
|
||||
clientIdFingerprints = listOf(GetAuthorizationStringFingerprint),
|
||||
userAgentFingerprints = listOf(LoadBrowserURLFingerprint),
|
||||
miscellaneousFingerprints = listOf(ImgurImageAPIFingerprint)
|
||||
) {
|
||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||
|
@ -79,4 +82,18 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
|
|||
"const-string v1, \"https://api.imgur.com/3/image\""
|
||||
)
|
||||
}
|
||||
|
||||
override fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
|
||||
first().let { result ->
|
||||
val insertIndex = result.scanResult.patternScanResult!!.startIndex
|
||||
|
||||
result.mutableMethod.addInstructions(
|
||||
insertIndex,
|
||||
"""
|
||||
const-string v0, "$OAUTH_USER_AGENT"
|
||||
invoke-virtual {p1, v0}, Landroid/webkit/WebSettings;->setUserAgentString(Ljava/lang/String;)V
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object LoadBrowserURLFingerprint : MethodFingerprint(
|
||||
parameters = listOf("Landroid/view/View;", "Landroid/os/Bundle;"),
|
||||
opcodes = listOf(Opcode.CONST_4),
|
||||
strings = listOf("CustomInterface")
|
||||
)
|
|
@ -40,4 +40,9 @@ internal fun <T> Element.addDefault(default: T) {
|
|||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun CharSequence.removePunctuation(): String {
|
||||
val punctuation = "\\p{P}+".toRegex()
|
||||
return this.replace(punctuation, "")
|
||||
}
|
|
@ -4,6 +4,7 @@ import app.revanced.patches.shared.settings.preference.BasePreference
|
|||
import app.revanced.patches.shared.settings.preference.impl.PreferenceCategory
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.removePunctuation
|
||||
import java.io.Closeable
|
||||
|
||||
abstract class AbstractPreferenceScreen(
|
||||
|
@ -35,8 +36,8 @@ abstract class AbstractPreferenceScreen(
|
|||
return PreferenceScreen(
|
||||
key,
|
||||
StringResource("${key}_title", title),
|
||||
preferences.sortedBy { it.title.value.lowercase() } +
|
||||
categories.sortedBy { it.title.lowercase() }.map { it.transform() },
|
||||
preferences.sortedBy { it.title.value.removePunctuation().lowercase() } +
|
||||
categories.sortedBy { it.title.removePunctuation().lowercase() }.map { it.transform() },
|
||||
summary?.let { summary ->
|
||||
StringResource("${key}_summary", summary)
|
||||
}
|
||||
|
@ -63,7 +64,7 @@ abstract class AbstractPreferenceScreen(
|
|||
return PreferenceCategory(
|
||||
key,
|
||||
StringResource("${key}_title", title),
|
||||
preferences.sortedBy { it.title.value.lowercase() }
|
||||
preferences.sortedBy { it.title.value.removePunctuation().lowercase() }
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -15,8 +15,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Hide \"Get YouTube Premium\" advertisements",
|
||||
description = "Hides YouTube Premium advertisements under video player.",
|
||||
description = "Hides YouTube Premium signup promotions under the video player.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
|
@ -27,7 +26,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
@ -42,15 +42,15 @@ object HideGetPremiumPatch : BytecodePatch(setOf(GetPremiumViewFingerprint)) {
|
|||
"revanced_hide_get_premium",
|
||||
StringResource(
|
||||
"revanced_hide_get_premium_title",
|
||||
"Hide \"Get YouTube Premium\" advertisements"
|
||||
"Hide YouTube Premium promotions"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_get_premium_summary_on",
|
||||
"YouTube Premium advertisements under video player are hidden"
|
||||
"YouTube Premium promotions under video player is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_get_premium_summary_off",
|
||||
"YouTube Premium advertisements under video player are shown"
|
||||
"YouTube Premium promotions under video player is shown"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -30,7 +30,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -25,7 +25,8 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -25,7 +25,8 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
),
|
||||
]
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
package app.revanced.patches.youtube.interaction.seekbar
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.IsSwipingUpFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Disable fine scrubbing gesture",
|
||||
description = "Disables gesture that shows the fine scrubbing overlay when swiping up on the seekbar.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
[
|
||||
"18.32.39",
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object DisableFineScrubbingGesturePatch : BytecodePatch(
|
||||
setOf(IsSwipingUpFingerprint)
|
||||
) {
|
||||
private const val INTEGRATIONS_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/DisableFineScrubbingGesturePatch;->" +
|
||||
"disableGesture(Landroid/view/VelocityTracker;Landroid/view/MotionEvent;)V"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_fine_scrubbing_gesture",
|
||||
StringResource("revanced_disable_fine_scrubbing_gesture_title", "Disable fine scrubbing gesture"),
|
||||
StringResource("revanced_disable_fine_scrubbing_gesture_summary_on", "Gesture is disabled"),
|
||||
StringResource("revanced_disable_fine_scrubbing_gesture_summary_off", "Gesture is enabled"),
|
||||
)
|
||||
)
|
||||
|
||||
IsSwipingUpFingerprint.result?.let {
|
||||
val addMovementIndex = it.scanResult.patternScanResult!!.startIndex - 1
|
||||
|
||||
it.mutableMethod.apply {
|
||||
val addMovementInstruction = getInstruction<FiveRegisterInstruction>(addMovementIndex)
|
||||
val trackerRegister = addMovementInstruction.registerC
|
||||
val eventRegister = addMovementInstruction.registerD
|
||||
|
||||
replaceInstruction(
|
||||
addMovementIndex,
|
||||
"invoke-static {v$trackerRegister, v$eventRegister}, $INTEGRATIONS_METHOD_DESCRIPTOR"
|
||||
)
|
||||
}
|
||||
} ?: throw IsSwipingUpFingerprint.exception
|
||||
}
|
||||
}
|
|
@ -8,9 +8,12 @@ import app.revanced.patcher.patch.BytecodePatch
|
|||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.OnTouchEventHandlerFingerprint
|
||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SeekbarTappingFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
|
@ -19,9 +22,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||
name = "Seekbar tapping",
|
||||
description = "Enables tap-to-seek on the seekbar of the video player.",
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
EnableSeekbarTappingResourcePatch::class
|
||||
],
|
||||
IntegrationsPatch::class, SettingsPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
|
@ -32,7 +33,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
@ -45,6 +47,15 @@ object EnableSeekbarTappingPatch : BytecodePatch(
|
|||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_seekbar_tapping",
|
||||
StringResource("revanced_seekbar_tapping_title", "Enable seekbar tapping"),
|
||||
StringResource("revanced_seekbar_tapping_summary_on", "Seekbar tapping is enabled"),
|
||||
StringResource("revanced_seekbar_tapping_summary_off", "Seekbar tapping is disabled")
|
||||
)
|
||||
)
|
||||
|
||||
// Find the required methods to tap the seekbar.
|
||||
val seekbarTappingMethods = OnTouchEventHandlerFingerprint.result?.let {
|
||||
val patternScanResult = it.scanResult.patternScanResult!!
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
package app.revanced.patches.youtube.interaction.seekbar
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [SettingsPatch::class]
|
||||
)
|
||||
object EnableSeekbarTappingResourcePatch : ResourcePatch() {
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_seekbar_tapping",
|
||||
StringResource("revanced_seekbar_tapping_title", "Enable seekbar tapping"),
|
||||
StringResource("revanced_seekbar_tapping_summary_on", "Seekbar tapping is enabled"),
|
||||
StringResource("revanced_seekbar_tapping_summary_off", "Seekbar tapping is disabled")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package app.revanced.patches.youtube.interaction.seekbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object IsSwipingUpFingerprint : MethodFingerprint(
|
||||
parameters = listOf("Landroid/view/MotionEvent;", "J"),
|
||||
opcodes = listOf(Opcode.SGET_OBJECT)
|
||||
)
|
|
@ -32,7 +32,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -30,7 +30,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
],
|
||||
|
|
|
@ -28,7 +28,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -38,7 +38,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -29,7 +29,8 @@ import com.android.tools.smali.dexlib2.Opcode
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -37,7 +37,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -33,7 +33,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -28,7 +28,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -28,7 +28,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -27,7 +27,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -28,7 +28,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -31,7 +31,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -28,7 +28,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -24,7 +24,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -31,7 +31,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
@ -53,14 +54,14 @@ object HideLayoutComponentsPatch : BytecodePatch(
|
|||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_join_membership_button",
|
||||
StringResource("revanced_hide_join_membership_button_title", "Hide \"Join\" button"),
|
||||
StringResource("revanced_hide_join_membership_button_title", "Hide \\\'Join\\\' button"),
|
||||
StringResource("revanced_hide_join_membership_button_summary_on", "Button is hidden"),
|
||||
StringResource("revanced_hide_join_membership_button_summary_off", "Button is shown")
|
||||
),
|
||||
|
||||
SwitchPreference(
|
||||
"revanced_hide_notify_me_button",
|
||||
StringResource("revanced_hide_notify_me_button_title", "Hide \"Notify me\" button"),
|
||||
StringResource("revanced_hide_notify_me_button_title", "Hide \\\'Notify me\\\' button"),
|
||||
StringResource("revanced_hide_notify_me_button_summary_on", "Button is hidden"),
|
||||
StringResource("revanced_hide_notify_me_button_summary_off", "Button is shown")
|
||||
),
|
||||
|
|
|
@ -36,7 +36,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -11,7 +11,7 @@ import app.revanced.patches.youtube.layout.hide.loadmorebutton.fingerprints.Hide
|
|||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Hide \"Load more\" button",
|
||||
name = "Hide \'Load more\' button",
|
||||
description = "Hides the button under videos that loads similar videos.",
|
||||
dependencies = [HideLoadMoreButtonResourcePatch::class],
|
||||
compatiblePackages = [
|
||||
|
@ -24,7 +24,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -21,7 +21,7 @@ object HideLoadMoreButtonResourcePatch : ResourcePatch() {
|
|||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_load_more_button",
|
||||
StringResource("revanced_hide_load_more_button_title", "Hide \"Load More\" button"),
|
||||
StringResource("revanced_hide_load_more_button_title", "Hide \\\'Load More\\\' button"),
|
||||
StringResource("revanced_hide_load_more_button_summary_on", "Button is hidden"),
|
||||
StringResource("revanced_hide_load_more_button_summary_off", "Button is shown")
|
||||
)
|
||||
|
|
|
@ -24,7 +24,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -25,7 +25,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
])
|
||||
]
|
||||
)
|
||||
|
|
|
@ -33,7 +33,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -37,7 +37,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
@ -122,7 +123,7 @@ object HideShortsComponentsPatch : BytecodePatch(
|
|||
// Required to prevent a black bar from appearing at the bottom of the screen.
|
||||
BottomNavigationBarFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val moveResultIndex = it.scanResult.patternScanResult!!.startIndex
|
||||
val moveResultIndex = it.scanResult.patternScanResult!!.startIndex + 2
|
||||
val viewRegister = getInstruction<OneRegisterInstruction>(moveResultIndex).registerA
|
||||
val insertIndex = moveResultIndex + 1
|
||||
|
||||
|
|
|
@ -38,6 +38,12 @@ object HideShortsComponentsResourcePatch : ResourcePatch() {
|
|||
StringResource("revanced_hide_shorts_subscribe_button_on", "Subscribe button is hidden"),
|
||||
StringResource("revanced_hide_shorts_subscribe_button_off", "Subscribe button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_subscribe_button_paused",
|
||||
StringResource("revanced_hide_shorts_subscribe_button_paused_title", "Hide subscribe button when paused"),
|
||||
StringResource("revanced_hide_shorts_subscribe_button_paused_on", "Subscribe button is hidden"),
|
||||
StringResource("revanced_hide_shorts_subscribe_button_paused_off", "Subscribe button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_thanks_button",
|
||||
StringResource("revanced_hide_shorts_thanks_button_title", "Hide thanks button"),
|
||||
|
|
|
@ -1,18 +1,24 @@
|
|||
package app.revanced.patches.youtube.layout.hide.shorts.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object BottomNavigationBarFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("Landroid/view/View;", "Landroid/os/Bundle;"),
|
||||
opcodes = listOf(
|
||||
Opcode.MOVE_RESULT_OBJECT, // Refers to bottom navigation bar
|
||||
Opcode.CONST, // R.id.app_engagement_panel_wrapper
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
),
|
||||
strings = listOf(
|
||||
"navigation_endpoint_interaction_logging_extension",
|
||||
"reel_watch_fragment_watch_while",
|
||||
"ReelWatchPaneFragmentViewModelKey"
|
||||
),
|
||||
)
|
|
@ -25,7 +25,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -29,7 +29,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -25,7 +25,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -19,7 +19,8 @@ import org.w3c.dom.Element
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
],
|
||||
|
|
|
@ -14,6 +14,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.*
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.video.videoid.VideoIdPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
|
@ -26,12 +27,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||
description = "Shows the dislike count of videos using the Return YouTube Dislike API.",
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
LithoFilterPatch::class,
|
||||
VideoIdPatch::class,
|
||||
ReturnYouTubeDislikeResourcePatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage("com.google.android.youtube", ["18.32.39"])
|
||||
CompatiblePackage("com.google.android.youtube", ["18.37.36", "18.38.44"])
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
|
@ -48,11 +50,17 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;"
|
||||
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/components/ReturnYouTubeDislikeFilterPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
// region Inject newVideoLoaded event handler to update dislikes when a new video is loaded.
|
||||
|
||||
VideoIdPatch.hookVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->newVideoLoaded(Ljava/lang/String;)V")
|
||||
|
||||
// Hook the player response video id, to start loading RYD sooner in the background.
|
||||
VideoIdPatch.hookPlayerResponseVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->preloadVideoId(Ljava/lang/String;)V")
|
||||
|
||||
// endregion
|
||||
|
||||
// region Hook like/dislike/remove like button clicks to send votes to the API.
|
||||
|
@ -89,49 +97,40 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||
throw TextComponentAtomicReferenceFingerprint.exception
|
||||
}?.let { textComponentContextFingerprintResult ->
|
||||
val conversionContextIndex = textComponentContextFingerprintResult
|
||||
.scanResult.patternScanResult!!.startIndex
|
||||
.scanResult.patternScanResult!!.endIndex
|
||||
val atomicReferenceStartIndex = TextComponentAtomicReferenceFingerprint.result!!
|
||||
.scanResult.patternScanResult!!.startIndex
|
||||
|
||||
val insertIndex = atomicReferenceStartIndex + 6
|
||||
val insertIndex = atomicReferenceStartIndex + 9
|
||||
|
||||
textComponentContextFingerprintResult.mutableMethod.apply {
|
||||
// Get the conversion context obfuscated field name, and the registers for the AtomicReference and CharSequence
|
||||
// Get the conversion context obfuscated field name
|
||||
val conversionContextFieldReference =
|
||||
getInstruction<ReferenceInstruction>(conversionContextIndex).reference
|
||||
|
||||
// Reuse the free register to make room for the atomic reference register.
|
||||
// Free register to hold the conversion context
|
||||
val freeRegister =
|
||||
getInstruction<TwoRegisterInstruction>(atomicReferenceStartIndex).registerB
|
||||
|
||||
val atomicReferenceRegister =
|
||||
getInstruction<FiveRegisterInstruction>(atomicReferenceStartIndex + 1).registerC
|
||||
getInstruction<FiveRegisterInstruction>(atomicReferenceStartIndex + 6).registerC
|
||||
|
||||
val moveCharSequenceInstruction = getInstruction<TwoRegisterInstruction>(insertIndex - 1)
|
||||
// Instruction that is replaced, and also has the CharacterSequence register.
|
||||
val moveCharSequenceInstruction = getInstruction<TwoRegisterInstruction>(insertIndex)
|
||||
val charSequenceSourceRegister = moveCharSequenceInstruction.registerB
|
||||
val charSequenceTargetRegister = moveCharSequenceInstruction.registerA
|
||||
|
||||
// In order to preserve the atomic reference register, because it is overwritten,
|
||||
// use another free register to store it.
|
||||
replaceInstruction(
|
||||
atomicReferenceStartIndex + 2,
|
||||
"move-result-object v$freeRegister"
|
||||
)
|
||||
replaceInstruction(
|
||||
atomicReferenceStartIndex + 3,
|
||||
"move-object v$charSequenceSourceRegister, v$freeRegister"
|
||||
)
|
||||
|
||||
// Move the current instance to the free register, and get the conversion context from it.
|
||||
replaceInstruction(insertIndex - 1, "move-object/from16 v$freeRegister, p0")
|
||||
// Must replace the instruction to preserve the control flow label.
|
||||
replaceInstruction(insertIndex, "move-object/from16 v$freeRegister, p0")
|
||||
addInstructions(
|
||||
insertIndex,
|
||||
insertIndex + 1,
|
||||
"""
|
||||
# Move context to free register
|
||||
iget-object v$freeRegister, v$freeRegister, $conversionContextFieldReference
|
||||
iget-object v$freeRegister, v$freeRegister, $conversionContextFieldReference
|
||||
invoke-static {v$freeRegister, v$atomicReferenceRegister, v$charSequenceSourceRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->onLithoTextLoaded(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
||||
move-result-object v$freeRegister
|
||||
# Replace the original char sequence with the modified one.
|
||||
# Replace the original instruction
|
||||
move-object v${charSequenceTargetRegister}, v${freeRegister}
|
||||
"""
|
||||
)
|
||||
|
@ -140,7 +139,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||
|
||||
// endregion
|
||||
|
||||
// region Hook for Short videos.
|
||||
// region Hook for non litho Short videos.
|
||||
|
||||
ShortsTextViewFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
|
@ -150,7 +149,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||
val isDisLikesBooleanReference = getInstruction<ReferenceInstruction>(patternResult.endIndex).reference
|
||||
|
||||
val textViewFieldReference = // Like/Dislike button TextView field
|
||||
getInstruction<ReferenceInstruction>(patternResult.endIndex - 2).reference
|
||||
getInstruction<ReferenceInstruction>(patternResult.endIndex - 1).reference
|
||||
|
||||
// Check if the hooked TextView object is that of the dislike button.
|
||||
// If RYD is disabled, or the TextView object is not that of the dislike button, the execution flow is not interrupted.
|
||||
|
@ -180,6 +179,13 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||
|
||||
// endregion
|
||||
|
||||
// region Hook for litho Shorts
|
||||
|
||||
// Filter that parses the video id from the UI
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
// endregion
|
||||
|
||||
// region Hook old UI layout dislikes, for the older app spoofs used with spoof-app-version.
|
||||
|
||||
DislikesOldLayoutTextViewFingerprint.result?.let {
|
||||
|
|
|
@ -27,7 +27,6 @@ object ShortsTextViewFingerprint : MethodFingerprint(
|
|||
Opcode.IF_EQ,
|
||||
Opcode.RETURN_VOID,
|
||||
Opcode.IGET_OBJECT, // TextView field
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IGET_BOOLEAN, // boolean field
|
||||
)
|
||||
)
|
|
@ -13,13 +13,17 @@ object TextComponentAtomicReferenceFingerprint : MethodFingerprint(
|
|||
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
||||
parameters = listOf("L"),
|
||||
opcodes = listOf(
|
||||
Opcode.MOVE_OBJECT, // Register A and B is context, use B as context, reuse A as free register
|
||||
Opcode.MOVE_OBJECT, // Register B is free register
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.INVOKE_VIRTUAL, // Register C is atomic reference
|
||||
Opcode.MOVE_RESULT_OBJECT, // Register A is char sequence
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE, // Insert hook here
|
||||
Opcode.MOVE_OBJECT, // Replace this instruction with patch code
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
|
|
|
@ -13,12 +13,14 @@ object TextComponentContextFingerprint : MethodFingerprint(
|
|||
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
||||
parameters = listOf("L"),
|
||||
opcodes = listOf(
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.INVOKE_STATIC_RANGE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT, // conversion context field name
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.IGET,
|
||||
Opcode.IGET,
|
||||
Opcode.IGET,
|
||||
)
|
||||
)
|
|
@ -28,7 +28,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -45,7 +45,8 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
],
|
||||
|
|
|
@ -29,7 +29,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -24,7 +24,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -34,7 +34,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
)
|
||||
)
|
||||
]
|
||||
|
|
|
@ -26,7 +26,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -30,7 +30,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -25,7 +25,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -29,7 +29,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -29,7 +29,8 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -29,7 +29,8 @@ import app.revanced.util.microg.MicroGBytecodeHelper
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -35,7 +35,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -58,7 +58,7 @@ object PlayerControlsBytecodePatch : BytecodePatch(
|
|||
* @param descriptor The descriptor of the method which should be calleed.
|
||||
*/
|
||||
fun initializeControl(descriptor: String) {
|
||||
inflateFingerprintResult!!.mutableMethod.addInstruction(
|
||||
inflateFingerprintResult.mutableMethod.addInstruction(
|
||||
moveToRegisterInstructionIndex + 1,
|
||||
"invoke-static {v$viewRegister}, $descriptor"
|
||||
)
|
||||
|
|
|
@ -27,7 +27,8 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -37,7 +37,8 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -19,7 +19,8 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -29,7 +29,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||
"18.23.35",
|
||||
"18.29.38",
|
||||
"18.32.39",
|
||||
"18.37.36"
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue