some more fixes

This commit is contained in:
oSumAtrIX 2026-01-17 18:27:26 +01:00
parent 5a15476a9f
commit e7d2d7d62b
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4
7 changed files with 22 additions and 17 deletions

View file

@ -4,9 +4,7 @@ import app.revanced.patcher.patch.creatingBytecodePatch
import app.revanced.util.returnEarly import app.revanced.util.returnEarly
@Suppress("unused", "ObjectPropertyName") @Suppress("unused", "ObjectPropertyName")
val `Disable Audio Ads` by creatingBytecodePatch( val `Disable Audio Ads` by creatingBytecodePatch {
description = "Disable audio ads"
) {
compatibleWith("com.pandora.android") compatibleWith("com.pandora.android")
apply { apply {

View file

@ -2,8 +2,8 @@ package app.revanced.patches.reddit.customclients.infinityforreddit.subscription
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethod import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethod
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.InstructionMatchingFunctions.invoke
import app.revanced.patcher.instructions import app.revanced.patcher.instructions
import app.revanced.patcher.invoke
import app.revanced.patcher.patch.BytecodePatchContext import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.billingClientOnServiceConnectedMethod by gettingFirstMutableMethod("Billing service connected") internal val BytecodePatchContext.billingClientOnServiceConnectedMethod by gettingFirstMutableMethod("Billing service connected")

View file

@ -1,11 +1,11 @@
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.bytecodePatch import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused") @Suppress("unused")
val disablePiracyDetectionPatch = bytecodePatch { val disablePiracyDetectionPatch = bytecodePatch {
apply { apply {
piracyDetectionMethod.addInstruction(0, "return-void") detectPiracyMethod.returnEarly()
} }
} }

View file

@ -1,12 +1,16 @@
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy
import app.revanced.patcher.*
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.InstructionMatchingFunctions.invoke
import app.revanced.patcher.accessFlags
import app.revanced.patcher.definingClass
import app.revanced.patcher.instructions
import app.revanced.patcher.patch.BytecodePatchContext import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.Opcode
internal val BytecodePatchContext.piracyDetectionMethod by gettingFirstMutableMethodDeclaratively { internal val BytecodePatchContext.detectPiracyMethod by gettingFirstMutableMethodDeclaratively {
accessFlags(AccessFlags.PRIVATE, AccessFlags.STATIC) accessFlags(AccessFlags.PRIVATE, AccessFlags.STATIC)
returnType("V") returnType("V")
instructions( instructions(

View file

@ -1,7 +1,7 @@
package app.revanced.patches.reddit.customclients.sync.detection.piracy package app.revanced.patches.reddit.customclients.sync.detection.piracy
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.bytecodePatch import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
val disablePiracyDetectionPatch = bytecodePatch( val disablePiracyDetectionPatch = bytecodePatch(
description = "Disables detection of modified versions.", description = "Disables detection of modified versions.",
@ -10,6 +10,6 @@ val disablePiracyDetectionPatch = bytecodePatch(
apply { apply {
// Do not throw an error if the fingerprint is not resolved. // Do not throw an error if the fingerprint is not resolved.
// This is fine because new versions of the target app do not need this patch. // This is fine because new versions of the target app do not need this patch.
piracyDetectionMethod.addInstruction(0, "return-void") detectPiracyMethodOrNull?.returnEarly()
} }
} }

View file

@ -1,14 +1,18 @@
package app.revanced.patches.reddit.customclients.sync.detection.piracy package app.revanced.patches.reddit.customclients.sync.detection.piracy
import app.revanced.patcher.* import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclarativelyOrNull
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively import app.revanced.patcher.InstructionMatchingFunctions.invoke
import app.revanced.patcher.accessFlags
import app.revanced.patcher.custom
import app.revanced.patcher.extensions.instructions import app.revanced.patcher.extensions.instructions
import app.revanced.patcher.extensions.reference import app.revanced.patcher.extensions.reference
import app.revanced.patcher.instructions
import app.revanced.patcher.patch.BytecodePatchContext import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.Opcode
internal val BytecodePatchContext.piracyDetectionMethod by gettingFirstMutableMethodDeclaratively( internal val BytecodePatchContext.detectPiracyMethodOrNull by gettingFirstMutableMethodDeclarativelyOrNull(
"Lcom/github/javiersantos/piracychecker/PiracyChecker;" "Lcom/github/javiersantos/piracychecker/PiracyChecker;"
) { ) {
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL) accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)

View file

@ -1,5 +1,6 @@
package app.revanced.patches.reddit.customclients.sync.syncforreddit.annoyances.startup package app.revanced.patches.reddit.customclients.sync.syncforreddit.annoyances.startup
import app.revanced.patcher.extensions.instructions
import app.revanced.patcher.extensions.removeInstruction import app.revanced.patcher.extensions.removeInstruction
import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.creatingBytecodePatch
@ -14,10 +15,8 @@ val `Disable Sync for Lemmy bottom sheet` = creatingBytecodePatch(
) )
apply { apply {
mainActivityOnCreateMethod.apply { val showBottomSheetIndex = mainActivityOnCreateMethod.instructions.lastIndex - 1
val showBottomSheetIndex = implementation!!.instructions.lastIndex - 1
removeInstruction(showBottomSheetIndex) mainActivityOnCreateMethod.removeInstruction(showBottomSheetIndex)
}
} }
} }