Compare commits

...

22 Commits

Author SHA1 Message Date
semantic-release-bot
2fe71a18ea chore(release): 2.193.0-dev.5 [skip ci]
# [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)) ([b4d33a1](b4d33a1dcf))
2023-10-08 01:25:15 +00:00
Pun Butrach
5b6e015e64 docs: Update social media links (#3091) 2023-10-08 03:22:17 +02:00
LisoUseInAIKyrios
b4d33a1dcf fix: Consolidate patches (#3098) 2023-10-08 03:21:28 +02:00
semantic-release-bot
ecb92d3f68 chore(release): 2.193.0-dev.4 [skip ci]
# [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 ([07d98ab](07d98ab3f7))
* **Infinity for Reddit - Spoof client:** Set user-agent for OAuth requests to fix login ([caf1e6b](caf1e6b211))
* **Sync for Reddit - Spoof client:** Set user-agent for OAuth requests to fix login ([5bd5f87](5bd5f87315))
2023-10-08 01:00:51 +00:00
oSumAtrIX
caf1e6b211 fix(Infinity for Reddit - Spoof client): Set user-agent for OAuth requests to fix login 2023-10-08 02:56:30 +02:00
oSumAtrIX
07d98ab3f7 fix(Boost for Reddit - Spoof client): Set user-agent for OAuth requests to fix login 2023-10-08 02:56:23 +02:00
oSumAtrIX
5bd5f87315 fix(Sync for Reddit - Spoof client): Set user-agent for OAuth requests to fix login 2023-10-08 02:56:08 +02:00
semantic-release-bot
fa0b788111 chore(release): 2.193.0-dev.3 [skip ci]
# [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)) ([bd10651](bd10651c3b))
2023-10-07 09:35:06 +00:00
oSumAtrIX
bd10651c3b feat(YouTube - Return YouTube Dislike): Support version 18.37.36 (#3061)
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
2023-10-07 13:31:35 +04:00
semantic-release-bot
2d65ef676d chore(release): 2.193.0-dev.2 [skip ci]
# [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 ([0424cea](0424cea8f0))
2023-10-07 01:54:21 +00:00
oSumAtrIX
0424cea8f0 feat(YouTube): Add Disable fine scrubbing gesture patch 2023-10-07 03:50:42 +02:00
semantic-release-bot
f5acbe4315 chore(release): 2.193.0-dev.1 [skip ci]
# [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 ([992d85d](992d85ded8))
2023-10-05 16:52:40 +00:00
oSumAtrIX
992d85ded8 feat(YouTube - Hide shorts components): Hide subscribe button when paused separately from subscribe button 2023-10-05 18:49:07 +02:00
semantic-release-bot
f25d085d25 chore(release): 2.192.0 [skip ci]
# [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 ([fd2daa3](fd2daa37b1))
* Remove `dependencies` from generated JSON file ([23dec85](23dec85068))

### Features

* **TikTok:** Constrain patches to last working version ([9417b67](9417b67e74))
* **YouTube - Hide "Get YouTube Premium" advertisements:** Name patch correctly ([#3079](https://github.com/ReVanced/revanced-patches/issues/3079)) ([883f69e](883f69ee9a))
2023-10-05 16:18:54 +00:00
oSumAtrIX
002cc9d810 chore: Merge branch dev to main (#3074) 2023-10-05 18:15:56 +02:00
semantic-release-bot
2919eb26e6 chore(release): 2.192.0-dev.3 [skip ci]
# [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 ([fd2daa3](fd2daa37b1))
2023-10-05 15:36:49 +00:00
oSumAtrIX
3b5141d4b4 build: Bump dependencies 2023-10-05 17:32:57 +02:00
oSumAtrIX
fd2daa37b1 fix(Relay for Reddit - Spoof client): Prevent OAuth login being disabled remotely 2023-10-05 17:28:10 +02:00
semantic-release-bot
9ff6f84642 chore(release): 2.192.0-dev.2 [skip ci]
# [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 ([9417b67](9417b67e74))
2023-10-05 14:35:30 +00:00
oSumAtrIX
9417b67e74 feat(TikTok): Constrain patches to last working version 2023-10-05 16:32:31 +02:00
semantic-release-bot
f41e657191 chore(release): 2.192.0-dev.1 [skip ci]
# [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)) ([883f69e](883f69ee9a))
2023-10-05 03:08:38 +00:00
KobeW50
883f69ee9a feat(YouTube - Hide "Get YouTube Premium" advertisements): Name patch correctly (#3079)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-10-05 05:05:50 +02:00
27 changed files with 364 additions and 87 deletions

View File

@@ -1,3 +1,75 @@
# [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)
### 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)

View File

@@ -28,12 +28,15 @@
<a href="https://t.me/app_revanced"> <a href="https://t.me/app_revanced">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" /> <img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</a>&nbsp;&nbsp;&nbsp; </a>&nbsp;&nbsp;&nbsp;
<a href="https://twitter.com/revancedapp"> <a href="https://x.com/revancedapp">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032018-6da37214-7474-4641-a1da-7af7db3a31cd.png" /> <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>&nbsp;&nbsp;&nbsp; </a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced"> <a href="https://www.youtube.com/@ReVanced">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" /> <img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</a>&nbsp;&nbsp;&nbsp; </a>
<br> <br>
<br> <br>
Continuing the legacy of Vanced Continuing the legacy of Vanced

View File

@@ -28,18 +28,20 @@
<a href="https://t.me/app_revanced"> <a href="https://t.me/app_revanced">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" /> <img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</a>&nbsp;&nbsp;&nbsp; </a>&nbsp;&nbsp;&nbsp;
<a href="https://twitter.com/revancedapp"> <a href="https://x.com/revancedapp">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032018-6da37214-7474-4641-a1da-7af7db3a31cd.png" /> <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>&nbsp;&nbsp;&nbsp; </a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced"> <a href="https://www.youtube.com/@ReVanced">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" /> <img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</a>&nbsp;&nbsp;&nbsp; </a>
<br> <br>
<br> <br>
Continuing the legacy of Vanced Continuing the legacy of Vanced
</p> </p>
# 🧩 ReVanced Patches # 🧩 ReVanced Patches
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-patches/release.yml) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-patches/release.yml)

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 = 2.191.1-dev.1 version = 2.193.0-dev.5

View File

@@ -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

View File

@@ -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"
}

View File

@@ -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.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.Constants.OAUTH_USER_AGENT
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.LoginActivityOnCreateFingerprint
@Patch( @Patch(
name = "Spoof client", name = "Spoof client",
@@ -15,7 +17,9 @@ import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints
) )
@Suppress("unused") @Suppress("unused")
object SpoofClientPatch : AbstractSpoofClientPatch( object SpoofClientPatch : AbstractSpoofClientPatch(
"http://rubenmayayo.com", listOf(GetClientIdFingerprint) "http://rubenmayayo.com",
clientIdFingerprints = listOf(GetClientIdFingerprint),
userAgentFingerprints = listOf(LoginActivityOnCreateFingerprint)
) { ) {
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) { override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
first().mutableMethod.addInstructions( 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
"""
)
}
}
}
} }

View File

@@ -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;")
}
)

View File

@@ -1,14 +1,17 @@
package app.revanced.patches.reddit.customclients.infinityforreddit.api package app.revanced.patches.reddit.customclients.infinityforreddit.api
import app.revanced.patcher.data.BytecodeContext 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.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
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.reddit.customclients.AbstractSpoofClientPatch 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.GetHttpBasicAuthHeaderFingerprint
import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.LoginActivityOnCreateFingerprint 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 import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@Patch( @Patch(
@@ -32,7 +35,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@Suppress("unused") @Suppress("unused")
object SpoofClientPatch : AbstractSpoofClientPatch( object SpoofClientPatch : AbstractSpoofClientPatch(
"infinity://localhost", "infinity://localhost",
listOf(GetHttpBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint) clientIdFingerprints = listOf(GetHttpBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint),
userAgentFingerprints = listOf(SetWebViewSettingsFingerprint)
) { ) {
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) { override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
forEach { 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
"""
)
}
}
} }

View File

@@ -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")
)

View File

@@ -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
)
)
}
}
}
} }

