File tree Expand file tree Collapse file tree 3 files changed +22
-32
lines changed
src/main/kotlin/app/revanced/patches/pixiv/ads Expand file tree Collapse file tree 3 files changed +22
-32
lines changed Original file line number Diff line number Diff line change 11package app.revanced.patches.pixiv.ads
22
3- import app.revanced.util.exception
43import app.revanced.patcher.data.BytecodeContext
54import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
65import app.revanced.patcher.patch.BytecodePatch
76import app.revanced.patcher.patch.annotation.CompatiblePackage
87import app.revanced.patcher.patch.annotation.Patch
9- import app.revanced.patches.pixiv.ads.fingerprints.IsNotPremiumFingerprint
8+ import app.revanced.patches.pixiv.ads.fingerprints.ShouldShowAdsFingerprint
9+ import app.revanced.util.exception
1010
1111@Patch(
1212 name = " Hide ads" ,
13- compatiblePackages = [CompatiblePackage (" jp.pxv.android" )]
13+ compatiblePackages = [CompatiblePackage (" jp.pxv.android" )],
1414)
1515@Suppress(" unused" )
16- object HideAdsPatch : BytecodePatch(setOf(IsNotPremiumFingerprint )) {
17- // Always return false in the "isNotPremium" method which normally returns !this.accountManager.isPremium.
18- // However, this is not the method that controls the user's premium status.
19- // Instead, this method is used to determine whether ads should be shown.
16+ object HideAdsPatch : BytecodePatch(setOf(ShouldShowAdsFingerprint )) {
2017 override fun execute (context : BytecodeContext ) =
21- IsNotPremiumFingerprint .result?.mutableClass?.virtualMethods?.first() ?.addInstructions(
18+ ShouldShowAdsFingerprint .result?.mutableMethod ?.addInstructions(
2219 0 ,
2320 """
2421 const/4 v0, 0x0
2522 return v0
26- """
27- ) ? : throw IsNotPremiumFingerprint .exception
28- }
23+ """ ,
24+ ) ? : throw ShouldShowAdsFingerprint .exception
25+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package app.revanced.patches.pixiv.ads.fingerprints
2+
3+ import app.revanced.patcher.extensions.or
4+ import app.revanced.patcher.fingerprint.MethodFingerprint
5+ import com.android.tools.smali.dexlib2.AccessFlags
6+
7+
8+ internal object ShouldShowAdsFingerprint : MethodFingerprint(
9+ " Z" ,
10+ AccessFlags .PUBLIC or AccessFlags .FINAL ,
11+ customFingerprint = { methodDef, classDef ->
12+ classDef.type.endsWith("AdUtils ;") && methodDef.name == " shouldShowAds"
13+ }
14+ )
You can’t perform that action at this time.
0 commit comments