mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-23 02:31:03 +00:00
refactor(joeyforreddit): DisableAdsPatch
This commit is contained in:
@@ -2,18 +2,17 @@ package app.revanced.patches.reddit.customclients.joeyforreddit.ads
|
||||
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patcher.patch.creatingBytecodePatch
|
||||
import app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy.disablePiracyDetectionPatch
|
||||
|
||||
@Suppress("unused")
|
||||
val disableAdsPatch = bytecodePatch(
|
||||
name = "Disable ads",
|
||||
) {
|
||||
@Suppress("unused", "ObjectPropertyName")
|
||||
val `Disable ads` by creatingBytecodePatch {
|
||||
dependsOn(disablePiracyDetectionPatch)
|
||||
|
||||
compatibleWith("o.o.joey")
|
||||
|
||||
apply {
|
||||
isAdFreeUserFingerprint.method.addInstructions(
|
||||
isAdFreeUserMethod.addInstructions(
|
||||
0,
|
||||
"""
|
||||
const/4 v0, 0x1
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package app.revanced.patches.reddit.customclients.joeyforreddit.ads
|
||||
|
||||
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
|
||||
import app.revanced.patcher.accessFlags
|
||||
import app.revanced.patcher.patch.BytecodePatchContext
|
||||
import app.revanced.patcher.returnType
|
||||
import app.revanced.patcher.string
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val isAdFreeUserFingerprint = fingerprint {
|
||||
internal val BytecodePatchContext.isAdFreeUserMethod by gettingFirstMutableMethodDeclaratively {
|
||||
accessFlags(AccessFlags.PUBLIC)
|
||||
returns("Z")
|
||||
strings("AD_FREE_USER")
|
||||
}
|
||||
returnType("Z")
|
||||
string("AD_FREE_USER")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user