mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-26 10:54:07 +01:00
Compare commits
19 Commits
v2.178.0-d
...
v2.179.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f13f796c7 | ||
|
|
81dbd1dd9f | ||
|
|
381b4e6e10 | ||
|
|
b6c2757a7d | ||
|
|
a80ecfc631 | ||
|
|
c334dc768f | ||
|
|
3adf51ad4f | ||
|
|
514aafabe8 | ||
|
|
e5c05b889f | ||
|
|
2b502d601b | ||
|
|
927a02586a | ||
|
|
5d6cd7de55 | ||
|
|
488b0731fa | ||
|
|
cac3bd75b2 | ||
|
|
1ef8c435b4 | ||
|
|
baeed05fbc | ||
|
|
badcadb8e6 | ||
|
|
e8f8746fce | ||
|
|
ed28862733 |
77
CHANGELOG.md
77
CHANGELOG.md
@@ -1,3 +1,80 @@
|
||||
# [2.179.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.179.0-dev.5...v2.179.0-dev.6) (2023-06-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **syncforreddit/change-oauth-client-id:** add dev edition ([#2516](https://github.com/revanced/revanced-patches/issues/2516)) ([7c7294b](https://github.com/revanced/revanced-patches/commit/7c7294b750f54390dd2308de63cc09545010b17f))
|
||||
|
||||
# [2.179.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.179.0-dev.4...v2.179.0-dev.5) (2023-06-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **relayforreddit/change-oauth-client-id:** change client id instead of developer key ([#2508](https://github.com/revanced/revanced-patches/issues/2508)) ([4befb44](https://github.com/revanced/revanced-patches/commit/4befb4414638c5936f99d8d63d73c729efc773a5))
|
||||
|
||||
# [2.179.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.179.0-dev.3...v2.179.0-dev.4) (2023-06-27)
|
||||
|
||||
# [2.179.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.179.0-dev.2...v2.179.0-dev.3) (2023-06-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **enable-android-debugging:** remove json options ([#2497](https://github.com/revanced/revanced-patches/issues/2497)) ([3e25f5f](https://github.com/revanced/revanced-patches/commit/3e25f5f8df24a585dc1097aa16877841f0c6b74a))
|
||||
|
||||
# [2.179.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.179.0-dev.1...v2.179.0-dev.2) (2023-06-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **relayforreddit:** add `change-oauth-client-id` patch ([#2491](https://github.com/revanced/revanced-patches/issues/2491)) ([fe66f40](https://github.com/revanced/revanced-patches/commit/fe66f4089d6365564c8097d3c7a1bc842c343194))
|
||||
|
||||
# [2.179.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.178.1-dev.1...v2.179.0-dev.1) (2023-06-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **syncforreddit:** use correct overriding method signature ([#2483](https://github.com/revanced/revanced-patches/issues/2483)) ([f9770cf](https://github.com/revanced/revanced-patches/commit/f9770cf1babce61cd32f6ca9140103419d8d094d))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **infinityforreddit:** add `change-oauth-client-id` patch ([#2452](https://github.com/revanced/revanced-patches/issues/2452)) ([9efd790](https://github.com/revanced/revanced-patches/commit/9efd7904acc6dc70f45c6c0f835c839473d9205f))
|
||||
|
||||
## [2.178.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.178.0...v2.178.1-dev.1) (2023-06-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/client-spoof:** update settings text for known side effects of spoof signature ([#2476](https://github.com/revanced/revanced-patches/issues/2476)) ([6756f80](https://github.com/revanced/revanced-patches/commit/6756f80e3e0c09376a1fd613d28644bdaa24da57))
|
||||
|
||||
# [2.178.0](https://github.com/revanced/revanced-patches/compare/v2.177.0...v2.178.0) (2023-06-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **boostforreddit:** use correct options ([ec39732](https://github.com/revanced/revanced-patches/commit/ec39732a05f7c4c3360b8ba42fe50fd60952e6ac))
|
||||
* don't include all Litho patches, when not included ([fc69491](https://github.com/revanced/revanced-patches/commit/fc69491dfe4b119d46dd3da27b556e55fe0cecfb))
|
||||
* **googlerecorder/remove-device-restrictions:** add missing app constraint ([#2438](https://github.com/revanced/revanced-patches/issues/2438)) ([d5efe26](https://github.com/revanced/revanced-patches/commit/d5efe26f8959cde75dd3865ec3c2df4b05210e4a))
|
||||
* **youtube/comments:** add missing filter ([#2423](https://github.com/revanced/revanced-patches/issues/2423)) ([cab04b3](https://github.com/revanced/revanced-patches/commit/cab04b3a56cfc5bf00b7c6fcf6f86ab75aa5d4fd))
|
||||
* **youtube/hide-album-cards:** call correct integrations method ([0dbffaa](https://github.com/revanced/revanced-patches/commit/0dbffaae7d6dcb7050a9ea6e3c771839bcfdfbe1))
|
||||
* **youtube:** separate `hide-ads` to `hide-layout-components` patch ([7e0417f](https://github.com/revanced/revanced-patches/commit/7e0417f6728fa7b79a9d8cbcfd3ccba484a5567d))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **boostforreddit:** add `change-oauth-client-id` patch ([3dbc4bd](https://github.com/revanced/revanced-patches/commit/3dbc4bd49df1656893ef69c68550a2deb6a92cb7))
|
||||
* **google-recorder:** add `remove-device-restrictions` patch ([ef96ed1](https://github.com/revanced/revanced-patches/commit/ef96ed124e12091dde34124eabd8be9f2bb9280c))
|
||||
* **twitch:** 15.4.1 support ([#2462](https://github.com/revanced/revanced-patches/issues/2462)) ([826ed49](https://github.com/revanced/revanced-patches/commit/826ed49c7ca5a00e383b743f88f75dbfc00adb43))
|
||||
* **youtube-music:** remove version compatibility constraints ([276af14](https://github.com/revanced/revanced-patches/commit/276af1415a4d354c62fe6259b6559bca1fa84f08))
|
||||
* **youtube/hide-layout-components:** separate hiding expandable chips and chapters ([3fb1ce9](https://github.com/revanced/revanced-patches/commit/3fb1ce9f9af150b784e42aaf5b419bb123c08375))
|
||||
|
||||
# [2.178.0-dev.9](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.8...v2.178.0-dev.9) (2023-06-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **twitch:** 15.4.1 support ([#2462](https://github.com/revanced/revanced-patches/issues/2462)) ([826ed49](https://github.com/revanced/revanced-patches/commit/826ed49c7ca5a00e383b743f88f75dbfc00adb43))
|
||||
|
||||
# [2.178.0-dev.8](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.7...v2.178.0-dev.8) (2023-06-20)
|
||||
|
||||
|
||||
|
||||
98
README.md
98
README.md
@@ -119,13 +119,13 @@ The official ReVanced Patches.
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `auto-claim-channel-points` | Automatically claim Channel Points. | all |
|
||||
| `block-audio-ads` | Blocks audio ads in streams and VODs. | 14.6.1 |
|
||||
| `block-embedded-ads` | Blocks embedded stream ads using services like TTV.lol or PurpleAdBlocker. | 14.6.1 |
|
||||
| `block-video-ads` | Blocks video ads in streams and VODs. | 14.6.1 |
|
||||
| `auto-claim-channel-points` | Automatically claim Channel Points. | 15.4.1 |
|
||||
| `block-audio-ads` | Blocks audio ads in streams and VODs. | 15.4.1 |
|
||||
| `block-embedded-ads` | Blocks embedded stream ads using services like TTV.lol or PurpleAdBlocker. | 15.4.1 |
|
||||
| `block-video-ads` | Blocks video ads in streams and VODs. | 15.4.1 |
|
||||
| `debug-mode` | Enables Twitch's internal debugging mode. | all |
|
||||
| `settings` | Adds settings menu to Twitch. | all |
|
||||
| `show-deleted-messages` | Shows deleted chat messages behind a clickable spoiler. | all |
|
||||
| `show-deleted-messages` | Shows deleted chat messages behind a clickable spoiler. | 15.4.1 |
|
||||
</details>
|
||||
|
||||
### [📦 `com.twitter.android`](https://play.google.com/store/apps/details?id=com.twitter.android)
|
||||
@@ -204,12 +204,36 @@ The official ReVanced Patches.
|
||||
| `spoof-signature` | Spoofs the signature of the app. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `ml.docilealligator.infinityforreddit`](https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforreddit)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `free.reddit.news`](https://play.google.com/store/apps/details?id=free.reddit.news)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `reddit.news`](https://play.google.com/store/apps/details?id=reddit.news)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.rubenmayayo.reddit`](https://play.google.com/store/apps/details?id=com.rubenmayayo.reddit)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `change-oauth-client-id` | Changes the OAuth client ID in Boost for Reddit. | all |
|
||||
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.laurencedawson.reddit_sync.pro`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync.pro)
|
||||
@@ -220,6 +244,14 @@ The official ReVanced Patches.
|
||||
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.laurencedawson.reddit_sync.dev`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync.dev)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.myprog.hexedit`](https://play.google.com/store/apps/details?id=com.myprog.hexedit)
|
||||
<details>
|
||||
|
||||
@@ -340,12 +372,12 @@ The official ReVanced Patches.
|
||||
| `unlock-prime` | Unlocks Nova Prime and all functions of the app. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `tv.trakt.trakt`](https://play.google.com/store/apps/details?id=tv.trakt.trakt)
|
||||
### [📦 `com.candylink.openvpn`](https://play.google.com/store/apps/details?id=com.candylink.openvpn)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks pro features. | all |
|
||||
| `unlock-pro` | Unlocks premium features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.zombodroid.MemeGenerator`](https://play.google.com/store/apps/details?id=com.zombodroid.MemeGenerator)
|
||||
@@ -356,6 +388,22 @@ The official ReVanced Patches.
|
||||
| `unlock-pro` | Unlocks pro features. | 4.6377 |
|
||||
</details>
|
||||
|
||||
### [📦 `com.wakdev.apps.nfctools.se`](https://play.google.com/store/apps/details?id=com.wakdev.apps.nfctools.se)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.ithebk.expensemanager`](https://play.google.com/store/apps/details?id=com.ithebk.expensemanager)
|
||||
<details>
|
||||
|
||||
@@ -372,22 +420,6 @@ The official ReVanced Patches.
|
||||
| `unlock-pro` | Unlocks pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `org.totschnig.myexpenses`](https://play.google.com/store/apps/details?id=org.totschnig.myexpenses)
|
||||
<details>
|
||||
|
||||
@@ -396,7 +428,7 @@ The official ReVanced Patches.
|
||||
| `unlock-pro` | Unlocks all professional features. | 3.4.9 |
|
||||
</details>
|
||||
|
||||
### [📦 `com.wakdev.apps.nfctools.se`](https://play.google.com/store/apps/details?id=com.wakdev.apps.nfctools.se)
|
||||
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
@@ -404,6 +436,14 @@ The official ReVanced Patches.
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `tv.trakt.trakt`](https://play.google.com/store/apps/details?id=tv.trakt.trakt)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
|
||||
<details>
|
||||
|
||||
@@ -412,14 +452,6 @@ The official ReVanced Patches.
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.candylink.openvpn`](https://play.google.com/store/apps/details?id=com.candylink.openvpn)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks premium features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.ticktick.task`](https://play.google.com/store/apps/details?id=com.ticktick.task)
|
||||
<details>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("app.revanced:revanced-patcher:11.0.0")
|
||||
implementation("app.revanced:revanced-patcher:11.0.2")
|
||||
implementation("app.revanced:multidexlib2:2.5.3-a3836654")
|
||||
// Required for meta
|
||||
implementation("com.google.code.gson:gson:2.10.1")
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 2.178.0-dev.8
|
||||
version = 2.179.0-dev.6
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -14,29 +14,17 @@ import org.w3c.dom.Element
|
||||
@Version("0.0.1")
|
||||
class EnableAndroidDebuggingPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
if (debuggable == true) {
|
||||
context.xmlEditor["AndroidManifest.xml"].use { dom ->
|
||||
val applicationNode = dom
|
||||
.file
|
||||
.getElementsByTagName("application")
|
||||
.item(0) as Element
|
||||
context.xmlEditor["AndroidManifest.xml"].use { dom ->
|
||||
val applicationNode = dom
|
||||
.file
|
||||
.getElementsByTagName("application")
|
||||
.item(0) as Element
|
||||
|
||||
// set application as debuggable
|
||||
applicationNode.setAttribute("android:debuggable", "true")
|
||||
}
|
||||
// set application as debuggable
|
||||
applicationNode.setAttribute("android:debuggable", "true")
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
companion object : OptionsContainer() {
|
||||
var debuggable: Boolean? by option(
|
||||
PatchOption.BooleanOption(
|
||||
key = "debuggable",
|
||||
default = false,
|
||||
title = "App debugging",
|
||||
description = "Whether to make the app debuggable on Android.",
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package app.revanced.patches.reddit.customclients
|
||||
|
||||
import android.os.Environment
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||
import app.revanced.patcher.patch.*
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractChangeOAuthClientIdPatch(
|
||||
private val redirectUri: String,
|
||||
private val options: ChangeOAuthClientIdOptionsContainer,
|
||||
private val fingerprint: MethodFingerprint,
|
||||
) : BytecodePatch(listOf(fingerprint)) {
|
||||
private val fingerprints: List<MethodFingerprint>
|
||||
) : BytecodePatch(fingerprints) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
if (options.clientId == null) {
|
||||
// Test if on Android
|
||||
// Ensure device runs Android.
|
||||
try {
|
||||
Class.forName("android.os.Environment")
|
||||
} catch (e: ClassNotFoundException) {
|
||||
@@ -36,10 +38,10 @@ abstract class AbstractChangeOAuthClientIdPatch(
|
||||
}.let { options.clientId = it.readText().trim() }
|
||||
}
|
||||
|
||||
return fingerprint.patch(context)
|
||||
return fingerprints.map { it.result ?: throw it.toErrorResult() }.patch(context)
|
||||
}
|
||||
|
||||
abstract fun MethodFingerprint.patch(context: BytecodeContext): PatchResult
|
||||
abstract fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult
|
||||
|
||||
companion object Options {
|
||||
open class ChangeOAuthClientIdOptionsContainer : OptionsContainer() {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.revanced.patches.reddit.customclients
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Patch
|
||||
@Name("change-oauth-client-id")
|
||||
@Description("Changes the OAuth client ID.")
|
||||
annotation class ChangeOAuthClientIdPatchAnnotation
|
||||
@@ -1,34 +1,29 @@
|
||||
package app.revanced.patches.reddit.customclients.boostforreddit.api.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.*
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
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.MethodFingerprint
|
||||
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.Patch
|
||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
||||
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("change-oauth-client-id")
|
||||
@Description("Changes the OAuth client ID in Boost for Reddit.")
|
||||
@ChangeOAuthClientIdPatchAnnotation
|
||||
@Compatibility([Package("com.rubenmayayo.reddit")])
|
||||
@Version("0.0.1")
|
||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
||||
"http://rubenmayayo.com",
|
||||
Options,
|
||||
GetClientIdFingerprint
|
||||
"http://rubenmayayo.com", Options, listOf(GetClientIdFingerprint)
|
||||
) {
|
||||
override fun MethodFingerprint.patch(context: BytecodeContext): PatchResult {
|
||||
result?.mutableMethod?.addInstructions(
|
||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
||||
first().mutableMethod.addInstructions(
|
||||
0,
|
||||
"""
|
||||
"""
|
||||
const-string v0, "$clientId"
|
||||
return-object v0
|
||||
"""
|
||||
) ?: return toErrorResult()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
abstract class AbstractClientIdFingerprint(classTypeSuffix: String, methodName: String) : MethodFingerprint(
|
||||
strings = listOf("NOe2iKrPPzwscA"),
|
||||
customFingerprint = custom@{ methodDef, classDef ->
|
||||
if (!classDef.type.endsWith(classTypeSuffix)) return@custom false
|
||||
|
||||
methodDef.name == methodName
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,6 @@
|
||||
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
|
||||
|
||||
object GetHTTPBasicAuthHeaderFingerprint : AbstractClientIdFingerprint(
|
||||
"APIUtils;",
|
||||
"getHTTPBasicAuthHeader"
|
||||
)
|
||||
@@ -0,0 +1,6 @@
|
||||
package app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints
|
||||
|
||||
object LoginActivityOnCreateFingerprint : AbstractClientIdFingerprint(
|
||||
"LoginActivity;",
|
||||
"onCreate"
|
||||
)
|
||||
@@ -0,0 +1,41 @@
|
||||
package app.revanced.patches.reddit.customclients.infinityforreddit.api.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
||||
import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.GetHTTPBasicAuthHeaderFingerprint
|
||||
import app.revanced.patches.reddit.customclients.infinityforreddit.api.fingerprints.LoginActivityOnCreateFingerprint
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@ChangeOAuthClientIdPatchAnnotation
|
||||
@Compatibility([Package("ml.docilealligator.infinityforreddit")])
|
||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
||||
"infinity://localhost",
|
||||
Options,
|
||||
listOf(GetHTTPBasicAuthHeaderFingerprint, LoginActivityOnCreateFingerprint)
|
||||
) {
|
||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
||||
forEach {
|
||||
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||
it.mutableMethod.apply {
|
||||
val oAuthClientIdRegister = getInstruction<OneRegisterInstruction>(clientIdIndex).registerA
|
||||
|
||||
replaceInstruction(
|
||||
clientIdIndex,
|
||||
"const-string v$oAuthClientIdRegister, \"$clientId\""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
companion object Options : AbstractChangeOAuthClientIdPatch.Options.ChangeOAuthClientIdOptionsContainer()
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
abstract class AbstractClientIdFingerprint(string: String) : MethodFingerprint(
|
||||
strings = listOfNotNull("dj-xCIZQYiLbEg", string),
|
||||
)
|
||||
@@ -0,0 +1,3 @@
|
||||
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
|
||||
|
||||
object GetLoggedInBearerTokenFingerprint : AbstractClientIdFingerprint("authorization_code")
|
||||
@@ -0,0 +1,3 @@
|
||||
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
|
||||
|
||||
object GetLoggedOutBearerTokenFingerprint : AbstractClientIdFingerprint("https://oauth.reddit.com/grants/installed_client")
|
||||
@@ -0,0 +1,3 @@
|
||||
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
|
||||
|
||||
object GetRefreshTokenFingerprint : AbstractClientIdFingerprint("refresh_token")
|
||||
@@ -0,0 +1,3 @@
|
||||
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
|
||||
|
||||
object LoginActivityClientIdFingerprint : AbstractClientIdFingerprint("&duration=permanent")
|
||||
@@ -0,0 +1,48 @@
|
||||
package app.revanced.patches.reddit.customclients.relayforreddit.api.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
||||
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.LoginActivityClientIdFingerprint
|
||||
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetRefreshTokenFingerprint
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@ChangeOAuthClientIdPatchAnnotation
|
||||
@Compatibility([Package("free.reddit.news"), Package("reddit.news")])
|
||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
||||
"dbrady://relay",
|
||||
Options,
|
||||
listOf(
|
||||
LoginActivityClientIdFingerprint,
|
||||
GetLoggedInBearerTokenFingerprint,
|
||||
GetLoggedOutBearerTokenFingerprint,
|
||||
GetRefreshTokenFingerprint
|
||||
)
|
||||
) {
|
||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
||||
forEach {
|
||||
val clientIdIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||
it.mutableMethod.apply {
|
||||
val clientIdRegister = getInstruction<OneRegisterInstruction>(clientIdIndex).registerA
|
||||
|
||||
it.mutableMethod.replaceInstruction(
|
||||
clientIdIndex,
|
||||
"const-string v$clientIdRegister, \"$clientId\""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
companion object Options : AbstractChangeOAuthClientIdPatch.Options.ChangeOAuthClientIdOptionsContainer()
|
||||
}
|
||||
@@ -1,17 +1,18 @@
|
||||
package app.revanced.patches.reddit.customclients.syncforreddit.api.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.*
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
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.Patch
|
||||
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
|
||||
import app.revanced.patches.reddit.customclients.ChangeOAuthClientIdPatchAnnotation
|
||||
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetAuthorizationStringFingerprint
|
||||
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetBearerTokenFingerprint
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@@ -19,47 +20,50 @@ import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.reference.StringReference
|
||||
import java.util.*
|
||||
|
||||
@Patch
|
||||
@Name("change-oauth-client-id")
|
||||
@Description("Changes the OAuth client ID.")
|
||||
@Compatibility([Package("com.laurencedawson.reddit_sync"), Package("com.laurencedawson.reddit_sync.pro")])
|
||||
@Version("0.0.1")
|
||||
@ChangeOAuthClientIdPatchAnnotation
|
||||
@Compatibility(
|
||||
[
|
||||
Package("com.laurencedawson.reddit_sync"),
|
||||
Package("com.laurencedawson.reddit_sync.pro"),
|
||||
Package("com.laurencedawson.reddit_sync.dev")
|
||||
]
|
||||
)
|
||||
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
||||
"http://redditsync/auth",
|
||||
Options,
|
||||
GetAuthorizationStringFingerprint,
|
||||
"http://redditsync/auth", Options, listOf(GetAuthorizationStringFingerprint)
|
||||
) {
|
||||
override fun MethodFingerprint.patch(context: BytecodeContext): PatchResult {
|
||||
result?.also { result ->
|
||||
GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply {
|
||||
val auth = Base64.getEncoder().encodeToString("$clientId:".toByteArray(Charsets.UTF_8))
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
|
||||
forEach { fingerprintResult ->
|
||||
fingerprintResult.also { result ->
|
||||
GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply {
|
||||
val auth = Base64.getEncoder().encodeToString("$clientId:".toByteArray(Charsets.UTF_8))
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
const-string v0, "Basic $auth"
|
||||
return-object v0
|
||||
"""
|
||||
)
|
||||
} ?: return GetBearerTokenFingerprint.toErrorResult()
|
||||
}?.let {
|
||||
val occurrenceIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||
)
|
||||
} ?: return GetBearerTokenFingerprint.toErrorResult()
|
||||
}.let {
|
||||
val occurrenceIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||
|
||||
it.mutableMethod.apply {
|
||||
val authorizationStringInstruction = getInstruction<ReferenceInstruction>(occurrenceIndex)
|
||||
val targetRegister = (authorizationStringInstruction as OneRegisterInstruction).registerA
|
||||
val reference = authorizationStringInstruction.reference as StringReference
|
||||
it.mutableMethod.apply {
|
||||
val authorizationStringInstruction = getInstruction<ReferenceInstruction>(occurrenceIndex)
|
||||
val targetRegister = (authorizationStringInstruction as OneRegisterInstruction).registerA
|
||||
val reference = authorizationStringInstruction.reference as StringReference
|
||||
|
||||
val newAuthorizationUrl = reference.string.replace(
|
||||
"client_id=.*?&".toRegex(),
|
||||
"client_id=$clientId&"
|
||||
)
|
||||
val newAuthorizationUrl = reference.string.replace(
|
||||
"client_id=.*?&".toRegex(),
|
||||
"client_id=$clientId&"
|
||||
)
|
||||
|
||||
replaceInstruction(
|
||||
occurrenceIndex,
|
||||
"const-string v$targetRegister, \"$newAuthorizationUrl\""
|
||||
)
|
||||
replaceInstruction(
|
||||
occurrenceIndex,
|
||||
"const-string v$targetRegister, \"$newAuthorizationUrl\""
|
||||
)
|
||||
}
|
||||
}
|
||||
} ?: return toErrorResult()
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import org.w3c.dom.Node
|
||||
import java.io.Closeable
|
||||
|
||||
/**
|
||||
* Abstract settings resource patch
|
||||
@@ -24,7 +25,7 @@ import org.w3c.dom.Node
|
||||
abstract class AbstractSettingsResourcePatch(
|
||||
private val preferenceFileName: String,
|
||||
private val sourceDirectory: String,
|
||||
) : ResourcePatch {
|
||||
) : ResourcePatch, Closeable {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
/*
|
||||
* used for self-restart
|
||||
|
||||
@@ -3,20 +3,7 @@ package app.revanced.patches.twitch.ad.audio.annotations
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[
|
||||
Package(
|
||||
"tv.twitch.android.app", arrayOf(
|
||||
"14.3.3",
|
||||
"14.4.0",
|
||||
"14.5.0",
|
||||
"14.5.2",
|
||||
"14.6.0",
|
||||
"14.6.1"
|
||||
)
|
||||
)
|
||||
]
|
||||
)
|
||||
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1"))])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class AudioAdsCompatibility
|
||||
|
||||
|
||||
@@ -3,20 +3,7 @@ package app.revanced.patches.twitch.ad.embedded.annotations
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[
|
||||
Package(
|
||||
"tv.twitch.android.app", arrayOf(
|
||||
"14.3.3",
|
||||
"14.4.0",
|
||||
"14.5.0",
|
||||
"14.5.2",
|
||||
"14.6.0",
|
||||
"14.6.1"
|
||||
)
|
||||
)
|
||||
]
|
||||
)
|
||||
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1"))])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class EmbeddedAdsCompatibility
|
||||
|
||||
|
||||
@@ -3,20 +3,7 @@ package app.revanced.patches.twitch.ad.video.annotations
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[
|
||||
Package(
|
||||
"tv.twitch.android.app", arrayOf(
|
||||
"14.3.3",
|
||||
"14.4.0",
|
||||
"14.5.0",
|
||||
"14.5.2",
|
||||
"14.6.0",
|
||||
"14.6.1"
|
||||
)
|
||||
)
|
||||
]
|
||||
)
|
||||
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1"))])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class VideoAdsCompatibility
|
||||
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package app.revanced.patches.twitch.ad.video.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object CheckAdEligibilityLambdaFingerprint : MethodFingerprint(
|
||||
"L",
|
||||
AccessFlags.PRIVATE or AccessFlags.FINAL or AccessFlags.STATIC,
|
||||
listOf("L", "L", "L"),
|
||||
returnType = "Lio/reactivex/Single;",
|
||||
parameters = listOf("L"),
|
||||
customFingerprint = { method, _ ->
|
||||
method.definingClass.endsWith("AdEligibilityFetcher;") &&
|
||||
method.name.contains("shouldRequestAd")
|
||||
method.definingClass.endsWith("/AdEligibilityFetcher;")
|
||||
&& method.name == "shouldRequestAd"
|
||||
}
|
||||
)
|
||||
@@ -1,10 +1,11 @@
|
||||
package app.revanced.patches.twitch.ad.video.fingerprints
|
||||
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object ContentConfigShowAdsFingerprint : MethodFingerprint(
|
||||
returnType = "Z",
|
||||
parameters = listOf(),
|
||||
customFingerprint = { method, _ ->
|
||||
method.definingClass.endsWith("ContentConfigData;") && method.name == "getShowAds"
|
||||
method.definingClass.endsWith("/ContentConfigData;") && method.name == "getShowAds"
|
||||
}
|
||||
)
|
||||
@@ -3,6 +3,8 @@ package app.revanced.patches.twitch.ad.video.fingerprints
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object GetReadyToShowAdFingerprint : MethodFingerprint(
|
||||
returnType = "Ltv/twitch/android/core/mvp/presenter/StateAndAction;",
|
||||
parameters = listOf("L", "L"),
|
||||
customFingerprint = { method, _ ->
|
||||
method.definingClass.endsWith("/StreamDisplayAdsPresenter;") && method.name == "getReadyToShowAdOrAbort"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.twitch.ad.video.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
@@ -86,7 +87,7 @@ class VideoAdsPatch : AbstractAdPatch(
|
||||
)
|
||||
|
||||
// Pretend our player is ineligible for all ads
|
||||
with(CheckAdEligibilityLambdaFingerprint.result!!) {
|
||||
CheckAdEligibilityLambdaFingerprint.result?.apply {
|
||||
mutableMethod.addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
@@ -98,9 +99,9 @@ class VideoAdsPatch : AbstractAdPatch(
|
||||
""",
|
||||
ExternalLabel(skipLabelName, mutableMethod.getInstruction(0))
|
||||
)
|
||||
}
|
||||
} ?: return CheckAdEligibilityLambdaFingerprint.toErrorResult()
|
||||
|
||||
with(GetReadyToShowAdFingerprint.result!!) {
|
||||
GetReadyToShowAdFingerprint.result?.apply {
|
||||
val adFormatDeclined = "Ltv/twitch/android/shared/display/ads/theatre/StreamDisplayAdsPresenter\$Action\$AdFormatDeclined;"
|
||||
mutableMethod.addInstructionsWithLabels(
|
||||
0,
|
||||
@@ -113,10 +114,10 @@ class VideoAdsPatch : AbstractAdPatch(
|
||||
""",
|
||||
ExternalLabel(skipLabelName, mutableMethod.getInstruction(0))
|
||||
)
|
||||
}
|
||||
} ?: return GetReadyToShowAdFingerprint.toErrorResult()
|
||||
|
||||
// Spoof showAds JSON field
|
||||
with(ContentConfigShowAdsFingerprint.result!!) {
|
||||
ContentConfigShowAdsFingerprint.result?.apply {
|
||||
mutableMethod.addInstructions(0, """
|
||||
${createConditionInstructions()}
|
||||
const/4 v0, 0
|
||||
@@ -124,7 +125,7 @@ class VideoAdsPatch : AbstractAdPatch(
|
||||
return v0
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: return ContentConfigShowAdsFingerprint.toErrorResult()
|
||||
|
||||
SettingsPatch.PreferenceScreen.ADS.CLIENT_SIDE.addPreferences(
|
||||
SwitchPreference(
|
||||
|
||||
@@ -3,7 +3,7 @@ package app.revanced.patches.twitch.chat.antidelete.annotations
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility([Package("tv.twitch.android.app")])
|
||||
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1"))])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class ShowDeletedMessagesCompatibility
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.twitch.chat.antidelete.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
@@ -44,7 +45,7 @@ class ShowDeletedMessagesPatch : BytecodePatch(
|
||||
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
// Spoiler mode: Force set hasModAccess member to true in constructor
|
||||
DeletedMessageClickableSpanCtorFingerprint.result!!.mutableMethod.apply {
|
||||
DeletedMessageClickableSpanCtorFingerprint.result?.mutableMethod?.apply {
|
||||
addInstructionsWithLabels(
|
||||
implementation!!.instructions.lastIndex, /* place in front of return-void */
|
||||
"""
|
||||
@@ -54,14 +55,14 @@ class ShowDeletedMessagesPatch : BytecodePatch(
|
||||
""",
|
||||
ExternalLabel("no_spoiler", getInstruction(implementation!!.instructions.lastIndex))
|
||||
)
|
||||
}
|
||||
} ?: return DeletedMessageClickableSpanCtorFingerprint.toErrorResult()
|
||||
|
||||
// Spoiler mode: Disable setHasModAccess setter
|
||||
SetHasModAccessFingerprint.result!!.mutableMethod.addInstruction(0, "return-void")
|
||||
|
||||
SetHasModAccessFingerprint.result?.mutableMethod?.addInstruction(0, "return-void")
|
||||
?: return SetHasModAccessFingerprint.toErrorResult()
|
||||
|
||||
// Cross-out mode: Reformat span of deleted message
|
||||
ChatUtilCreateDeletedSpanFingerprint.result!!.mutableMethod.apply {
|
||||
ChatUtilCreateDeletedSpanFingerprint.result?.mutableMethod?.apply {
|
||||
addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
@@ -72,7 +73,7 @@ class ShowDeletedMessagesPatch : BytecodePatch(
|
||||
""",
|
||||
ExternalLabel("no_reformat", getInstruction(0))
|
||||
)
|
||||
}
|
||||
} ?: return ChatUtilCreateDeletedSpanFingerprint.toErrorResult()
|
||||
|
||||
SettingsPatch.PreferenceScreen.CHAT.GENERAL.addPreferences(
|
||||
ListPreference(
|
||||
|
||||
@@ -3,6 +3,6 @@ package app.revanced.patches.twitch.chat.autoclaim.annotations
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility([Package("tv.twitch.android.app")])
|
||||
@Compatibility([Package("tv.twitch.android.app", arrayOf("15.4.1"))])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class AutoClaimChannelPointsCompatibility
|
||||
@@ -65,6 +65,7 @@ class AutoClaimChannelPointPatch : BytecodePatch(
|
||||
ExternalLabel("auto_claim", getInstruction(lastIndex))
|
||||
)
|
||||
} ?: return CommunityPointsButtonViewDelegateFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package app.revanced.patches.twitch.debug.fingerprints
|
||||
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object IsDebugConfigEnabledFingerprint : MethodFingerprint(
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isDebugConfigEnabled"
|
||||
methodDef.definingClass.endsWith("/BuildConfigUtil;") && methodDef.name == "isDebugConfigEnabled"
|
||||
}
|
||||
)
|
||||
@@ -1,10 +1,9 @@
|
||||
package app.revanced.patches.twitch.debug.fingerprints
|
||||
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object IsOmVerificationEnabledFingerprint : MethodFingerprint(
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isOmVerificationEnabled"
|
||||
methodDef.definingClass.endsWith("/BuildConfigUtil;") && methodDef.name == "isOmVerificationEnabled"
|
||||
}
|
||||
)
|
||||
@@ -1,10 +1,9 @@
|
||||
package app.revanced.patches.twitch.debug.fingerprints
|
||||
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object ShouldShowDebugOptionsFingerprint : MethodFingerprint(
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "shouldShowDebugOptions"
|
||||
methodDef.definingClass.endsWith("/BuildConfigUtil;") && methodDef.name == "shouldShowDebugOptions"
|
||||
}
|
||||
)
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.twitch.debug.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
@@ -38,18 +39,16 @@ class DebugModePatch : BytecodePatch(
|
||||
IsOmVerificationEnabledFingerprint,
|
||||
ShouldShowDebugOptionsFingerprint
|
||||
).forEach {
|
||||
with(it.result!!) {
|
||||
with(mutableMethod) {
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
invoke-static {}, Lapp/revanced/twitch/patches/DebugModePatch;->isDebugModeEnabled()Z
|
||||
move-result v0
|
||||
return v0
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
it.result?.mutableMethod?.apply {
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
invoke-static {}, Lapp/revanced/twitch/patches/DebugModePatch;->isDebugModeEnabled()Z
|
||||
move-result v0
|
||||
return v0
|
||||
"""
|
||||
)
|
||||
} ?: return it.toErrorResult()
|
||||
}
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.OTHER.addPreferences(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.twitch.misc.settings.bytecode.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
@@ -28,6 +29,7 @@ import app.revanced.patches.twitch.misc.settings.fingerprints.SettingsMenuItemEn
|
||||
import app.revanced.patches.twitch.misc.settings.resource.patch.SettingsResourcePatch
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.immutable.ImmutableField
|
||||
import java.io.Closeable
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, SettingsResourcePatch::class])
|
||||
@@ -42,10 +44,10 @@ class SettingsPatch : BytecodePatch(
|
||||
MenuGroupsUpdatedFingerprint,
|
||||
MenuGroupsOnClickFingerprint
|
||||
)
|
||||
) {
|
||||
), Closeable {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
// Hook onCreate to handle fragment creation
|
||||
with(SettingsActivityOnCreateFingerprint.result!!) {
|
||||
SettingsActivityOnCreateFingerprint.result?.apply {
|
||||
val insertIndex = mutableMethod.implementation!!.instructions.size - 2
|
||||
mutableMethod.addInstructionsWithLabels(
|
||||
insertIndex,
|
||||
@@ -57,20 +59,20 @@ class SettingsPatch : BytecodePatch(
|
||||
""",
|
||||
ExternalLabel("no_rv_settings_init", mutableMethod.getInstruction(insertIndex))
|
||||
)
|
||||
}
|
||||
} ?: return SettingsActivityOnCreateFingerprint.toErrorResult()
|
||||
|
||||
// Create new menu item for settings menu
|
||||
with(SettingsMenuItemEnumFingerprint.result!!) {
|
||||
SettingsMenuItemEnumFingerprint.result?.apply {
|
||||
injectMenuItem(
|
||||
REVANCED_SETTINGS_MENU_ITEM_NAME,
|
||||
REVANCED_SETTINGS_MENU_ITEM_ID,
|
||||
REVANCED_SETTINGS_MENU_ITEM_TITLE_RES,
|
||||
REVANCED_SETTINGS_MENU_ITEM_ICON_RES
|
||||
)
|
||||
}
|
||||
} ?: return SettingsMenuItemEnumFingerprint.toErrorResult()
|
||||
|
||||
// Intercept settings menu creation and add new menu item
|
||||
with(MenuGroupsUpdatedFingerprint.result!!) {
|
||||
MenuGroupsUpdatedFingerprint.result?.apply {
|
||||
mutableMethod.addInstructions(
|
||||
0,
|
||||
"""
|
||||
@@ -79,10 +81,10 @@ class SettingsPatch : BytecodePatch(
|
||||
move-result-object p1
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: return MenuGroupsUpdatedFingerprint.toErrorResult()
|
||||
|
||||
// Intercept onclick events for the settings menu
|
||||
with(MenuGroupsOnClickFingerprint.result!!) {
|
||||
MenuGroupsOnClickFingerprint.result?.apply {
|
||||
val insertIndex = 0
|
||||
mutableMethod.addInstructionsWithLabels(
|
||||
insertIndex,
|
||||
@@ -96,7 +98,7 @@ class SettingsPatch : BytecodePatch(
|
||||
""",
|
||||
ExternalLabel("no_rv_settings_onclick", mutableMethod.getInstruction(insertIndex))
|
||||
)
|
||||
}
|
||||
} ?: return MenuGroupsOnClickFingerprint.toErrorResult()
|
||||
|
||||
addString("revanced_settings", "ReVanced Settings", false)
|
||||
addString("revanced_reboot_message", "Twitch needs to restart to apply your changes. Restart now?", false)
|
||||
|
||||
@@ -9,7 +9,6 @@ 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.all.misc.debugging.patch.EnableAndroidDebuggingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.debugging.annotations.DebuggingCompatibility
|
||||
@@ -18,7 +17,7 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
@Patch
|
||||
@Name("enable-debugging")
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, EnableAndroidDebuggingPatch::class])
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||
@Description("Adds debugging options.")
|
||||
@DebuggingCompatibility
|
||||
@Version("0.0.2")
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object SubtitleWindowSettingsConstructorFingerprint : MethodFingerprint(
|
||||
parameters = listOf("I", "I", "I", "Z", "Z"),
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass == "Lcom/google/android/libraries/youtube/player/subtitles/model/SubtitleWindowSettings;"
|
||||
&& methodDef.name == "<init>"
|
||||
}
|
||||
)
|
||||
@@ -17,11 +17,9 @@ import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.OpenCronetDataSourceFingerprint
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ProtobufParameterBuilderFingerprint
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.SubtitleWindowSettingsConstructorFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.videoid.patch.VideoIdPatch
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Name("spoof-signature-verification")
|
||||
@@ -30,14 +28,12 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
VideoIdPatch::class
|
||||
])
|
||||
@Version("0.0.1")
|
||||
class SpoofSignatureVerificationPatch : BytecodePatch(
|
||||
listOf(
|
||||
ProtobufParameterBuilderFingerprint,
|
||||
OpenCronetDataSourceFingerprint,
|
||||
SubtitleWindowSettingsConstructorFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
@@ -48,7 +44,8 @@ class SpoofSignatureVerificationPatch : BytecodePatch(
|
||||
StringResource("revanced_spoof_signature_verification_summary_on",
|
||||
"App signature spoofed\\n\\n"
|
||||
+ "Side effects include:\\n"
|
||||
+ "• End screen cards are always hidden\\n"
|
||||
+ "• Ambient mode may not work\\n"
|
||||
+ "• Seekbar thumbnails are hidden\\n"
|
||||
+ "• Downloading videos may not work"),
|
||||
StringResource("revanced_spoof_signature_verification_summary_off", "App signature not spoofed"),
|
||||
StringResource("revanced_spoof_signature_verification_user_dialog_message",
|
||||
@@ -56,9 +53,6 @@ class SpoofSignatureVerificationPatch : BytecodePatch(
|
||||
)
|
||||
)
|
||||
|
||||
// Hook video id, required for subtitle fix.
|
||||
VideoIdPatch.injectCall("$INTEGRATIONS_CLASS_DESCRIPTOR->setCurrentVideoId(Ljava/lang/String;)V")
|
||||
|
||||
// hook parameter
|
||||
ProtobufParameterBuilderFingerprint.result?.let {
|
||||
val setParamMethod = context
|
||||
@@ -95,25 +89,6 @@ class SpoofSignatureVerificationPatch : BytecodePatch(
|
||||
|
||||
} ?: return OpenCronetDataSourceFingerprint.toErrorResult()
|
||||
|
||||
// hook override subtitles
|
||||
SubtitleWindowSettingsConstructorFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
invoke-static {p1, p2, p3, p4, p5}, $INTEGRATIONS_CLASS_DESCRIPTOR->getSubtitleWindowSettingsOverride(IIIZZ)[I
|
||||
move-result-object v0
|
||||
const/4 v1, 0x0
|
||||
aget p1, v0, v1 # ap, anchor position
|
||||
const/4 v1, 0x1
|
||||
aget p2, v0, v1 # ah, horizontal anchor
|
||||
const/4 v1, 0x2
|
||||
aget p3, v0, v1 # av, vertical anchor
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: return SubtitleWindowSettingsConstructorFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
|
||||
@@ -9,12 +9,13 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patches.youtube.misc.playercontrols.annotation.PlayerControlsCompatibility
|
||||
import java.io.Closeable
|
||||
|
||||
@Name("bottom-controls-resource-patch")
|
||||
@Description("Manages the resources for the bottom controls of the YouTube player.")
|
||||
@PlayerControlsCompatibility
|
||||
@Version("0.0.1")
|
||||
class BottomControlsResourcePatch : ResourcePatch {
|
||||
class BottomControlsResourcePatch : ResourcePatch, Closeable {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
resourceContext = context
|
||||
targetXmlEditor = context.xmlEditor[TARGET_RESOURCE]
|
||||
|
||||
@@ -22,6 +22,7 @@ import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsResourc
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import org.jf.dexlib2.util.MethodUtil
|
||||
import java.io.Closeable
|
||||
|
||||
@DependsOn([IntegrationsPatch::class, SettingsResourcePatch::class, ])
|
||||
@Name("settings")
|
||||
@@ -29,7 +30,7 @@ import org.jf.dexlib2.util.MethodUtil
|
||||
@Version("0.0.1")
|
||||
class SettingsPatch : BytecodePatch(
|
||||
listOf(LicenseActivityFingerprint, SetThemeFingerprint)
|
||||
) {
|
||||
), Closeable {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
// TODO: Remove this when it is only required at one place.
|
||||
fun getSetThemeInstructionString(
|
||||
|
||||
Reference in New Issue
Block a user