View File

@@ -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)
)

View File

@@ -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.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.Constants.OAUTH_USER_AGENT
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetAuthorizationStringFingerprint 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.GetBearerTokenFingerprint
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.ImgurImageAPIFingerprint 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 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.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
@@ -33,6 +35,7 @@ import java.util.*
object SpoofClientPatch : AbstractSpoofClientPatch( object SpoofClientPatch : AbstractSpoofClientPatch(
"http://redditsync/auth", "http://redditsync/auth",
clientIdFingerprints = listOf(GetAuthorizationStringFingerprint), clientIdFingerprints = listOf(GetAuthorizationStringFingerprint),
userAgentFingerprints = listOf(LoadBrowserURLFingerprint),
miscellaneousFingerprints = listOf(ImgurImageAPIFingerprint) miscellaneousFingerprints = listOf(ImgurImageAPIFingerprint)
) { ) {
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) { override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
@@ -79,4 +82,18 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
"const-string v1, \"https://api.imgur.com/3/image\"" "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
"""
)
}
}
} }

View File

@@ -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")
)

View File

@@ -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")

View File

@@ -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(

View File

@@ -15,7 +15,7 @@ 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", description = "Hides YouTube Premium signup promotions under the video player.",
dependencies = [IntegrationsPatch::class, SettingsPatch::class], dependencies = [IntegrationsPatch::class, SettingsPatch::class],
compatiblePackages = [ compatiblePackages = [
CompatiblePackage( CompatiblePackage(
@@ -41,15 +41,15 @@ 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 YouTube Premium promotions"
), ),
StringResource( StringResource(
"revanced_hide_get_premium_summary_on", "revanced_hide_get_premium_summary_on",
"YouTube Premium advertisements under video player are hidden" "YouTube Premium promotions under video player is hidden"
), ),
StringResource( StringResource(
"revanced_hide_get_premium_summary_off", "revanced_hide_get_premium_summary_off",
"YouTube Premium advertisements under video player are shown" "YouTube Premium promotions under video player is shown"
) )
) )
) )

View File

@@ -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
}
}

View File

@@ -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!!

View File

@@ -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")
)
)
}
}

View File

@@ -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)
)

View File

@@ -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"),

View File

@@ -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 {

View File

@@ -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
) )
) )

View File

@@ -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,

View File

@@ -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,
) )
) )