mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-25 11:41:04 +00:00
refactor(joeyforreddit): DisablePiracyDetectionPatch
This commit is contained in:
@@ -2,8 +2,8 @@ package app.revanced.patches.reddit.customclients.joeyforreddit.api
|
||||
|
||||
import app.revanced.patches.reddit.customclients.infinity.api.authUtilityUserAgentMethod
|
||||
import app.revanced.patches.reddit.customclients.infinity.api.getClientIdMethod
|
||||
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.disablePiracyDetectionPatch
|
||||
import app.revanced.patches.reddit.customclients.spoofClientPatch
|
||||
import app.revanced.patches.reddit.customclients.sync.detection.piracy.disablePiracyDetectionPatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
val spoofClientPatch = spoofClientPatch(redirectUri = "https://127.0.0.1:65023/authorize_callback") { clientIdOption ->
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy
|
||||
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
|
||||
val disablePiracyDetectionPatch = bytecodePatch {
|
||||
import app.revanced.patcher.patch.creatingBytecodePatch
|
||||
|
||||
@Suppress("unused", "ObjectPropertyName")
|
||||
val `Disable piracy detection` by creatingBytecodePatch {
|
||||
apply {
|
||||
piracyDetectionFingerprint.method.addInstruction(0, "return-void")
|
||||
piracyDetectionMethod.addInstruction(0, "return-void")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy
|
||||
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
|
||||
import app.revanced.patcher.accessFlags
|
||||
import app.revanced.patcher.definingClass
|
||||
import app.revanced.patcher.instructions
|
||||
import app.revanced.patcher.invoke
|
||||
import app.revanced.patcher.patch.BytecodePatchContext
|
||||
import app.revanced.patcher.returnType
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import app.revanced.patcher.fingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
internal val piracyDetectionFingerprint = fingerprint {
|
||||
internal val BytecodePatchContext.piracyDetectionMethod by gettingFirstMutableMethodDeclaratively {
|
||||
accessFlags(AccessFlags.PRIVATE, AccessFlags.STATIC)
|
||||
returns("V")
|
||||
opcodes(
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.CONST_16,
|
||||
Opcode.CONST_WIDE_16,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_VOID
|
||||
returnType("V")
|
||||
instructions(
|
||||
Opcode.NEW_INSTANCE(),
|
||||
Opcode.CONST_16(),
|
||||
Opcode.CONST_WIDE_16(),
|
||||
Opcode.INVOKE_DIRECT(),
|
||||
Opcode.INVOKE_VIRTUAL(),
|
||||
Opcode.RETURN_VOID()
|
||||
)
|
||||
custom { _, classDef ->
|
||||
classDef.endsWith("ProcessLifeCyleListener;")
|
||||
}
|
||||
}
|
||||
definingClass("ProcessLifeCyleListener;"::endsWith)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user