diff --git a/patches/api/patches.api b/patches/api/patches.api index fc2d0de32..7ea364a9a 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -132,6 +132,10 @@ public final class app/revanced/patches/amazon/DeepLinkingPatchKt { public static final fun getDeepLinkingPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } +public final class app/revanced/patches/angulus/ads/RemoveAdsPatchKt { + public static final fun getAngulusPatch ()Lapp/revanced/patcher/patch/BytecodePatch; +} + public final class app/revanced/patches/backdrops/misc/pro/ProUnlockPatchKt { public static final fun getProUnlockPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } diff --git a/patches/src/main/kotlin/app/revanced/patches/angulus/ads/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/angulus/ads/Fingerprints.kt new file mode 100644 index 000000000..3196adb7e --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/angulus/ads/Fingerprints.kt @@ -0,0 +1,18 @@ +package app.revanced.patches.angulus.ads + +import app.revanced.patcher.fingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +// Keywords to search for in case the method name changes: +// dailyMeasurementCount +// lastMeasurementDate +// dailyAdResetCount +// MeasurementPrefs + +// This fingerprint targets a method that returns the daily measurement count. +// This method is used to determine if the user has reached the daily limit of measurements. +internal val getDailyMeasurementCountFingerprint = fingerprint { + accessFlags(AccessFlags.PRIVATE) + returns("I") + strings("dailyMeasurementCount") +} diff --git a/patches/src/main/kotlin/app/revanced/patches/angulus/ads/RemoveAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/angulus/ads/RemoveAdsPatch.kt new file mode 100644 index 000000000..5eb585cf5 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/angulus/ads/RemoveAdsPatch.kt @@ -0,0 +1,14 @@ +package app.revanced.patches.angulus.ads + +import app.revanced.patcher.patch.bytecodePatch +import app.revanced.util.returnEarly + +@Suppress("unused") +val angulusPatch = bytecodePatch(name = "Hide ads") { + compatibleWith("com.drinkplusplus.angulus") + + execute { + // Always return 0 as the daily measurement count. + getDailyMeasurementCountFingerprint.method.returnEarly() + } +}