Compare commits

..

6 Commits

Author SHA1 Message Date
semantic-release-bot
381b4e6e10 chore(release): 2.179.0-dev.5 [skip ci]
# [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)) ([b6c2757](b6c2757a7d))
2023-06-27 02:53:24 +00:00
Guðmundur Óli
b6c2757a7d fix(relayforreddit/change-oauth-client-id): change client id instead of developer key (#2508)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-06-27 04:50:48 +02:00
semantic-release-bot
a80ecfc631 chore(release): 2.179.0-dev.4 [skip ci]
# [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)
2023-06-27 02:37:45 +00:00
oSumAtrIX
c334dc768f build(revanced-patcher): bump version 2023-06-27 04:10:33 +02:00
semantic-release-bot
3adf51ad4f chore(release): 2.179.0-dev.3 [skip ci]
# [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)) ([514aafa](514aafabe8))
2023-06-26 19:04:14 +00:00
LisoUseInAIKyrios
514aafabe8 fix(enable-android-debugging): remove json options (#2497) 2023-06-26 23:01:34 +04:00
17 changed files with 123 additions and 41 deletions

View File

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

View File

@@ -159,6 +159,15 @@ The official ReVanced Patches.
| `sanitize-sharing-links` | Removes (tracking) query parameters from the URLs when sharing links. | all |
</details>
### [📦 `com.laurencedawson.reddit_sync`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
| `disable-ads` | Disables ads. | all |
</details>
### [📦 `com.spotify.music`](https://play.google.com/store/apps/details?id=com.spotify.music)
<details>
@@ -195,6 +204,46 @@ 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. | all |
</details>
### [📦 `com.laurencedawson.reddit_sync.pro`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync.pro)
<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>
@@ -203,14 +252,6 @@ The official ReVanced Patches.
| `disable-ads` | Disables ads in HexEditor. | all |
</details>
### [📦 `com.laurencedawson.reddit_sync`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `disable-ads` | Disables ads. | all |
</details>
### [📦 `com.spotify.lite`](https://play.google.com/store/apps/details?id=com.spotify.lite)
<details>

View File

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

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.179.0-dev.2
version = 2.179.0-dev.5

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -2,6 +2,6 @@ package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprint
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object GetClientIdFingerprint : MethodFingerprint(
strings = listOf("AIzaSyCTQfRx9fHnDpfcfiI5pmwyGUBjDVTNvX8")
abstract class AbstractClientIdFingerprint(string: String) : MethodFingerprint(
strings = listOfNotNull("dj-xCIZQYiLbEg", string),
)

View File

@@ -0,0 +1,3 @@
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
object GetLoggedInBearerTokenFingerprint : AbstractClientIdFingerprint("authorization_code")

View File

@@ -0,0 +1,3 @@
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
object GetLoggedOutBearerTokenFingerprint : AbstractClientIdFingerprint("https://oauth.reddit.com/grants/installed_client")

View File

@@ -0,0 +1,3 @@
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
object GetRefreshTokenFingerprint : AbstractClientIdFingerprint("refresh_token")

View File

@@ -0,0 +1,3 @@
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
object LoginActivityClientIdFingerprint : AbstractClientIdFingerprint("&duration=permanent")

View File

@@ -3,21 +3,43 @@ 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.GetClientIdFingerprint
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(GetClientIdFingerprint)
"dbrady://relay",
Options,
listOf(
LoginActivityClientIdFingerprint,
GetLoggedInBearerTokenFingerprint,
GetLoggedOutBearerTokenFingerprint,
GetRefreshTokenFingerprint
)
) {
override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
first().mutableMethod.replaceInstruction(0, "const-string v0, \"$clientId\"")
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()
}

View File

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

View File

@@ -29,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])
@@ -43,7 +44,7 @@ class SettingsPatch : BytecodePatch(
MenuGroupsUpdatedFingerprint,
MenuGroupsOnClickFingerprint
)
) {
), Closeable {
override fun execute(context: BytecodeContext): PatchResult {
// Hook onCreate to handle fragment creation
SettingsActivityOnCreateFingerprint.result?.apply {

View File

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

View File

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

View File

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