some more fixes

This commit is contained in:
oSumAtrIX
2026-01-17 18:27:26 +01:00
parent 5a15476a9f
commit e7d2d7d62b
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
@Suppress("unused", "ObjectPropertyName")
val `Disable Audio Ads` by creatingBytecodePatch(
description = "Disable audio ads"
) {
val `Disable Audio Ads` by creatingBytecodePatch {
compatibleWith("com.pandora.android")
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.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.InstructionMatchingFunctions.invoke
import app.revanced.patcher.instructions
import app.revanced.patcher.invoke
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.billingClientOnServiceConnectedMethod by gettingFirstMutableMethod("Billing service connected")

View File

@@ -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
import app.revanced.util.returnEarly
@Suppress("unused")
val disablePiracyDetectionPatch = bytecodePatch {
apply {
piracyDetectionMethod.addInstruction(0, "return-void")
detectPiracyMethod.returnEarly()
}
}

View File

@@ -1,12 +1,16 @@
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy
import app.revanced.patcher.*
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.returnType
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal val BytecodePatchContext.piracyDetectionMethod by gettingFirstMutableMethodDeclaratively {
internal val BytecodePatchContext.detectPiracyMethod by gettingFirstMutableMethodDeclaratively {
accessFlags(AccessFlags.PRIVATE, AccessFlags.STATIC)
returnType("V")
instructions(

View File

@@ -1,7 +1,7 @@
package app.revanced.patches.reddit.customclients.sync.detection.piracy
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
val disablePiracyDetectionPatch = bytecodePatch(
description = "Disables detection of modified versions.",
@@ -10,6 +10,6 @@ val disablePiracyDetectionPatch = bytecodePatch(
apply {
// 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.
piracyDetectionMethod.addInstruction(0, "return-void")
detectPiracyMethodOrNull?.returnEarly()
}
}

View File

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

View File

@@ -1,5 +1,6 @@
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.patch.creatingBytecodePatch
@@ -14,10 +15,8 @@ val `Disable Sync for Lemmy bottom sheet` = creatingBytecodePatch(
)
apply {
mainActivityOnCreateMethod.apply {
val showBottomSheetIndex = implementation!!.instructions.lastIndex - 1
val showBottomSheetIndex = mainActivityOnCreateMethod.instructions.lastIndex - 1
removeInstruction(showBottomSheetIndex)
}
mainActivityOnCreateMethod.removeInstruction(showBottomSheetIndex)
}
}