fix(boostforreddit): use correct options
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user