mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-19 09:03:58 +00:00
Compare commits
13 Commits
v4.8.3-dev
...
v4.9.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad07efbd4a | ||
|
|
ea1deb630e | ||
|
|
9f116422d2 | ||
|
|
367a83accd | ||
|
|
54d671dd3e | ||
|
|
d925e7f2e8 | ||
|
|
de18cdcc12 | ||
|
|
19d1503594 | ||
|
|
62b1adfde1 | ||
|
|
78b9716a76 | ||
|
|
33ea424c37 | ||
|
|
7bd9cabf5a | ||
|
|
7946d503db |
38
CHANGELOG.md
38
CHANGELOG.md
@@ -1,3 +1,41 @@
|
|||||||
|
# [4.9.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v4.9.0-dev.1...v4.9.0-dev.2) (2024-06-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Spoof client:** Allow swipe gestures to enter/exit fullscreen when spoofing with `Android VR` client ([#3259](https://github.com/ReVanced/revanced-patches/issues/3259)) ([5114900](https://github.com/ReVanced/revanced-patches/commit/5114900b1b5572c04ba6759eedab77f0a934b058))
|
||||||
|
|
||||||
|
# [4.9.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v4.8.3...v4.9.0-dev.1) (2024-05-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube - Hide layout components:** Disable like / subscribe button glow animation ([#3265](https://github.com/ReVanced/revanced-patches/issues/3265)) ([68d35ea](https://github.com/ReVanced/revanced-patches/commit/68d35eafc15513c23cd5220260023e7ec5b7978a))
|
||||||
|
|
||||||
|
## [4.8.3](https://github.com/ReVanced/revanced-patches/compare/v4.8.2...v4.8.3) (2024-05-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **3rd-party Reddit apps:** Spoof user agent to work around Reddit API issues ([#3253](https://github.com/ReVanced/revanced-patches/issues/3253)) ([495e6d6](https://github.com/ReVanced/revanced-patches/commit/495e6d65e7cbae88baa71f8334b9afcf9819deaf))
|
||||||
|
* **Reddit - Hide ads:** Constrain to last working version 2024.17.0 ([#3192](https://github.com/ReVanced/revanced-patches/issues/3192)) ([4fb3456](https://github.com/ReVanced/revanced-patches/commit/4fb3456e93ff7ec19030de8870e1cb9c1319faef))
|
||||||
|
* **YouTube - Spoof client:** Clarify that only enter/exit fullscreen gesture does not work with Android VR spoof ([#3243](https://github.com/ReVanced/revanced-patches/issues/3243)) ([06d8f55](https://github.com/ReVanced/revanced-patches/commit/06d8f55e9b6ce27d8c550f202615689ac9c34cfa))
|
||||||
|
* **YouTube - Spoof client:** Improve Android spoofing ([#3230](https://github.com/ReVanced/revanced-patches/issues/3230)) ([b688923](https://github.com/ReVanced/revanced-patches/commit/b688923c7e83805f2377a19b20a969b8cb749a9c))
|
||||||
|
|
||||||
|
## [4.8.3-dev.4](https://github.com/ReVanced/revanced-patches/compare/v4.8.3-dev.3...v4.8.3-dev.4) (2024-05-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **3rd-party Reddit apps:** Spoof user agent to work around Reddit API issues ([#3253](https://github.com/ReVanced/revanced-patches/issues/3253)) ([495e6d6](https://github.com/ReVanced/revanced-patches/commit/495e6d65e7cbae88baa71f8334b9afcf9819deaf))
|
||||||
|
|
||||||
|
## [4.8.3-dev.3](https://github.com/ReVanced/revanced-patches/compare/v4.8.3-dev.2...v4.8.3-dev.3) (2024-05-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Reddit - Hide ads:** Constrain to last working version 2024.17.0 ([#3192](https://github.com/ReVanced/revanced-patches/issues/3192)) ([4fb3456](https://github.com/ReVanced/revanced-patches/commit/4fb3456e93ff7ec19030de8870e1cb9c1319faef))
|
||||||
|
|
||||||
## [4.8.3-dev.2](https://github.com/ReVanced/revanced-patches/compare/v4.8.3-dev.1...v4.8.3-dev.2) (2024-05-30)
|
## [4.8.3-dev.2](https://github.com/ReVanced/revanced-patches/compare/v4.8.3-dev.1...v4.8.3-dev.2) (2024-05-30)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -555,6 +555,7 @@ public final class app/revanced/patches/reddit/customclients/baconreader/api/Spo
|
|||||||
public final class app/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/BaseSpoofClientPatch {
|
public final class app/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/BaseSpoofClientPatch {
|
||||||
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch;
|
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch;
|
||||||
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
|
public fun patchUserAgent (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/reddit/customclients/infinityforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/BaseSpoofClientPatch {
|
public final class app/revanced/patches/reddit/customclients/infinityforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/BaseSpoofClientPatch {
|
||||||
@@ -577,6 +578,11 @@ public final class app/revanced/patches/reddit/customclients/joeyforreddit/ads/D
|
|||||||
public final class app/revanced/patches/reddit/customclients/joeyforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/BaseSpoofClientPatch {
|
public final class app/revanced/patches/reddit/customclients/joeyforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/BaseSpoofClientPatch {
|
||||||
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/joeyforreddit/api/SpoofClientPatch;
|
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/joeyforreddit/api/SpoofClientPatch;
|
||||||
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
|
public fun patchUserAgent (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/reddit/customclients/joeyforreddit/api/fingerprints/AuthUtilityUserAgent : app/revanced/patcher/fingerprint/MethodFingerprint {
|
||||||
|
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/joeyforreddit/api/fingerprints/AuthUtilityUserAgent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/reddit/customclients/joeyforreddit/detection/piracy/DisablePiracyDetectionPatch : app/revanced/patcher/patch/BytecodePatch {
|
public final class app/revanced/patches/reddit/customclients/joeyforreddit/detection/piracy/DisablePiracyDetectionPatch : app/revanced/patcher/patch/BytecodePatch {
|
||||||
@@ -621,6 +627,7 @@ public final class app/revanced/patches/reddit/customclients/syncforreddit/api/S
|
|||||||
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/syncforreddit/api/SpoofClientPatch;
|
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/syncforreddit/api/SpoofClientPatch;
|
||||||
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
public fun patchMiscellaneous (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
public fun patchMiscellaneous (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
|
public fun patchUserAgent (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/reddit/customclients/syncforreddit/detection/piracy/DisablePiracyDetectionPatch : app/revanced/patcher/patch/BytecodePatch {
|
public final class app/revanced/patches/reddit/customclients/syncforreddit/detection/piracy/DisablePiracyDetectionPatch : app/revanced/patcher/patch/BytecodePatch {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 4.8.3-dev.2
|
version = 4.9.0-dev.2
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
[versions]
|
[versions]
|
||||||
revanced-patcher = "19.3.1"
|
revanced-patcher = "19.3.1"
|
||||||
smali = "3.0.7"
|
#noinspection GradleDependency
|
||||||
|
smali = "3.0.5" # 3.0.7 breaks binary compatibility. Tracking https://github.com/google/smali/issues/58.
|
||||||
guava = "33.1.0-jre"
|
guava = "33.1.0-jre"
|
||||||
gson = "2.10.1"
|
gson = "2.10.1"
|
||||||
binary-compatibility-validator = "0.14.0"
|
binary-compatibility-validator = "0.14.0"
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import app.revanced.patcher.data.ResourceContext
|
|||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
|
|
||||||
|
// Note that for now, this patch and anything using it will only work on
|
||||||
|
// Reddit 2024.17.0 or older. Newer versions will crash during patching.
|
||||||
|
// See https://github.com/ReVanced/revanced-patches/issues/3099
|
||||||
@Patch(description = "Hides banner ads from comments on subreddits.")
|
@Patch(description = "Hides banner ads from comments on subreddits.")
|
||||||
object HideBannerPatch : ResourcePatch() {
|
object HideBannerPatch : ResourcePatch() {
|
||||||
private const val RESOURCE_FILE_PATH = "res/layout/merge_listheader_link_detail.xml"
|
private const val RESOURCE_FILE_PATH = "res/layout/merge_listheader_link_detail.xml"
|
||||||
|
|||||||
@@ -20,7 +20,12 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||||||
@Patch(
|
@Patch(
|
||||||
name = "Hide ads",
|
name = "Hide ads",
|
||||||
dependencies = [HideBannerPatch::class, HideCommentAdsPatch::class],
|
dependencies = [HideBannerPatch::class, HideCommentAdsPatch::class],
|
||||||
compatiblePackages = [CompatiblePackage("com.reddit.frontpage")],
|
// Note that for now, this patch and anything using it will only work on
|
||||||
|
// Reddit 2024.17.0 or older. Newer versions will crash during patching.
|
||||||
|
// See https://github.com/ReVanced/revanced-patches/issues/3099
|
||||||
|
// and https://github.com/iBotPeaches/Apktool/issues/3534.
|
||||||
|
// This constraint is necessary due to dependency on HideBannerPatch.
|
||||||
|
compatiblePackages = [CompatiblePackage("com.reddit.frontpage", ["2024.17.0"])],
|
||||||
requiresIntegrations = true,
|
requiresIntegrations = true,
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
|
|||||||
@@ -4,16 +4,15 @@ import app.revanced.patcher.data.BytecodeContext
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.fingerprint.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.MethodFingerprintResult
|
||||||
import app.revanced.patches.reddit.customclients.BaseSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.BaseSpoofClientPatch
|
||||||
|
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.BuildUserAgentFingerprint
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object SpoofClientPatch : BaseSpoofClientPatch(
|
object SpoofClientPatch : BaseSpoofClientPatch(
|
||||||
redirectUri = "http://rubenmayayo.com",
|
redirectUri = "http://rubenmayayo.com",
|
||||||
clientIdFingerprints = setOf(GetClientIdFingerprint),
|
clientIdFingerprints = setOf(GetClientIdFingerprint),
|
||||||
userAgentFingerprints = setOf(LoginActivityOnCreateFingerprint),
|
userAgentFingerprints = setOf(BuildUserAgentFingerprint),
|
||||||
compatiblePackages = setOf(CompatiblePackage("com.rubenmayayo.reddit"))
|
compatiblePackages = setOf(CompatiblePackage("com.rubenmayayo.reddit")),
|
||||||
) {
|
) {
|
||||||
override fun Set<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
override fun Set<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
first().mutableMethod.addInstructions(
|
first().mutableMethod.addInstructions(
|
||||||
@@ -21,7 +20,18 @@ object SpoofClientPatch : BaseSpoofClientPatch(
|
|||||||
"""
|
"""
|
||||||
const-string v0, "$clientId"
|
const-string v0, "$clientId"
|
||||||
return-object v0
|
return-object v0
|
||||||
"""
|
""",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun Set<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
|
||||||
|
// Use a random number as the platform in the user agent string.
|
||||||
|
val platformName = (0..100000).random()
|
||||||
|
val platformParameter = 0
|
||||||
|
|
||||||
|
first().mutableMethod.addInstructions(
|
||||||
|
0,
|
||||||
|
"const-string p$platformParameter, \"$platformName\"",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
|
||||||
|
internal object BuildUserAgentFingerprint : MethodFingerprint(
|
||||||
|
strings = listOf("%s:%s:%s (by /u/%s)"),
|
||||||
|
)
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
|
||||||
|
|
||||||
internal object LoginActivityOnCreateFingerprint : MethodFingerprint(
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.CONST_4
|
|
||||||
),
|
|
||||||
customFingerprint = { method, classDef ->
|
|
||||||
method.name == "onCreate" && classDef.type.endsWith("LoginActivity;")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -2,8 +2,10 @@ package app.revanced.patches.reddit.customclients.joeyforreddit.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.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
import app.revanced.patcher.fingerprint.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.MethodFingerprintResult
|
||||||
import app.revanced.patches.reddit.customclients.BaseSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.BaseSpoofClientPatch
|
||||||
|
import app.revanced.patches.reddit.customclients.joeyforreddit.api.fingerprints.AuthUtilityUserAgent
|
||||||
import app.revanced.patches.reddit.customclients.joeyforreddit.api.fingerprints.GetClientIdFingerprint
|
import app.revanced.patches.reddit.customclients.joeyforreddit.api.fingerprints.GetClientIdFingerprint
|
||||||
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.DisablePiracyDetectionPatch
|
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.DisablePiracyDetectionPatch
|
||||||
|
|
||||||
@@ -12,6 +14,7 @@ import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.
|
|||||||
object SpoofClientPatch : BaseSpoofClientPatch(
|
object SpoofClientPatch : BaseSpoofClientPatch(
|
||||||
redirectUri = "https://127.0.0.1:65023/authorize_callback",
|
redirectUri = "https://127.0.0.1:65023/authorize_callback",
|
||||||
clientIdFingerprints = setOf(GetClientIdFingerprint),
|
clientIdFingerprints = setOf(GetClientIdFingerprint),
|
||||||
|
userAgentFingerprints = setOf(AuthUtilityUserAgent),
|
||||||
compatiblePackages = setOf(
|
compatiblePackages = setOf(
|
||||||
CompatiblePackage("o.o.joey"),
|
CompatiblePackage("o.o.joey"),
|
||||||
CompatiblePackage("o.o.joey.pro"),
|
CompatiblePackage("o.o.joey.pro"),
|
||||||
@@ -28,4 +31,18 @@ object SpoofClientPatch : BaseSpoofClientPatch(
|
|||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun Set<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
|
||||||
|
// Use a random user agent.
|
||||||
|
val randomName = (0..100000).random()
|
||||||
|
val userAgent = "$randomName:app.revanced.$randomName:v1.0.0 (by /u/revanced)"
|
||||||
|
|
||||||
|
first().mutableMethod.replaceInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const-string v0, "$userAgent"
|
||||||
|
return-object v0
|
||||||
|
""",
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.joeyforreddit.api.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
object AuthUtilityUserAgent : MethodFingerprint(
|
||||||
|
returnType = "Ljava/lang/String;",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
|
opcodes = listOf(Opcode.APUT_OBJECT),
|
||||||
|
customFingerprint = { _, classDef ->
|
||||||
|
classDef.sourceFile == "AuthUtility.java"
|
||||||
|
},
|
||||||
|
)
|
||||||
@@ -1,18 +1,16 @@
|
|||||||
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy
|
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy
|
||||||
|
|
||||||
import app.revanced.util.exception
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
||||||
|
import app.revanced.util.exception
|
||||||
|
|
||||||
object DisablePiracyDetectionPatch : BytecodePatch(setOf(PiracyDetectionFingerprint)) {
|
object DisablePiracyDetectionPatch : BytecodePatch(setOf(PiracyDetectionFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
PiracyDetectionFingerprint.result?.mutableMethod?.addInstruction(
|
PiracyDetectionFingerprint.result?.mutableMethod?.addInstruction(
|
||||||
0,
|
0,
|
||||||
"""
|
"return-void",
|
||||||
return-void
|
|
||||||
"""
|
|
||||||
) ?: throw PiracyDetectionFingerprint.exception
|
) ?: throw PiracyDetectionFingerprint.exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import app.revanced.util.getReference
|
|||||||
import app.revanced.util.indexOfFirstInstruction
|
import app.revanced.util.indexOfFirstInstruction
|
||||||
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.reference.StringReference
|
import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object SpoofClientPatch : BaseSpoofClientPatch(
|
object SpoofClientPatch : BaseSpoofClientPatch(
|
||||||
redirectUri = "redditisfun://auth",
|
redirectUri = "redditisfun://auth",
|
||||||
@@ -54,7 +53,7 @@ object SpoofClientPatch : BaseSpoofClientPatch(
|
|||||||
override fun Set<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
|
override fun Set<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
|
||||||
// Use a random user agent.
|
// Use a random user agent.
|
||||||
val randomName = (0..100000).random()
|
val randomName = (0..100000).random()
|
||||||
val userAgent = "android:app.revanced.$randomName:v1.0.0 (by /u/revanced)"
|
val userAgent = "$randomName:app.revanced.$randomName:v1.0.0 (by /u/revanced)"
|
||||||
|
|
||||||
first().mutableMethod.addInstructions(
|
first().mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ 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.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.MethodFingerprintResult
|
||||||
import app.revanced.patches.reddit.customclients.BaseSpoofClientPatch
|
import app.revanced.patches.reddit.customclients.BaseSpoofClientPatch
|
||||||
|
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.*
|
||||||
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 app.revanced.util.exception
|
import app.revanced.util.exception
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
@@ -17,19 +17,18 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
|||||||
import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object SpoofClientPatch : BaseSpoofClientPatch(
|
object SpoofClientPatch : BaseSpoofClientPatch(
|
||||||
redirectUri = "http://redditsync/auth",
|
redirectUri = "http://redditsync/auth",
|
||||||
miscellaneousFingerprints = setOf(ImgurImageAPIFingerprint),
|
miscellaneousFingerprints = setOf(ImgurImageAPIFingerprint),
|
||||||
clientIdFingerprints = setOf(GetAuthorizationStringFingerprint),
|
clientIdFingerprints = setOf(GetAuthorizationStringFingerprint),
|
||||||
userAgentFingerprints = setOf(LoadBrowserURLFingerprint),
|
userAgentFingerprints = setOf(GetUserAgentFingerprint),
|
||||||
compatiblePackages = setOf(
|
compatiblePackages = setOf(
|
||||||
CompatiblePackage("com.laurencedawson.reddit_sync"),
|
CompatiblePackage("com.laurencedawson.reddit_sync"),
|
||||||
CompatiblePackage("com.laurencedawson.reddit_sync.pro"),
|
CompatiblePackage("com.laurencedawson.reddit_sync.pro"),
|
||||||
CompatiblePackage("com.laurencedawson.reddit_sync.dev")
|
CompatiblePackage("com.laurencedawson.reddit_sync.dev"),
|
||||||
),
|
),
|
||||||
dependencies = setOf(DisablePiracyDetectionPatch::class)
|
dependencies = setOf(DisablePiracyDetectionPatch::class),
|
||||||
) {
|
) {
|
||||||
override fun Set<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
override fun Set<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
|
||||||
forEach { fingerprintResult ->
|
forEach { fingerprintResult ->
|
||||||
@@ -41,7 +40,7 @@ object SpoofClientPatch : BaseSpoofClientPatch(
|
|||||||
"""
|
"""
|
||||||
const-string v0, "Basic $auth"
|
const-string v0, "Basic $auth"
|
||||||
return-object v0
|
return-object v0
|
||||||
"""
|
""",
|
||||||
)
|
)
|
||||||
} ?: throw GetBearerTokenFingerprint.exception
|
} ?: throw GetBearerTokenFingerprint.exception
|
||||||
}.let {
|
}.let {
|
||||||
@@ -54,12 +53,12 @@ object SpoofClientPatch : BaseSpoofClientPatch(
|
|||||||
|
|
||||||
val newAuthorizationUrl = reference.string.replace(
|
val newAuthorizationUrl = reference.string.replace(
|
||||||
"client_id=.*?&".toRegex(),
|
"client_id=.*?&".toRegex(),
|
||||||
"client_id=$clientId&"
|
"client_id=$clientId&",
|
||||||
)
|
)
|
||||||
|
|
||||||
replaceInstruction(
|
replaceInstruction(
|
||||||
occurrenceIndex,
|
occurrenceIndex,
|
||||||
"const-string v$targetRegister, \"$newAuthorizationUrl\""
|
"const-string v$targetRegister, \"$newAuthorizationUrl\"",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,7 +71,21 @@ object SpoofClientPatch : BaseSpoofClientPatch(
|
|||||||
|
|
||||||
it.mutableMethod.replaceInstruction(
|
it.mutableMethod.replaceInstruction(
|
||||||
apiUrlIndex,
|
apiUrlIndex,
|
||||||
"const-string v1, \"https://api.imgur.com/3/image\""
|
"const-string v1, \"https://api.imgur.com/3/image\"",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun Set<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
|
||||||
|
// Use a random user agent.
|
||||||
|
val randomName = (0..100000).random()
|
||||||
|
val userAgent = "$randomName:app.revanced.$randomName:v1.0.0 (by /u/revanced)"
|
||||||
|
|
||||||
|
first().mutableMethod.replaceInstruction(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const-string v0, "$userAgent"
|
||||||
|
return-object v0
|
||||||
|
""",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
|
||||||
|
internal object GetUserAgentFingerprint : MethodFingerprint(
|
||||||
|
strings = listOf("android:com.laurencedawson.reddit_sync"),
|
||||||
|
)
|
||||||
@@ -102,6 +102,7 @@ object HideLayoutComponentsPatch : BytecodePatch(
|
|||||||
SwitchPreference("revanced_hide_expandable_chip"),
|
SwitchPreference("revanced_hide_expandable_chip"),
|
||||||
SwitchPreference("revanced_hide_info_panels"),
|
SwitchPreference("revanced_hide_info_panels"),
|
||||||
SwitchPreference("revanced_hide_join_membership_button"),
|
SwitchPreference("revanced_hide_join_membership_button"),
|
||||||
|
SwitchPreference("revanced_disable_like_subscribe_glow"),
|
||||||
SwitchPreference("revanced_hide_medical_panels"),
|
SwitchPreference("revanced_hide_medical_panels"),
|
||||||
SwitchPreference("revanced_hide_quick_actions"),
|
SwitchPreference("revanced_hide_quick_actions"),
|
||||||
SwitchPreference("revanced_hide_related_videos"),
|
SwitchPreference("revanced_hide_related_videos"),
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import app.revanced.patcher.patch.BytecodePatch
|
|||||||
import app.revanced.patcher.patch.PatchException
|
import app.revanced.patcher.patch.PatchException
|
||||||
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.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
|
||||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||||
@@ -19,6 +20,7 @@ import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildInitPlay
|
|||||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildPlayerRequestURIFingerprint
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildPlayerRequestURIFingerprint
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreatePlayerRequestBodyFingerprint
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreatePlayerRequestBodyFingerprint
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreatePlayerRequestBodyWithModelFingerprint
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreatePlayerRequestBodyWithModelFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.PlayerGestureConfigSyntheticFingerprint
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.SetPlayerRequestClientTypeFingerprint
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.SetPlayerRequestClientTypeFingerprint
|
||||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||||
import app.revanced.util.getReference
|
import app.revanced.util.getReference
|
||||||
@@ -69,11 +71,15 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
|
|||||||
)
|
)
|
||||||
object SpoofClientPatch : BytecodePatch(
|
object SpoofClientPatch : BytecodePatch(
|
||||||
setOf(
|
setOf(
|
||||||
|
// Client type spoof.
|
||||||
BuildInitPlaybackRequestFingerprint,
|
BuildInitPlaybackRequestFingerprint,
|
||||||
BuildPlayerRequestURIFingerprint,
|
BuildPlayerRequestURIFingerprint,
|
||||||
SetPlayerRequestClientTypeFingerprint,
|
SetPlayerRequestClientTypeFingerprint,
|
||||||
CreatePlayerRequestBodyFingerprint,
|
CreatePlayerRequestBodyFingerprint,
|
||||||
CreatePlayerRequestBodyWithModelFingerprint,
|
CreatePlayerRequestBodyWithModelFingerprint,
|
||||||
|
|
||||||
|
// Player gesture config.
|
||||||
|
PlayerGestureConfigSyntheticFingerprint,
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||||
@@ -115,6 +121,33 @@ object SpoofClientPatch : BytecodePatch(
|
|||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
// region fix player gesture.
|
||||||
|
|
||||||
|
PlayerGestureConfigSyntheticFingerprint.resultOrThrow().let {
|
||||||
|
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
|
|
||||||
|
arrayOf(3, 9).forEach { offSet ->
|
||||||
|
(context.toMethodWalker(it.mutableMethod)
|
||||||
|
.nextMethod(endIndex - offSet, true)
|
||||||
|
.getMethod() as MutableMethod)
|
||||||
|
.apply {
|
||||||
|
|
||||||
|
val index = implementation!!.instructions.lastIndex
|
||||||
|
val register = getInstruction<OneRegisterInstruction>(index).registerA
|
||||||
|
|
||||||
|
addInstructions(
|
||||||
|
index,
|
||||||
|
"""
|
||||||
|
invoke-static {v$register}, $INTEGRATIONS_CLASS_DESCRIPTOR->enablePlayerGesture(Z)Z
|
||||||
|
move-result v$register
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
// region Block /get_watch requests to fall back to /player requests.
|
// region Block /get_watch requests to fall back to /player requests.
|
||||||
|
|
||||||
BuildPlayerRequestURIFingerprint.resultOrThrow().let {
|
BuildPlayerRequestURIFingerprint.resultOrThrow().let {
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.PlayerGestureConfigSyntheticFingerprint.indexOfDownAndOutAllowedInstruction
|
||||||
|
import app.revanced.util.getReference
|
||||||
|
import app.revanced.util.indexOfFirstInstruction
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
import com.android.tools.smali.dexlib2.iface.Method
|
||||||
|
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||||
|
|
||||||
|
internal object PlayerGestureConfigSyntheticFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = listOf("Ljava/lang/Object;"),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.SGET_OBJECT,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
Opcode.IF_EQZ,
|
||||||
|
Opcode.IF_EQZ,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.INVOKE_VIRTUAL, // playerGestureConfig.downAndOutLandscapeAllowed
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
Opcode.CHECK_CAST,
|
||||||
|
Opcode.IPUT_BOOLEAN,
|
||||||
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.INVOKE_VIRTUAL, // playerGestureConfig.downAndOutPortraitAllowed
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
Opcode.IPUT_BOOLEAN,
|
||||||
|
Opcode.RETURN_VOID,
|
||||||
|
),
|
||||||
|
customFingerprint = { methodDef, classDef ->
|
||||||
|
// This method is always called "a" because this kind of class always has a single method.
|
||||||
|
methodDef.name == "a" && classDef.methods.count() == 2 &&
|
||||||
|
indexOfDownAndOutAllowedInstruction(methodDef) >= 0
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
fun indexOfDownAndOutAllowedInstruction(methodDef: Method) =
|
||||||
|
methodDef.indexOfFirstInstruction {
|
||||||
|
val reference = getReference<MethodReference>()
|
||||||
|
reference?.definingClass == "Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;" &&
|
||||||
|
reference.parameterTypes.isEmpty() &&
|
||||||
|
reference.returnType == "Z"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -91,6 +91,9 @@
|
|||||||
<string name="revanced_debug_toast_on_error_user_dialog_message">Turning off error toasts hides all ReVanced error notifications.\n\nYou will not be notified of any unexpected events.</string>
|
<string name="revanced_debug_toast_on_error_user_dialog_message">Turning off error toasts hides all ReVanced error notifications.\n\nYou will not be notified of any unexpected events.</string>
|
||||||
</patch>
|
</patch>
|
||||||
<patch id="layout.hide.general.HideLayoutComponentsPatch">
|
<patch id="layout.hide.general.HideLayoutComponentsPatch">
|
||||||
|
<string name="revanced_disable_like_subscribe_glow_title">Disable like / subscribe button glow</string>
|
||||||
|
<string name="revanced_disable_like_subscribe_glow_summary_on">Like and subscribe button will not glow when mentioned</string>
|
||||||
|
<string name="revanced_disable_like_subscribe_glow_summary_off">Like and subscribe button will glow when mentioned</string>
|
||||||
<string name="revanced_hide_gray_separator_title">Hide gray separator</string>
|
<string name="revanced_hide_gray_separator_title">Hide gray separator</string>
|
||||||
<string name="revanced_hide_gray_separator_summary_on">Gray separators are hidden</string>
|
<string name="revanced_hide_gray_separator_summary_on">Gray separators are hidden</string>
|
||||||
<string name="revanced_hide_gray_separator_summary_off">Gray separators are shown</string>
|
<string name="revanced_hide_gray_separator_summary_off">Gray separators are shown</string>
|
||||||
@@ -1094,7 +1097,7 @@
|
|||||||
<string name="revanced_spoof_client_user_dialog_message">Turning off this setting may cause video playback issues.</string>
|
<string name="revanced_spoof_client_user_dialog_message">Turning off this setting may cause video playback issues.</string>
|
||||||
<string name="revanced_spoof_client_use_ios_title">Spoof client to iOS</string>
|
<string name="revanced_spoof_client_use_ios_title">Spoof client to iOS</string>
|
||||||
<string name="revanced_spoof_client_use_ios_summary_on">Client is currently spoofed to iOS\n\nSide effects include:\n• No HDR video\n• Speed menu is missing\n• Watch history may not work\n• Live streams cannot play as audio only\n• Live streams not available on older devices</string>
|
<string name="revanced_spoof_client_use_ios_summary_on">Client is currently spoofed to iOS\n\nSide effects include:\n• No HDR video\n• Speed menu is missing\n• Watch history may not work\n• Live streams cannot play as audio only\n• Live streams not available on older devices</string>
|
||||||
<string name="revanced_spoof_client_use_ios_summary_off">Client is currently spoofed to Android VR\n\nSide effects include:\n• No HDR video\n• Swipe to enter/exit fullscreen does not work\n• Kids videos do not playback\n• Paused videos can randomly resume</string>
|
<string name="revanced_spoof_client_use_ios_summary_off">Client is currently spoofed to Android VR\n\nSide effects include:\n• No HDR video\n• Kids videos do not playback\n• Paused videos can randomly resume</string>
|
||||||
<string name="revanced_spoof_client_storyboard_timeout">Spoof client thumbnails not available (API timed out)</string>
|
<string name="revanced_spoof_client_storyboard_timeout">Spoof client thumbnails not available (API timed out)</string>
|
||||||
<string name="revanced_spoof_client_storyboard_io_exception">Spoof client thumbnails temporarily not available: %s</string>
|
<string name="revanced_spoof_client_storyboard_io_exception">Spoof client thumbnails temporarily not available: %s</string>
|
||||||
</patch>
|
</patch>
|
||||||
|
|||||||
Reference in New Issue
Block a user