mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-08 02:13:55 +01:00
Compare commits
15 Commits
v2.191.1-d
...
v2.193.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa0b788111 | ||
|
|
bd10651c3b | ||
|
|
2d65ef676d | ||
|
|
0424cea8f0 | ||
|
|
f5acbe4315 | ||
|
|
992d85ded8 | ||
|
|
f25d085d25 | ||
|
|
002cc9d810 | ||
|
|
2919eb26e6 | ||
|
|
3b5141d4b4 | ||
|
|
fd2daa37b1 | ||
|
|
9ff6f84642 | ||
|
|
9417b67e74 | ||
|
|
f41e657191 | ||
|
|
883f69ee9a |
56
CHANGELOG.md
56
CHANGELOG.md
@@ -1,3 +1,59 @@
|
|||||||
|
# [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)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Relay for Reddit - Spoof client:** Prevent OAuth login being disabled remotely ([a0aa2be](https://github.com/ReVanced/revanced-patches/commit/a0aa2be86d25aab2803901b4100fdc75461e94bc))
|
||||||
|
* Remove `dependencies` from generated JSON file ([79bb3e1](https://github.com/ReVanced/revanced-patches/commit/79bb3e164f84094c639ac9e567dc0a5ce70300bd))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **TikTok:** Constrain patches to last working version ([066023c](https://github.com/ReVanced/revanced-patches/commit/066023ca148b413b0848c0939e0bab2b3ff32b3a))
|
||||||
|
* **YouTube - Hide "Get YouTube Premium" advertisements:** Name patch correctly ([#3079](https://github.com/ReVanced/revanced-patches/issues/3079)) ([5c140ea](https://github.com/ReVanced/revanced-patches/commit/5c140ea38dc7b7da1efd4b98315fb401267b99f8))
|
||||||
|
|
||||||
|
# [2.192.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.192.0-dev.2...v2.192.0-dev.3) (2023-10-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Relay for Reddit - Spoof client:** Prevent OAuth login being disabled remotely ([a0aa2be](https://github.com/ReVanced/revanced-patches/commit/a0aa2be86d25aab2803901b4100fdc75461e94bc))
|
||||||
|
|
||||||
|
# [2.192.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.192.0-dev.1...v2.192.0-dev.2) (2023-10-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **TikTok:** Constrain patches to last working version ([066023c](https://github.com/ReVanced/revanced-patches/commit/066023ca148b413b0848c0939e0bab2b3ff32b3a))
|
||||||
|
|
||||||
|
# [2.192.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.191.1-dev.1...v2.192.0-dev.1) (2023-10-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube - Hide "Get YouTube Premium" advertisements:** Name patch correctly ([#3079](https://github.com/ReVanced/revanced-patches/issues/3079)) ([5c140ea](https://github.com/ReVanced/revanced-patches/commit/5c140ea38dc7b7da1efd4b98315fb401267b99f8))
|
||||||
|
|
||||||
## [2.191.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.191.0...v2.191.1-dev.1) (2023-10-05)
|
## [2.191.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.191.0...v2.191.1-dev.1) (2023-10-05)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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 = 2.191.1-dev.1
|
version = 2.193.0-dev.3
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[versions]
|
[versions]
|
||||||
revanced-patcher = "16.0.0"
|
revanced-patcher = "16.0.1"
|
||||||
revanced-patch-annotation-processor = "16.0.0"
|
revanced-patch-annotation-processor = "16.0.1"
|
||||||
ksp = "1.9.0-1.0.11"
|
ksp = "1.9.0-1.0.11"
|
||||||
smali = "3.0.3"
|
smali = "3.0.3"
|
||||||
guava = "32.1.2-jre"
|
guava = "32.1.2-jre"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -9,6 +9,9 @@ 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.reddit.customclients.AbstractSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.*
|
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.*
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction10t
|
||||||
|
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21t
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
@@ -28,7 +31,10 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
GetLoggedOutBearerTokenFingerprint,
|
GetLoggedOutBearerTokenFingerprint,
|
||||||
GetRefreshTokenFingerprint
|
GetRefreshTokenFingerprint
|
||||||
),
|
),
|
||||||
miscellaneousFingerprints = listOf(SetRemoteConfigFingerprint)
|
miscellaneousFingerprints = listOf(
|
||||||
|
SetRemoteConfigFingerprint,
|
||||||
|
RedditCheckDisableAPIFingerprint
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
forEach {
|
forEach {
|
||||||
@@ -44,7 +50,24 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun List<MethodFingerprintResult>.patchMiscellaneous(context: BytecodeContext) =
|
override fun List<MethodFingerprintResult>.patchMiscellaneous(context: BytecodeContext) {
|
||||||
// Do not load remote config which disables OAuth login remotely
|
// Do not load remote config which disables OAuth login remotely.
|
||||||
first().mutableMethod.addInstructions(0, "return-void")
|
first().mutableMethod.addInstructions(0, "return-void")
|
||||||
|
|
||||||
|
// Prevent OAuth login being disabled remotely.
|
||||||
|
last().let {
|
||||||
|
val checkIsOAuthRequestIndex = it.scanResult.patternScanResult!!.startIndex
|
||||||
|
|
||||||
|
it.mutableMethod.apply {
|
||||||
|
val returnNextChain = getInstruction<BuilderInstruction21t>(checkIsOAuthRequestIndex).target
|
||||||
|
replaceInstruction(
|
||||||
|
checkIsOAuthRequestIndex,
|
||||||
|
BuilderInstruction10t(
|
||||||
|
Opcode.GOTO,
|
||||||
|
returnNextChain
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
object RedditCheckDisableAPIFingerprint : MethodFingerprint(
|
||||||
|
strings = listOf("Reddit Disabled"),
|
||||||
|
opcodes = listOf(Opcode.IF_EQZ)
|
||||||
|
)
|
||||||
@@ -16,8 +16,8 @@ import app.revanced.patches.tiktok.interaction.downloads.fingerprints.ACLCommonS
|
|||||||
import app.revanced.patches.tiktok.interaction.downloads.fingerprints.ACLCommonShareFingerprint3
|
import app.revanced.patches.tiktok.interaction.downloads.fingerprints.ACLCommonShareFingerprint3
|
||||||
import app.revanced.patches.tiktok.interaction.downloads.fingerprints.DownloadPathParentFingerprint
|
import app.revanced.patches.tiktok.interaction.downloads.fingerprints.DownloadPathParentFingerprint
|
||||||
import app.revanced.patches.tiktok.misc.integrations.IntegrationsPatch
|
import app.revanced.patches.tiktok.misc.integrations.IntegrationsPatch
|
||||||
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsStatusLoadFingerprint
|
|
||||||
import app.revanced.patches.tiktok.misc.settings.SettingsPatch
|
import app.revanced.patches.tiktok.misc.settings.SettingsPatch
|
||||||
|
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsStatusLoadFingerprint
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
@@ -28,8 +28,8 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
|||||||
description = "Removes download restrictions and changes the default path to download to.",
|
description = "Removes download restrictions and changes the default path to download to.",
|
||||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage("com.ss.android.ugc.trill"),
|
CompatiblePackage("com.ss.android.ugc.trill", ["30.8.4"]),
|
||||||
CompatiblePackage("com.zhiliaoapp.musically")
|
CompatiblePackage("com.zhiliaoapp.musically", ["30.8.4"])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
|||||||
description = "Adds ReVanced settings to TikTok.",
|
description = "Adds ReVanced settings to TikTok.",
|
||||||
dependencies = [IntegrationsPatch::class],
|
dependencies = [IntegrationsPatch::class],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage("com.ss.android.ugc.trill"),
|
CompatiblePackage("com.ss.android.ugc.trill", ["30.8.4"]),
|
||||||
CompatiblePackage("com.zhiliaoapp.musically")
|
CompatiblePackage("com.zhiliaoapp.musically", ["30.8.4"])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
object SettingsPatch : BytecodePatch(
|
object SettingsPatch : BytecodePatch(
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Hide get premium",
|
name = "Hide \"Get YouTube Premium\" advertisements",
|
||||||
|
description = "Hides YouTube Premium advertisements under video player.",
|
||||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage(
|
CompatiblePackage(
|
||||||
@@ -41,7 +42,7 @@ object HideGetPremiumPatch : BytecodePatch(setOf(GetPremiumViewFingerprint)) {
|
|||||||
"revanced_hide_get_premium",
|
"revanced_hide_get_premium",
|
||||||
StringResource(
|
StringResource(
|
||||||
"revanced_hide_get_premium_title",
|
"revanced_hide_get_premium_title",
|
||||||
"Hide YouTube premium advertisement"
|
"Hide \"Get YouTube Premium\" advertisements"
|
||||||
),
|
),
|
||||||
StringResource(
|
StringResource(
|
||||||
"revanced_hide_get_premium_summary_on",
|
"revanced_hide_get_premium_summary_on",
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
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"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
@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.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.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.OnTouchEventHandlerFingerprint
|
||||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SeekbarTappingFingerprint
|
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SeekbarTappingFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
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.ReferenceInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
||||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
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",
|
name = "Seekbar tapping",
|
||||||
description = "Enables tap-to-seek on the seekbar of the video player.",
|
description = "Enables tap-to-seek on the seekbar of the video player.",
|
||||||
dependencies = [
|
dependencies = [
|
||||||
IntegrationsPatch::class,
|
IntegrationsPatch::class, SettingsPatch::class],
|
||||||
EnableSeekbarTappingResourcePatch::class
|
|
||||||
],
|
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage(
|
CompatiblePackage(
|
||||||
"com.google.android.youtube",
|
"com.google.android.youtube",
|
||||||
@@ -45,6 +46,15 @@ object EnableSeekbarTappingPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext) {
|
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.
|
// Find the required methods to tap the seekbar.
|
||||||
val seekbarTappingMethods = OnTouchEventHandlerFingerprint.result?.let {
|
val seekbarTappingMethods = OnTouchEventHandlerFingerprint.result?.let {
|
||||||
val patternScanResult = it.scanResult.patternScanResult!!
|
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)
|
||||||
|
)
|
||||||
@@ -38,6 +38,12 @@ object HideShortsComponentsResourcePatch : ResourcePatch() {
|
|||||||
StringResource("revanced_hide_shorts_subscribe_button_on", "Subscribe button is hidden"),
|
StringResource("revanced_hide_shorts_subscribe_button_on", "Subscribe button is hidden"),
|
||||||
StringResource("revanced_hide_shorts_subscribe_button_off", "Subscribe button is shown")
|
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(
|
SwitchPreference(
|
||||||
"revanced_hide_shorts_thanks_button",
|
"revanced_hide_shorts_thanks_button",
|
||||||
StringResource("revanced_hide_shorts_thanks_button_title", "Hide thanks button"),
|
StringResource("revanced_hide_shorts_thanks_button_title", "Hide thanks button"),
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ 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.youtube.layout.returnyoutubedislike.fingerprints.*
|
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.*
|
||||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
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.misc.playertype.PlayerTypeHookPatch
|
||||||
import app.revanced.patches.youtube.video.videoid.VideoIdPatch
|
import app.revanced.patches.youtube.video.videoid.VideoIdPatch
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
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.",
|
description = "Shows the dislike count of videos using the Return YouTube Dislike API.",
|
||||||
dependencies = [
|
dependencies = [
|
||||||
IntegrationsPatch::class,
|
IntegrationsPatch::class,
|
||||||
|
LithoFilterPatch::class,
|
||||||
VideoIdPatch::class,
|
VideoIdPatch::class,
|
||||||
ReturnYouTubeDislikeResourcePatch::class,
|
ReturnYouTubeDislikeResourcePatch::class,
|
||||||
PlayerTypeHookPatch::class,
|
PlayerTypeHookPatch::class,
|
||||||
],
|
],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage("com.google.android.youtube", ["18.32.39"])
|
CompatiblePackage("com.google.android.youtube", ["18.37.36"])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@@ -48,11 +50,17 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||||
"Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;"
|
"Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;"
|
||||||
|
|
||||||
|
private const val FILTER_CLASS_DESCRIPTOR =
|
||||||
|
"Lapp/revanced/integrations/patches/components/ReturnYouTubeDislikeFilterPatch;"
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
// region Inject newVideoLoaded event handler to update dislikes when a new video is loaded.
|
// region Inject newVideoLoaded event handler to update dislikes when a new video is loaded.
|
||||||
|
|
||||||
VideoIdPatch.hookVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->newVideoLoaded(Ljava/lang/String;)V")
|
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
|
// endregion
|
||||||
|
|
||||||
// region Hook like/dislike/remove like button clicks to send votes to the API.
|
// region Hook like/dislike/remove like button clicks to send votes to the API.
|
||||||
@@ -89,49 +97,40 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
throw TextComponentAtomicReferenceFingerprint.exception
|
throw TextComponentAtomicReferenceFingerprint.exception
|
||||||
}?.let { textComponentContextFingerprintResult ->
|
}?.let { textComponentContextFingerprintResult ->
|
||||||
val conversionContextIndex = textComponentContextFingerprintResult
|
val conversionContextIndex = textComponentContextFingerprintResult
|
||||||
.scanResult.patternScanResult!!.startIndex
|
.scanResult.patternScanResult!!.endIndex
|
||||||
val atomicReferenceStartIndex = TextComponentAtomicReferenceFingerprint.result!!
|
val atomicReferenceStartIndex = TextComponentAtomicReferenceFingerprint.result!!
|
||||||
.scanResult.patternScanResult!!.startIndex
|
.scanResult.patternScanResult!!.startIndex
|
||||||
|
|
||||||
val insertIndex = atomicReferenceStartIndex + 6
|
val insertIndex = atomicReferenceStartIndex + 9
|
||||||
|
|
||||||
textComponentContextFingerprintResult.mutableMethod.apply {
|
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 =
|
val conversionContextFieldReference =
|
||||||
getInstruction<ReferenceInstruction>(conversionContextIndex).reference
|
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 =
|
val freeRegister =
|
||||||
getInstruction<TwoRegisterInstruction>(atomicReferenceStartIndex).registerB
|
getInstruction<TwoRegisterInstruction>(atomicReferenceStartIndex).registerB
|
||||||
|
|
||||||
val atomicReferenceRegister =
|
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 charSequenceSourceRegister = moveCharSequenceInstruction.registerB
|
||||||
val charSequenceTargetRegister = moveCharSequenceInstruction.registerA
|
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.
|
// 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(
|
addInstructions(
|
||||||
insertIndex,
|
insertIndex + 1,
|
||||||
"""
|
"""
|
||||||
# Move context to free register
|
# 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;
|
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
|
move-result-object v$freeRegister
|
||||||
# Replace the original char sequence with the modified one.
|
# Replace the original instruction
|
||||||
move-object v${charSequenceTargetRegister}, v${freeRegister}
|
move-object v${charSequenceTargetRegister}, v${freeRegister}
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
@@ -140,7 +139,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region Hook for Short videos.
|
// region Hook for non litho Short videos.
|
||||||
|
|
||||||
ShortsTextViewFingerprint.result?.let {
|
ShortsTextViewFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
@@ -150,7 +149,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
val isDisLikesBooleanReference = getInstruction<ReferenceInstruction>(patternResult.endIndex).reference
|
val isDisLikesBooleanReference = getInstruction<ReferenceInstruction>(patternResult.endIndex).reference
|
||||||
|
|
||||||
val textViewFieldReference = // Like/Dislike button TextView field
|
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.
|
// 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.
|
// 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
|
// 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.
|
// region Hook old UI layout dislikes, for the older app spoofs used with spoof-app-version.
|
||||||
|
|
||||||
DislikesOldLayoutTextViewFingerprint.result?.let {
|
DislikesOldLayoutTextViewFingerprint.result?.let {
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ object ShortsTextViewFingerprint : MethodFingerprint(
|
|||||||
Opcode.IF_EQ,
|
Opcode.IF_EQ,
|
||||||
Opcode.RETURN_VOID,
|
Opcode.RETURN_VOID,
|
||||||
Opcode.IGET_OBJECT, // TextView field
|
Opcode.IGET_OBJECT, // TextView field
|
||||||
Opcode.CHECK_CAST,
|
|
||||||
Opcode.IGET_BOOLEAN, // boolean field
|
Opcode.IGET_BOOLEAN, // boolean field
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -13,13 +13,17 @@ object TextComponentAtomicReferenceFingerprint : MethodFingerprint(
|
|||||||
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
||||||
parameters = listOf("L"),
|
parameters = listOf("L"),
|
||||||
opcodes = listOf(
|
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.INVOKE_VIRTUAL, // Register C is atomic reference
|
||||||
Opcode.MOVE_RESULT_OBJECT, // Register A is char sequence
|
Opcode.MOVE_RESULT_OBJECT, // Register A is char sequence
|
||||||
Opcode.MOVE_OBJECT,
|
|
||||||
Opcode.CHECK_CAST,
|
Opcode.CHECK_CAST,
|
||||||
Opcode.MOVE_OBJECT,
|
Opcode.MOVE_OBJECT, // Replace this instruction with patch code
|
||||||
Opcode.INVOKE_INTERFACE, // Insert hook here
|
Opcode.INVOKE_INTERFACE,
|
||||||
Opcode.MOVE_RESULT,
|
Opcode.MOVE_RESULT,
|
||||||
Opcode.IF_EQZ,
|
Opcode.IF_EQZ,
|
||||||
Opcode.INVOKE_INTERFACE,
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
|||||||
@@ -13,12 +13,14 @@ object TextComponentContextFingerprint : MethodFingerprint(
|
|||||||
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
||||||
parameters = listOf("L"),
|
parameters = listOf("L"),
|
||||||
opcodes = listOf(
|
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, // conversion context field name
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.IGET_BOOLEAN,
|
|
||||||
Opcode.IGET,
|
|
||||||
Opcode.IGET,
|
|
||||||
Opcode.IGET,
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
Reference in New Issue
Block a user