mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-11 20:03:55 +01:00
Compare commits
8 Commits
v2.178.0-d
...
v2.178.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46f2ca230b | ||
|
|
08cfd81362 | ||
|
|
e23ce108f0 | ||
|
|
fc7db5c672 | ||
|
|
920bfea952 | ||
|
|
1c95e0fcad | ||
|
|
7f1b70e625 | ||
|
|
d30797f9b8 |
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,3 +1,31 @@
|
|||||||
|
# [2.178.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.5...v2.178.0-dev.6) (2023-06-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/hide-album-cards:** call correct integrations method ([0dbffaa](https://github.com/revanced/revanced-patches/commit/0dbffaae7d6dcb7050a9ea6e3c771839bcfdfbe1))
|
||||||
|
|
||||||
|
# [2.178.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.4...v2.178.0-dev.5) (2023-06-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube/hide-layout-components:** separate hiding expandable chips and chapters ([3fb1ce9](https://github.com/revanced/revanced-patches/commit/3fb1ce9f9af150b784e42aaf5b419bb123c08375))
|
||||||
|
|
||||||
|
# [2.178.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.3...v2.178.0-dev.4) (2023-06-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **boostforreddit:** add `change-oauth-client-id` patch ([3dbc4bd](https://github.com/revanced/revanced-patches/commit/3dbc4bd49df1656893ef69c68550a2deb6a92cb7))
|
||||||
|
|
||||||
|
# [2.178.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.2...v2.178.0-dev.3) (2023-06-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/comments:** add missing filter ([#2423](https://github.com/revanced/revanced-patches/issues/2423)) ([cab04b3](https://github.com/revanced/revanced-patches/commit/cab04b3a56cfc5bf00b7c6fcf6f86ab75aa5d4fd))
|
||||||
|
|
||||||
# [2.178.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.1...v2.178.0-dev.2) (2023-06-16)
|
# [2.178.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.1...v2.178.0-dev.2) (2023-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -205,6 +205,14 @@ The official ReVanced Patches.
|
|||||||
| `spoof-signature` | Spoofs the signature of the app. | all |
|
| `spoof-signature` | Spoofs the signature of the app. | all |
|
||||||
</details>
|
</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 |
|
||||||
|
</details>
|
||||||
|
|
||||||
### [📦 `com.laurencedawson.reddit_sync.pro`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync.pro)
|
### [📦 `com.laurencedawson.reddit_sync.pro`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync.pro)
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.178.0-dev.2
|
version = 2.178.0-dev.6
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,57 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients
|
||||||
|
|
||||||
|
import android.os.Environment
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.patch.*
|
||||||
|
import app.revanced.patches.reddit.customclients.boostforreddit.api.patch.ChangeOAuthClientIdPatch
|
||||||
|
import app.revanced.patches.reddit.customclients.syncforreddit.api.patch.ChangeOAuthClientIdPatch.Companion.clientId
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
abstract class AbstractChangeOAuthClientIdPatch(
|
||||||
|
private val redirectUri: String,
|
||||||
|
private val fingerprint: MethodFingerprint,
|
||||||
|
) : BytecodePatch(listOf(fingerprint)) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
if (ChangeOAuthClientIdPatch.clientId == null) {
|
||||||
|
// Test if on Android
|
||||||
|
try {
|
||||||
|
Class.forName("android.os.Environment")
|
||||||
|
} catch (e: ClassNotFoundException) {
|
||||||
|
return PatchResultError("No client ID provided")
|
||||||
|
}
|
||||||
|
|
||||||
|
File(Environment.getExternalStorageDirectory(), "reddit_client_id_revanced.txt").also {
|
||||||
|
if (it.exists()) return@also
|
||||||
|
|
||||||
|
val error = """
|
||||||
|
In order to use this patch, you need to provide a client ID.
|
||||||
|
You can do this by creating a file at ${it.absolutePath} with the client ID as its content.
|
||||||
|
Alternatively, you can provide the client ID using patch options.
|
||||||
|
|
||||||
|
You can get your client ID from https://www.reddit.com/prefs/apps.
|
||||||
|
The application type has to be "installed app" and the redirect URI has to be set to "$redirectUri"
|
||||||
|
""".trimIndent()
|
||||||
|
|
||||||
|
return PatchResultError(error)
|
||||||
|
}.let { clientId = it.readText().trim() }
|
||||||
|
}
|
||||||
|
|
||||||
|
return fingerprint.patch(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract fun MethodFingerprint.patch(context: BytecodeContext): PatchResult
|
||||||
|
|
||||||
|
companion object Options {
|
||||||
|
open class ChangeOAuthClientIdOptionsContainer : OptionsContainer() {
|
||||||
|
var clientId by option(
|
||||||
|
PatchOption.StringOption(
|
||||||
|
"client-id",
|
||||||
|
null,
|
||||||
|
"OAuth client ID",
|
||||||
|
"The Reddit OAuth client ID."
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object GetClientIdFingerprint : MethodFingerprint(
|
||||||
|
customFingerprint = custom@{ methodDef, classDef ->
|
||||||
|
if (!classDef.type.endsWith("Credentials;")) return@custom false
|
||||||
|
|
||||||
|
methodDef.name == "getClientId"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.boostforreddit.api.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.toErrorResult
|
||||||
|
import app.revanced.patcher.annotation.*
|
||||||
|
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.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.boostforreddit.api.fingerprints.GetClientIdFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("change-oauth-client-id")
|
||||||
|
@Description("Changes the OAuth client ID in Boost for Reddit.")
|
||||||
|
@Compatibility([Package("com.rubenmayayo.reddit")])
|
||||||
|
@Version("0.0.1")
|
||||||
|
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
||||||
|
"http://rubenmayayo.com",
|
||||||
|
GetClientIdFingerprint
|
||||||
|
) {
|
||||||
|
override fun MethodFingerprint.patch(context: BytecodeContext): PatchResult {
|
||||||
|
result?.mutableMethod?.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const-string v0, "$clientId"
|
||||||
|
return-object v0
|
||||||
|
"""
|
||||||
|
) ?: return toErrorResult()
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object : Options.ChangeOAuthClientIdOptionsContainer()
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.syncforreddit.ads.fingerprints
|
package app.revanced.patches.reddit.customclients.syncforreddit.ads.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.syncforreddit.ads.patch
|
package app.revanced.patches.reddit.customclients.syncforreddit.ads.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.toErrorResult
|
||||||
import app.revanced.patcher.annotation.*
|
import app.revanced.patcher.annotation.*
|
||||||
@@ -9,8 +9,8 @@ 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.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.syncforreddit.ads.fingerprints.IsAdsEnabledFingerprint
|
import app.revanced.patches.reddit.customclients.syncforreddit.ads.fingerprints.IsAdsEnabledFingerprint
|
||||||
import app.revanced.patches.syncforreddit.detection.piracy.patch.DisablePiracyDetectionPatch
|
import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.patch.DisablePiracyDetectionPatch
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("disable-ads")
|
@Name("disable-ads")
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.syncforreddit.api.fingerprints
|
package app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.syncforreddit.api.fingerprints
|
package app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.syncforreddit.api.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.toErrorResult
|
||||||
|
import app.revanced.patcher.annotation.*
|
||||||
|
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.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.syncforreddit.api.fingerprints.GetAuthorizationStringFingerprint
|
||||||
|
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetBearerTokenFingerprint
|
||||||
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
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")
|
||||||
|
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
|
||||||
|
"http://redditsync/auth",
|
||||||
|
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,
|
||||||
|
"""
|
||||||
|
const-string v0, "Basic $auth"
|
||||||
|
return-object v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
} ?: 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
|
||||||
|
|
||||||
|
val newAuthorizationUrl = reference.string.replace(
|
||||||
|
"client_id=.*?&".toRegex(),
|
||||||
|
"client_id=${clientId!!}&"
|
||||||
|
)
|
||||||
|
|
||||||
|
replaceInstruction(
|
||||||
|
occurrenceIndex,
|
||||||
|
"const-string v$targetRegister, \"$newAuthorizationUrl\""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} ?: return toErrorResult()
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object : Options.ChangeOAuthClientIdOptionsContainer()
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.syncforreddit.detection.piracy.patch
|
package app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.toErrorResult
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
package app.revanced.patches.syncforreddit.api.patch
|
|
||||||
|
|
||||||
import android.os.Environment
|
|
||||||
import app.revanced.patcher.annotation.*
|
|
||||||
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.Companion.resolve
|
|
||||||
import app.revanced.patcher.patch.*
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.syncforreddit.api.fingerprints.GetAuthorizationStringFingerprint
|
|
||||||
import app.revanced.patches.syncforreddit.api.fingerprints.GetBearerTokenFingerprint
|
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
|
||||||
import org.jf.dexlib2.iface.reference.StringReference
|
|
||||||
import java.io.File
|
|
||||||
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")
|
|
||||||
class ChangeOAuthClientIdPatch : BytecodePatch(
|
|
||||||
listOf(GetAuthorizationStringFingerprint)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
if (clientId == null) {
|
|
||||||
// Test if on Android
|
|
||||||
try {
|
|
||||||
Class.forName("android.os.Environment")
|
|
||||||
} catch (e: ClassNotFoundException) {
|
|
||||||
return PatchResultError("No client ID provided")
|
|
||||||
}
|
|
||||||
|
|
||||||
File(Environment.getExternalStorageDirectory(), "reddit_client_id_revanced.txt").also {
|
|
||||||
if (it.exists()) return@also
|
|
||||||
|
|
||||||
val error = """
|
|
||||||
In order to use this patch, you need to provide a client ID.
|
|
||||||
You can do this by creating a file at ${it.absolutePath} with the client ID as its content.
|
|
||||||
Alternatively, you can provide the client ID using patch options.
|
|
||||||
|
|
||||||
You can get your client ID from https://www.reddit.com/prefs/apps.
|
|
||||||
The application type has to be "installed app" and the redirect URI has to be set to "http://redditsync/auth"
|
|
||||||
""".trimIndent()
|
|
||||||
|
|
||||||
return PatchResultError(error)
|
|
||||||
}.let { clientId = it.readText().trim() }
|
|
||||||
}
|
|
||||||
|
|
||||||
GetAuthorizationStringFingerprint.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,
|
|
||||||
"""
|
|
||||||
const-string v0, "Basic $auth"
|
|
||||||
return-object v0
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
} ?: return PatchResultError("Could not find required method to patch.")
|
|
||||||
}?.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
|
|
||||||
|
|
||||||
val newAuthorizationUrl = reference.string.replace(
|
|
||||||
"client_id=.*?&".toRegex(),
|
|
||||||
"client_id=${clientId!!}&"
|
|
||||||
)
|
|
||||||
|
|
||||||
replaceInstruction(
|
|
||||||
occurrenceIndex,
|
|
||||||
"const-string v$targetRegister, \"$newAuthorizationUrl\""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} ?: return PatchResultError("Could not find required method to patch.")
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object : OptionsContainer() {
|
|
||||||
var clientId by option(
|
|
||||||
PatchOption.StringOption(
|
|
||||||
"client-id",
|
|
||||||
null,
|
|
||||||
"OAuth client ID",
|
|
||||||
"The client ID to use for OAuth."
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -42,7 +42,7 @@ class AlbumCardsPatch : BytecodePatch(
|
|||||||
"invoke-static {v$albumCardViewRegister}, " +
|
"invoke-static {v$albumCardViewRegister}, " +
|
||||||
"Lapp/revanced/integrations/patches/HideAlbumCardsPatch;" +
|
"Lapp/revanced/integrations/patches/HideAlbumCardsPatch;" +
|
||||||
"->" +
|
"->" +
|
||||||
"hideAlbumCards(Landroid/view/View;)V"
|
"hideAlbumCard(Landroid/view/View;)V"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: return AlbumCardsFingerprint.toErrorResult()
|
} ?: return AlbumCardsFingerprint.toErrorResult()
|
||||||
|
|||||||
@@ -9,21 +9,23 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
|||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
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.StringResource
|
||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
import app.revanced.patches.youtube.layout.hide.comments.annotations.HideCommentsCompatibility
|
import app.revanced.patches.youtube.layout.hide.comments.annotations.HideCommentsCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("comments")
|
@Name("comments")
|
||||||
@Description("Hides components related to comments.")
|
@Description("Hides components related to comments.")
|
||||||
@HideCommentsCompatibility
|
@HideCommentsCompatibility
|
||||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
@DependsOn([SettingsPatch::class, LithoFilterPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class CommentsPatch : ResourcePatch {
|
class CommentsPatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||||
|
|
||||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||||
PreferenceScreen(
|
PreferenceScreen(
|
||||||
"revanced_comments_preference_screen",
|
"revanced_comments_preference_screen",
|
||||||
@@ -48,4 +50,8 @@ class CommentsPatch : ResourcePatch {
|
|||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private companion object {
|
||||||
|
const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/components/CommentsFilter;"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -45,18 +45,33 @@ class HideLayoutComponentsPatch : ResourcePatch {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_hide_chapter_teaser",
|
"revanced_hide_expandable_chip",
|
||||||
StringResource(
|
StringResource(
|
||||||
"revanced_hide_chapter_teaser_title",
|
"revanced_hide_expandable_chip_title",
|
||||||
"Hide chapter teaser under videos"
|
"Hide the expandable chip under videos"
|
||||||
),
|
),
|
||||||
StringResource(
|
StringResource(
|
||||||
"revanced_hide_chapter_teaser_summary_on",
|
"revanced_hide_expandable_chip_summary_on",
|
||||||
"Chapter teasers are hidden"
|
"Expandable chips are hidden"
|
||||||
),
|
),
|
||||||
StringResource(
|
StringResource(
|
||||||
"revanced_hide_chapter_teaser_summary_off",
|
"revanced_hide_expandable_chip_summary_off",
|
||||||
"Chapter teasers are shown"
|
"Expandable chips are shown"
|
||||||
|
)
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_hide_chapters",
|
||||||
|
StringResource(
|
||||||
|
"revanced_hide_chapters_title",
|
||||||
|
"Hide chapters in the video description"
|
||||||
|
),
|
||||||
|
StringResource(
|
||||||
|
"revanced_hide_chapters_summary_on",
|
||||||
|
"Chapters are hidden"
|
||||||
|
),
|
||||||
|
StringResource(
|
||||||
|
"revanced_hide_chapters_summary_off",
|
||||||
|
"Chapters are shown"
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
|
|||||||
Reference in New Issue
Block a user