mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-21 01:53:56 +00:00
Compare commits
16 Commits
v2.187.0-d
...
v2.187.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efe7cbc78c | ||
|
|
9ac0ed477a | ||
|
|
9426b28dcc | ||
|
|
146b213b4a | ||
|
|
557a9f7418 | ||
|
|
e7b2bfbde3 | ||
|
|
d442acaac8 | ||
|
|
a00eab6744 | ||
|
|
87f2f90fc5 | ||
|
|
04c8c48df7 | ||
|
|
bb9001283a | ||
|
|
b7f0c13443 | ||
|
|
942fe7f870 | ||
|
|
c224c16f50 | ||
|
|
45c2751f70 | ||
|
|
7cf79ab856 |
@@ -10,7 +10,7 @@
|
|||||||
[
|
[
|
||||||
"@semantic-release/commit-analyzer", {
|
"@semantic-release/commit-analyzer", {
|
||||||
"releaseRules": [
|
"releaseRules": [
|
||||||
{ "type": "build", "scope": "revanced-patcher", "release": "patch" }
|
{ "type": "build", "scope": "Needs bump", "release": "patch" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
43
CHANGELOG.md
43
CHANGELOG.md
@@ -1,3 +1,46 @@
|
|||||||
|
# [2.187.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v2.187.0-dev.9...v2.187.0-dev.10) (2023-08-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Reddit is Fun - Spoof client:** Spoof the user agent ([b9aaf61](https://github.com/ReVanced/revanced-patches/commit/b9aaf610ad9f1f45a72265a3782d2cf996020139))
|
||||||
|
|
||||||
|
# [2.187.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v2.187.0-dev.8...v2.187.0-dev.9) (2023-07-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Use clearer descriptions ([8dbb0e2](https://github.com/ReVanced/revanced-patches/commit/8dbb0e212e8ceeb0381a3509e45afca095ddee53))
|
||||||
|
|
||||||
|
# [2.187.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v2.187.0-dev.7...v2.187.0-dev.8) (2023-07-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Sync for Reddit - Change OAuth client id:** Disable piracy detection ([cd103dd](https://github.com/ReVanced/revanced-patches/commit/cd103dd9b8ff2667246d4abaf75577f28bf1a11b))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Joey for Reddit:** Add `Change OAuth client id` patch ([1bac47d](https://github.com/ReVanced/revanced-patches/commit/1bac47df889b5221bef1c03e652f894be8d39385))
|
||||||
|
* **Joey for Reddit:** Add `Disable ads` patch ([ad7e147](https://github.com/ReVanced/revanced-patches/commit/ad7e14771208dcab08fd6dc29403b1a4cf602111))
|
||||||
|
|
||||||
|
# [2.187.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v2.187.0-dev.6...v2.187.0-dev.7) (2023-07-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** add `Player Flyout Menu` patch ([#2295](https://github.com/ReVanced/revanced-patches/issues/2295)) ([aea0af0](https://github.com/ReVanced/revanced-patches/commit/aea0af059784ae4820a0e73ff91f97bbc3ebc4c7))
|
||||||
|
|
||||||
|
# [2.187.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v2.187.0-dev.5...v2.187.0-dev.6) (2023-07-30)
|
||||||
|
|
||||||
|
# [2.187.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v2.187.0-dev.4...v2.187.0-dev.5) (2023-07-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Spoof app version:** Fix grammar in description ([#2711](https://github.com/ReVanced/revanced-patches/issues/2711)) ([dd249e6](https://github.com/ReVanced/revanced-patches/commit/dd249e62243e57733a6ff4d3a17d30db0e08a84d))
|
||||||
|
|
||||||
# [2.187.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.187.0-dev.3...v2.187.0-dev.4) (2023-07-28)
|
# [2.187.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.187.0-dev.3...v2.187.0-dev.4) (2023-07-28)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("app.revanced:revanced-patcher:11.0.3")
|
implementation("app.revanced:revanced-patcher:12.0.0")
|
||||||
implementation("app.revanced:multidexlib2:2.5.3-a3836654")
|
implementation("app.revanced:multidexlib2:2.5.3-a3836654")
|
||||||
// Required for meta
|
// Required for meta
|
||||||
implementation("com.google.code.gson:gson:2.10.1")
|
implementation("com.google.code.gson:gson:2.10.1")
|
||||||
|
|||||||
@@ -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.187.0-dev.4
|
version = 2.187.0-dev.10
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -8,11 +8,15 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
|||||||
import app.revanced.patcher.patch.*
|
import app.revanced.patcher.patch.*
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
abstract class AbstractChangeOAuthClientIdPatch(
|
abstract class AbstractSpoofClientPatch(
|
||||||
private val redirectUri: String,
|
private val redirectUri: String,
|
||||||
private val options: ChangeOAuthClientIdOptionsContainer,
|
private val options: SpoofClientOptionsContainer,
|
||||||
private val fingerprints: List<MethodFingerprint>
|
private val clientIdFingerprints: List<MethodFingerprint>,
|
||||||
) : BytecodePatch(fingerprints) {
|
private val userAgentFingerprints: List<MethodFingerprint>? = null,
|
||||||
|
) : BytecodePatch(buildList {
|
||||||
|
addAll(clientIdFingerprints)
|
||||||
|
userAgentFingerprints?.let(::addAll)
|
||||||
|
}) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
if (options.clientId == null) {
|
if (options.clientId == null) {
|
||||||
// Ensure device runs Android.
|
// Ensure device runs Android.
|
||||||
@@ -38,13 +42,39 @@ abstract class AbstractChangeOAuthClientIdPatch(
|
|||||||
}.let { options.clientId = it.readText().trim() }
|
}.let { options.clientId = it.readText().trim() }
|
||||||
}
|
}
|
||||||
|
|
||||||
return fingerprints.map { it.result ?: throw it.toErrorResult() }.patch(context)
|
fun List<MethodFingerprint>?.executePatch(
|
||||||
|
patch: List<MethodFingerprintResult>.(BytecodeContext) -> PatchResult
|
||||||
|
) {
|
||||||
|
when (val result = this?.map { it.result ?: throw it.toErrorResult() }?.patch(context)) {
|
||||||
|
is PatchResultError -> throw result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
clientIdFingerprints.executePatch { patchClientId(context) }
|
||||||
|
userAgentFingerprints.executePatch { patchUserAgent(context) }
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult
|
/**
|
||||||
|
* Patch the client ID. The fingerprints are guaranteed to be in the same order as in [clientIdFingerprints].
|
||||||
|
*
|
||||||
|
* @param context The current [BytecodeContext].
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
abstract fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch the user agent. The fingerprints are guaranteed to be in the same order as in [userAgentFingerprints].
|
||||||
|
*
|
||||||
|
* @param context The current [BytecodeContext].
|
||||||
|
*/
|
||||||
|
// Not every client needs to patch the user agent.
|
||||||
|
open fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext): PatchResult =
|
||||||
|
PatchResultSuccess()
|
||||||
|
|
||||||
companion object Options {
|
companion object Options {
|
||||||
open class ChangeOAuthClientIdOptionsContainer : OptionsContainer() {
|
open class SpoofClientOptionsContainer : OptionsContainer() {
|
||||||
var clientId by option(
|
var clientId by option(
|
||||||
PatchOption.StringOption(
|
PatchOption.StringOption(
|
||||||
"client-id",
|
"client-id",
|
||||||
@@ -5,5 +5,5 @@ import app.revanced.patcher.patch.annotations.Patch
|
|||||||
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
@Patch
|
@Patch
|
||||||
@Name("Change OAuth client id")
|
@Name("Spoof client")
|
||||||
annotation class ChangeOAuthClientIdPatchAnnotation
|
annotation class SpoofClientAnnotation
|
||||||
@@ -9,15 +9,15 @@ 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.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.baconreader.api.fingerprints.GetAuthorizationUrlFingerprint
|
import app.revanced.patches.reddit.customclients.baconreader.api.fingerprints.GetAuthorizationUrlFingerprint
|
||||||
import app.revanced.patches.reddit.customclients.baconreader.api.fingerprints.RequestTokenFingerprint
|
import app.revanced.patches.reddit.customclients.baconreader.api.fingerprints.RequestTokenFingerprint
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
|
|
||||||
@ChangeOAuthClientIdPatchAnnotation
|
@SpoofClientAnnotation
|
||||||
@Description("Changes the OAuth client ID. " +
|
@Description("Spoofs the client in order to allow logging in. " +
|
||||||
"The OAuth application type has to be \"Installed app\" " +
|
"The OAuth application type has to be \"Installed app\" " +
|
||||||
"and the redirect URI has to be set to \"http://baconreader.com/auth\".")
|
"and the redirect URI has to be set to \"http://baconreader.com/auth\".")
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
@@ -26,11 +26,11 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
Package("com.onelouder.baconreader.premium")
|
Package("com.onelouder.baconreader.premium")
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"http://baconreader.com/auth", Options, listOf(GetAuthorizationUrlFingerprint, RequestTokenFingerprint)
|
"http://baconreader.com/auth", Options, listOf(GetAuthorizationUrlFingerprint, RequestTokenFingerprint)
|
||||||
) {
|
) {
|
||||||
|
|
||||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
||||||
fun MethodFingerprintResult.patch(replacementString: String) {
|
fun MethodFingerprintResult.patch(replacementString: String) {
|
||||||
val clientIdIndex = scanResult.stringsScanResult!!.matches.first().index
|
val clientIdIndex = scanResult.stringsScanResult!!.matches.first().index
|
||||||
|
|
||||||
@@ -52,5 +52,5 @@ class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
|||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractChangeOAuthClientIdPatch.Options.ChangeOAuthClientIdOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
}
|
}
|
||||||
@@ -8,29 +8,29 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
|||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
||||||
|
|
||||||
@ChangeOAuthClientIdPatchAnnotation
|
@SpoofClientAnnotation
|
||||||
@Description("Changes the OAuth client ID. " +
|
@Description("Spoofs the client in order to allow logging in. " +
|
||||||
"The OAuth application type has to be \"Installed app\" " +
|
"The OAuth application type has to be \"Installed app\" " +
|
||||||
"and the redirect URI has to be set to \"http://rubenmayayo.com\".")
|
"and the redirect URI has to be set to \"http://rubenmayayo.com\".")
|
||||||
@Compatibility([Package("com.rubenmayayo.reddit")])
|
@Compatibility([Package("com.rubenmayayo.reddit")])
|
||||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"http://rubenmayayo.com", Options, listOf(GetClientIdFingerprint)
|
"http://rubenmayayo.com", Options, listOf(GetClientIdFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
||||||
first().mutableMethod.addInstructions(
|
first().mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const-string v0, "$clientId"
|
const-string v0, "$clientId"
|
||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractChangeOAuthClientIdPatch.Options.ChangeOAuthClientIdOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
}
|
}
|
||||||
@@ -9,23 +9,23 @@ 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.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
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 org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@ChangeOAuthClientIdPatchAnnotation
|
@SpoofClientAnnotation
|
||||||
@Description("Changes the OAuth client ID. " +
|
@Description("Spoofs the client in order to allow logging in. " +
|
||||||
"The OAuth application type has to be \"Installed app\" " +
|
"The OAuth application type has to be \"Installed app\" " +
|
||||||
"and the redirect URI has to be set to \"infinity://localhost\".")
|
"and the redirect URI has to be set to \"infinity://localhost\".")
|
||||||
@Compatibility([Package("ml.docilealligator.infinityforreddit")])
|
@Compatibility([Package("ml.docilealligator.infinityforreddit")])
|
||||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"infinity://localhost",
|
"infinity://localhost",
|
||||||
Options,
|
Options,
|
||||||
listOf(GetHttpBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint)
|
listOf(GetHttpBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
||||||
forEach {
|
forEach {
|
||||||
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
@@ -41,5 +41,5 @@ class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
|||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractChangeOAuthClientIdPatch.Options.ChangeOAuthClientIdOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.joeyforreddit.ads.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object IsAdFreeUserFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Z",
|
||||||
|
accessFlags = AccessFlags.PUBLIC.value,
|
||||||
|
strings = listOf("AD_FREE_USER")
|
||||||
|
)
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.joeyforreddit.ads.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.toErrorResult
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.reddit.customclients.joeyforreddit.ads.fingerprints.IsAdFreeUserFingerprint
|
||||||
|
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.patch.DisablePiracyDetectionPatch
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("Disable ads")
|
||||||
|
@DependsOn([DisablePiracyDetectionPatch::class])
|
||||||
|
@Compatibility([Package("o.o.joey")])
|
||||||
|
class DisableAdsPatch : BytecodePatch(listOf(IsAdFreeUserFingerprint)) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
IsAdFreeUserFingerprint.result?.mutableMethod?.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
) ?: return IsAdFreeUserFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.joeyforreddit.api.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object GetClientIdFingerprint : MethodFingerprint(
|
||||||
|
returnType = "L",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.CONST, // R.string.valuable_cid
|
||||||
|
Opcode.INVOKE_STATIC, // StringMaster.decrypt
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.RETURN_OBJECT
|
||||||
|
),
|
||||||
|
customFingerprint = custom@{ _, classDef ->
|
||||||
|
classDef.sourceFile == "AuthUtility.java"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.joeyforreddit.api.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
|
import app.revanced.patches.reddit.customclients.joeyforreddit.api.fingerprints.GetClientIdFingerprint
|
||||||
|
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.patch.DisablePiracyDetectionPatch
|
||||||
|
|
||||||
|
@SpoofClientAnnotation
|
||||||
|
@Description(
|
||||||
|
"Spoofs the client in order to allow logging in. " +
|
||||||
|
"The OAuth application type has to be \"Installed app\" " +
|
||||||
|
"and the redirect URI has to be set to \"https://127.0.0.1:65023/authorize_callback\"."
|
||||||
|
)
|
||||||
|
@Compatibility(
|
||||||
|
[
|
||||||
|
Package("o.o.joey"),
|
||||||
|
Package("o.o.joey.pro"),
|
||||||
|
Package("o.o.joey.dev")
|
||||||
|
]
|
||||||
|
)
|
||||||
|
@DependsOn([DisablePiracyDetectionPatch::class])
|
||||||
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
|
"https://127.0.0.1:65023/authorize_callback", Options, listOf(GetClientIdFingerprint)
|
||||||
|
) {
|
||||||
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
||||||
|
first().mutableMethod.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const-string v0, "$clientId"
|
||||||
|
return-object v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
object PiracyDetectionFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
accessFlags = AccessFlags.PRIVATE or AccessFlags.STATIC,
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.NEW_INSTANCE, // new PiracyDetectionRunnable()
|
||||||
|
Opcode.CONST_16,
|
||||||
|
Opcode.CONST_WIDE_16,
|
||||||
|
Opcode.INVOKE_DIRECT, // <init>(..)
|
||||||
|
Opcode.INVOKE_VIRTUAL, // run()
|
||||||
|
Opcode.RETURN_VOID
|
||||||
|
),
|
||||||
|
customFingerprint = custom@{ _, classDef ->
|
||||||
|
classDef.type.endsWith("ProcessLifeCyleListener;")
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.toErrorResult
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
||||||
|
|
||||||
|
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
PiracyDetectionFingerprint.result?.mutableMethod?.addInstruction(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
return-void
|
||||||
|
"""
|
||||||
|
) ?: return PiracyDetectionFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
object GetUserAgentFingerprint : MethodFingerprint(
|
||||||
|
"Ljava/lang/String;",
|
||||||
|
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
|
emptyList(),
|
||||||
|
listOf(
|
||||||
|
Opcode.NEW_ARRAY,
|
||||||
|
Opcode.CONST_4,
|
||||||
|
Opcode.INVOKE_STATIC,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.APUT_OBJECT,
|
||||||
|
Opcode.CONST,
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -4,32 +4,32 @@ import app.revanced.patcher.annotation.Compatibility
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
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.fingerprint.method.impl.MethodFingerprintResult.MethodFingerprintScanResult.StringsScanResult.StringMatch
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult.MethodFingerprintScanResult.StringsScanResult.StringMatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints.BasicAuthorizationFingerprint
|
import app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints.BasicAuthorizationFingerprint
|
||||||
import app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints.BuildAuthorizationStringFingerprint
|
import app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints.BuildAuthorizationStringFingerprint
|
||||||
|
import app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints.GetUserAgentFingerprint
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@ChangeOAuthClientIdPatchAnnotation
|
@SpoofClientAnnotation
|
||||||
@Description("Changes the OAuth client ID. " +
|
@Description("Spoofs the client in order to allow logging in. " +
|
||||||
"The OAuth application type has to be \"Installed app\" " +
|
"The OAuth application type has to be \"Installed app\" " +
|
||||||
"and the redirect URI has to be set to \"redditisfun://auth\".")
|
"and the redirect URI has to be set to \"redditisfun://auth\".")
|
||||||
@Compatibility([Package("com.andrewshu.android.reddit"), Package("com.andrewshu.android.redditdonation")])
|
@Compatibility([Package("com.andrewshu.android.reddit"), Package("com.andrewshu.android.redditdonation")])
|
||||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"redditisfun://auth",
|
"redditisfun://auth",
|
||||||
Options,
|
Options,
|
||||||
listOf(
|
listOf(BuildAuthorizationStringFingerprint, BasicAuthorizationFingerprint),
|
||||||
BuildAuthorizationStringFingerprint,
|
listOf(GetUserAgentFingerprint)
|
||||||
BasicAuthorizationFingerprint,
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
||||||
/**
|
/**
|
||||||
* Replaces a one register instruction with a const-string instruction
|
* Replaces a one register instruction with a const-string instruction
|
||||||
* at the index returned by [getReplacementIndex].
|
* at the index returned by [getReplacementIndex].
|
||||||
@@ -57,5 +57,20 @@ class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
|||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractChangeOAuthClientIdPatch.Options.ChangeOAuthClientIdOptionsContainer()
|
override fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext): PatchResult {
|
||||||
|
// Use a random number as the user agent string.
|
||||||
|
val randomUserAgent = (0..100000).random()
|
||||||
|
|
||||||
|
first().mutableMethod.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const-string v0, "$randomUserAgent"
|
||||||
|
return-object v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
}
|
}
|
||||||
@@ -9,20 +9,20 @@ 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.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetLoggedInBearerTokenFingerprint
|
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetLoggedInBearerTokenFingerprint
|
||||||
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetLoggedOutBearerTokenFingerprint
|
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetLoggedOutBearerTokenFingerprint
|
||||||
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetRefreshTokenFingerprint
|
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetRefreshTokenFingerprint
|
||||||
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.LoginActivityClientIdFingerprint
|
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.LoginActivityClientIdFingerprint
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@ChangeOAuthClientIdPatchAnnotation
|
@SpoofClientAnnotation
|
||||||
@Description("Changes the OAuth client ID. " +
|
@Description("Spoofs the client in order to allow logging in. " +
|
||||||
"The OAuth application type has to be \"Installed app\" " +
|
"The OAuth application type has to be \"Installed app\" " +
|
||||||
"and the redirect URI has to be set to \"dbrady://relay\".")
|
"and the redirect URI has to be set to \"dbrady://relay\".")
|
||||||
@Compatibility([Package("free.reddit.news"), Package("reddit.news")])
|
@Compatibility([Package("free.reddit.news"), Package("reddit.news")])
|
||||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"dbrady://relay",
|
"dbrady://relay",
|
||||||
Options,
|
Options,
|
||||||
listOf(
|
listOf(
|
||||||
@@ -32,7 +32,7 @@ class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
|||||||
GetRefreshTokenFingerprint
|
GetRefreshTokenFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
||||||
forEach {
|
forEach {
|
||||||
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
@@ -48,5 +48,5 @@ class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
|||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractChangeOAuthClientIdPatch.Options.ChangeOAuthClientIdOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
}
|
}
|
||||||
@@ -1,36 +1,36 @@
|
|||||||
package app.revanced.patches.reddit.customclients.slide.api.patch
|
package app.revanced.patches.reddit.customclients.slide.api.patch
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
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.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
||||||
|
|
||||||
@ChangeOAuthClientIdPatchAnnotation
|
@SpoofClientAnnotation
|
||||||
@Description("Changes the OAuth client ID. " +
|
@Description("Spoofs the client in order to allow logging in. " +
|
||||||
"The OAuth application type has to be \"Installed app\" " +
|
"The OAuth application type has to be \"Installed app\" " +
|
||||||
"and the redirect URI has to be set to \"http://www.ccrama.me\".")
|
"and the redirect URI has to be set to \"http://www.ccrama.me\".")
|
||||||
@Compatibility([Package("me.ccrama.redditslide")])
|
@Compatibility([Package("me.ccrama.redditslide")])
|
||||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"http://www.ccrama.me", Options, listOf(GetClientIdFingerprint)
|
"http://www.ccrama.me", Options, listOf(GetClientIdFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
||||||
first().mutableMethod.addInstructions(
|
first().mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const-string v0, "$clientId"
|
const-string v0, "$clientId"
|
||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractChangeOAuthClientIdPatch.Options.ChangeOAuthClientIdOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,6 @@ import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.
|
|||||||
@Patch
|
@Patch
|
||||||
@Name("Disable ads")
|
@Name("Disable ads")
|
||||||
@DependsOn([DisablePiracyDetectionPatch::class])
|
@DependsOn([DisablePiracyDetectionPatch::class])
|
||||||
@Description("Disables ads.")
|
|
||||||
@Compatibility([Package("com.laurencedawson.reddit_sync")])
|
@Compatibility([Package("com.laurencedawson.reddit_sync")])
|
||||||
class DisableAdsPatch : BytecodePatch(listOf(IsAdsEnabledFingerprint)) {
|
class DisableAdsPatch : BytecodePatch(listOf(IsAdsEnabledFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
|||||||
@@ -12,17 +12,19 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.
|
|||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
|
||||||
|
import app.revanced.patches.reddit.customclients.SpoofClientAnnotation
|
||||||
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.detection.piracy.patch.DisablePiracyDetectionPatch
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
import org.jf.dexlib2.iface.reference.StringReference
|
import org.jf.dexlib2.iface.reference.StringReference
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
@ChangeOAuthClientIdPatchAnnotation
|
@SpoofClientAnnotation
|
||||||
@Description("Changes the OAuth client ID. " +
|
@Description("Spoofs the client in order to allow logging in. " +
|
||||||
"The OAuth application type has to be \"Installed app\" " +
|
"The OAuth application type has to be \"Installed app\" " +
|
||||||
"and the redirect URI has to be set to \"http://redditsync/auth\".")
|
"and the redirect URI has to be set to \"http://redditsync/auth\".")
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
@@ -32,10 +34,11 @@ import java.util.*
|
|||||||
Package("com.laurencedawson.reddit_sync.dev")
|
Package("com.laurencedawson.reddit_sync.dev")
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
@DependsOn([DisablePiracyDetectionPatch::class])
|
||||||
|
class SpoofClientPatch : AbstractSpoofClientPatch(
|
||||||
"http://redditsync/auth", Options, listOf(GetAuthorizationStringFingerprint)
|
"http://redditsync/auth", Options, listOf(GetAuthorizationStringFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext): PatchResult {
|
||||||
forEach { fingerprintResult ->
|
forEach { fingerprintResult ->
|
||||||
fingerprintResult.also { result ->
|
fingerprintResult.also { result ->
|
||||||
GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply {
|
GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply {
|
||||||
@@ -72,5 +75,5 @@ class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
|||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object Options : AbstractChangeOAuthClientIdPatch.Options.ChangeOAuthClientIdOptionsContainer()
|
companion object Options : AbstractSpoofClientPatch.Options.SpoofClientOptionsContainer()
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package app.revanced.patches.youtube.layout.hide.watchinvr.annotations
|
package app.revanced.patches.youtube.layout.hide.player.flyoutmenupanel.annotations
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
@Compatibility([Package("com.google.android.youtube", arrayOf("18.16.37", "18.19.35", "18.20.39", "18.23.35"))])
|
@Compatibility([Package("com.google.android.youtube", arrayOf("18.16.37", "18.19.35", "18.20.39", "18.23.35"))])
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
internal annotation class WatchInVRCompatibility
|
internal annotation class HidePlayerFlyoutMenuItemsCompatibility
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.hide.player.flyoutmenupanel.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.data.ResourceContext
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
|
import app.revanced.patches.youtube.layout.hide.player.flyoutmenupanel.annotations.HidePlayerFlyoutMenuItemsCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
||||||
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("Player flyout menu")
|
||||||
|
@Description("Hides player flyout menu items.")
|
||||||
|
@DependsOn([LithoFilterPatch::class, SettingsPatch::class])
|
||||||
|
@HidePlayerFlyoutMenuItemsCompatibility
|
||||||
|
class HidePlayerFlyoutMenuPatch : ResourcePatch {
|
||||||
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
|
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||||
|
PreferenceScreen(
|
||||||
|
KEY,
|
||||||
|
StringResource("${KEY}_title", "Player flyout menu items"),
|
||||||
|
listOf(
|
||||||
|
SwitchPreference(
|
||||||
|
"${KEY}_quality",
|
||||||
|
StringResource("${KEY}_quality_title", "Hide Quality menu"),
|
||||||
|
StringResource("${KEY}_quality_on", "Quality menu item is hidden"),
|
||||||
|
StringResource("${KEY}_quality_off", "Quality menu item is shown")
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"${KEY}_captions",
|
||||||
|
StringResource("${KEY}_captions_title", "Hide Captions menu"),
|
||||||
|
StringResource("${KEY}_captions_on", "Captions menu item is hidden"),
|
||||||
|
StringResource("${KEY}_captions_off", "Captions menu item is shown")
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"${KEY}_loop_video",
|
||||||
|
StringResource("${KEY}_loop_video_title", "Hide Loop video menu"),
|
||||||
|
StringResource("${KEY}_loop_video_on", "Loop video menu item is hidden"),
|
||||||
|
StringResource("${KEY}_loop_video_off", "Loop video menu item is shown")
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"${KEY}_ambient_mode",
|
||||||
|
StringResource("${KEY}_ambient_mode_title", "Hide Ambient mode menu"),
|
||||||
|
StringResource("${KEY}_ambient_mode_on", "Ambient mode menu item is hidden"),
|
||||||
|
StringResource("${KEY}_ambient_mode_off", "Ambient mode menu item is shown")
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"${KEY}_report",
|
||||||
|
StringResource("${KEY}_report_title", "Hide Report menu"),
|
||||||
|
StringResource("${KEY}_report_on", "Report menu item is hidden"),
|
||||||
|
StringResource("${KEY}_report_off", "Report menu item is shown")
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"${KEY}_help",
|
||||||
|
StringResource("${KEY}_help_title", "Hide Help menu"),
|
||||||
|
StringResource("${KEY}_help_on", "Help menu item is hidden"),
|
||||||
|
StringResource("${KEY}_help_off", "Help menu item is shown")
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"${KEY}_speed",
|
||||||
|
StringResource("${KEY}_speed_title", "Hide Speed menu"),
|
||||||
|
StringResource("${KEY}_speed_on", "Speed menu item is hidden"),
|
||||||
|
StringResource("${KEY}_speed_off", "Speed menu item is shown")
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"${KEY}_more_info",
|
||||||
|
StringResource("${KEY}_more_info_title", "Hide More info menu"),
|
||||||
|
StringResource("${KEY}_more_info_on", "More info menu item is hidden"),
|
||||||
|
StringResource("${KEY}_more_info_off", "More info menu item is shown")
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"${KEY}_audio_track",
|
||||||
|
StringResource("${KEY}_audio_track_title", "Hide Audio track menu"),
|
||||||
|
StringResource("${KEY}_audio_track_on", "Audio track menu item is hidden"),
|
||||||
|
StringResource("${KEY}_audio_track_off", "Audio track menu item is shown")
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"${KEY}_watch_in_vr",
|
||||||
|
StringResource("${KEY}_watch_in_vr_title", "Hide Watch in VR menu"),
|
||||||
|
StringResource("${KEY}_watch_in_vr_on", "Watch in VR menu item is hidden"),
|
||||||
|
StringResource("${KEY}_watch_in_vr_off", "Watch in VR menu item is shown")
|
||||||
|
),
|
||||||
|
),
|
||||||
|
StringResource("${KEY}_summary", "Manage the visibility of player flyout menu items")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val KEY = "revanced_hide_player_flyout"
|
||||||
|
|
||||||
|
const val FILTER_CLASS_DESCRIPTOR =
|
||||||
|
"Lapp/revanced/integrations/patches/components/PlayerFlyoutMenuItemsFilter;"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.layout.hide.watchinvr.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
|
|
||||||
object WatchInVRFingerprint : MethodFingerprint(
|
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"),
|
|
||||||
strings = listOf("menu_item_cardboard_vr")
|
|
||||||
)
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.layout.hide.watchinvr.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
|
||||||
import app.revanced.patches.youtube.layout.hide.watchinvr.annotations.WatchInVRCompatibility
|
|
||||||
import app.revanced.patches.youtube.layout.hide.watchinvr.fingerprints.WatchInVRFingerprint
|
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
|
||||||
@Name("Hide watch in VR")
|
|
||||||
@Description("Hides the option to watch in VR from the player settings flyout panel.")
|
|
||||||
@WatchInVRCompatibility
|
|
||||||
class WatchInVRPatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
WatchInVRFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
|
||||||
SwitchPreference(
|
|
||||||
"revanced_hide_watch_in_vr",
|
|
||||||
StringResource("revanced_hide_watch_in_vr_title", "Hide VR setting"),
|
|
||||||
StringResource("revanced_hide_watch_in_vr_summary_on", "VR setting is hidden"),
|
|
||||||
StringResource("revanced_hide_watch_in_vr_summary_off", "VR setting is shown")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
WatchInVRFingerprint.result!!.mutableMethod.addInstructionsWithLabels(
|
|
||||||
0,
|
|
||||||
"""
|
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/HideWatchInVRPatch;->hideWatchInVR()Z
|
|
||||||
move-result v0
|
|
||||||
if-eqz v0, :shown
|
|
||||||
return-void
|
|
||||||
:shown
|
|
||||||
nop
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -23,7 +23,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
@Patch
|
@Patch
|
||||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||||
@Name("Spoof app version")
|
@Name("Spoof app version")
|
||||||
@Description("Tricks YouTube into thinking, you are running an older version of the app. One of the side effects also includes restoring the old UI.")
|
@Description("Tricks YouTube into thinking you are running an older version of the app. One of the side effects also includes restoring the old UI.")
|
||||||
@SpoofAppVersionCompatibility
|
@SpoofAppVersionCompatibility
|
||||||
class SpoofAppVersionPatch : BytecodePatch(
|
class SpoofAppVersionPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
@@ -87,4 +87,4 @@ class SpoofAppVersionPatch : BytecodePatch(
|
|||||||
private companion object {
|
private companion object {
|
||||||
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/SpoofAppVersionPatch"
|
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/SpoofAppVersionPatch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("Client spoof")
|
@Name("Client spoof")
|
||||||
@Description("Spoofs a patched client to allow playback.")
|
@Description("Spoofs the client to allow playback.")
|
||||||
@ClientSpoofCompatibility
|
@ClientSpoofCompatibility
|
||||||
@DependsOn([SpoofSignatureVerificationPatch::class])
|
@DependsOn([SpoofSignatureVerificationPatch::class])
|
||||||
class ClientSpoofPatch : BytecodePatch(
|
class ClientSpoofPatch : BytecodePatch(
|
||||||
|
|||||||
@@ -14,13 +14,16 @@ import app.revanced.patcher.patch.PatchResult
|
|||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.*
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ProtobufParameterBuilderFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ScrubbedPreviewLayoutFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.StoryboardThumbnailFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.StoryboardThumbnailParentFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
|
|
||||||
@Name("Spoof signature verification")
|
@Name("Spoof signature verification")
|
||||||
@Description("Spoofs a patched client to prevent playback issues.")
|
@Description("Spoofs the client to prevent playback issues.")
|
||||||
@DependsOn([
|
@DependsOn([
|
||||||
SpoofSignatureVerificationResourcePatch::class,
|
SpoofSignatureVerificationResourcePatch::class,
|
||||||
IntegrationsPatch::class,
|
IntegrationsPatch::class,
|
||||||
|
|||||||
Reference in New Issue
Block a user