Skip to content

Commit 688fa01

Browse files
committed
feat(crunchyroll/premium): Add EnablePremiumPatch and related fingerprint
- Introduce EnablePremiumPatch to enable premium features for Crunchyroll. - Implement hasPremiumBenefitFingerprint to identify premium benefit methods. - Ensure compatibility with "com.crunchyroll.crunchyroid". This patch enhances user experience by allowing access to premium content.
1 parent ea76edf commit 688fa01

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

patches/api/patches.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ public final class app/revanced/patches/crunchyroll/ads/HideAdsPatchKt {
176176
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
177177
}
178178

179+
public final class app/revanced/patches/crunchyroll/premium/EnablePremiumPatchKt {
180+
public static final fun getEnablePremiumPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
181+
}
182+
179183
public final class app/revanced/patches/duolingo/ad/DisableAdsPatchKt {
180184
public static final fun getDisableAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
181185
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package app.revanced.patches.crunchyroll.premium
2+
3+
import app.revanced.patcher.patch.bytecodePatch
4+
import app.revanced.util.returnEarly
5+
6+
@Suppress("unused")
7+
val enablePremiumPatch = bytecodePatch(
8+
name = "Enable Premium"
9+
) {
10+
compatibleWith("com.crunchyroll.crunchyroid")
11+
12+
execute {
13+
hasPremiumBenefitFingerprint.method.returnEarly(true)
14+
}
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package app.revanced.patches.crunchyroll.premium
2+
3+
import app.revanced.patcher.fingerprint
4+
5+
internal val hasPremiumBenefitFingerprint = fingerprint {
6+
custom { method, classDef ->
7+
method.name == "hasPremiumBenefit" && classDef.endsWith("BenefitKt;")
8+
}
9+
}

0 commit comments

Comments
 (0)