fix(boostforreddit): use correct options

This commit is contained in:
oSumAtrIX
2023-06-20 04:04:04 +02:00
parent edd67b8748
commit ec39732a05
3 changed files with 9 additions and 9 deletions

View File

@ -4,16 +4,15 @@ 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 options: ChangeOAuthClientIdOptionsContainer,
private val fingerprint: MethodFingerprint,
) : BytecodePatch(listOf(fingerprint)) {
override fun execute(context: BytecodeContext): PatchResult {
if (ChangeOAuthClientIdPatch.clientId == null) {
if (options.clientId == null) {
// Test if on Android
try {
Class.forName("android.os.Environment")
@ -30,11 +29,11 @@ abstract class AbstractChangeOAuthClientIdPatch(
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"
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() }
}.let { options.clientId = it.readText().trim() }
}
return fingerprint.patch(context)