feat(Jakdojade) Add Remove ads patch

This commit is contained in:
Tymek 2026-01-13 03:41:22 +01:00
parent 778d13ce8b
commit 0e020c5760
No known key found for this signature in database
3 changed files with 95 additions and 0 deletions

View file

@ -352,6 +352,10 @@ public final class app/revanced/patches/irplus/ad/RemoveAdsPatchKt {
public static final fun getRemoveAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/jakdojade/ad/RemoveAdsPatchKt {
public static final fun getRemoveAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/letterboxd/ads/HideAdsPatchKt {
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

View file

@ -0,0 +1,50 @@
package app.revanced.patches.jakdojade.ad
import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal val isPremiumFingerprint = fingerprint {
returns("Z")
accessFlags(AccessFlags.PUBLIC)
parameters()
opcodes(
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ,
Opcode.IGET_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IF_NEZ,
Opcode.CONST_4,
Opcode.GOTO,
Opcode.CONST_4,
Opcode.RETURN
)
}
internal val premiumRenewalDateFingerprint = fingerprint {
returns("Ljava/lang/String;")
accessFlags(AccessFlags.PUBLIC)
parameters()
opcodes(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
)
}
internal val getGoogleProductFingerprint = fingerprint {
returns("Lcom/citynav/jakdojade/pl/android/billing/output/GoogleProduct;")
accessFlags(AccessFlags.PUBLIC)
parameters("Lcom/citynav/jakdojade/pl/android/profiles/ui/profile/userprofile/model/PremiumType;")
}

View file

@ -0,0 +1,41 @@
package app.revanced.patches.jakdojade.ad
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
import app.revanced.patcher.patch.bytecodePatch
@Suppress("unused")
val removeAdsPatch = bytecodePatch(
name = "Remove ads",
) {
compatibleWith("com.citynav.jakdojade.pl.android")
execute {
// Spoof isPremium() to always return true
// We can do this beacuse Jakdojade Premium's only feature is ad removal
isPremiumFingerprint.method.replaceInstructions(
0,
"""
const/4 v0, 0x1
return v0
""",
)
// Spoof Premium renewal date in the UI
// We need to do the spoofing in order to avoid app crashes when opening profile menu
premiumRenewalDateFingerprint.method.replaceInstructions(
0,
"""
const-string v0, ""
return-object v0
""".trimIndent()
)
// Spoof Premium type
getGoogleProductFingerprint.method.replaceInstructions(
0,
"""
sget-object v0, Lcom/citynav/jakdojade/pl/android/billing/output/GoogleProduct;->PREMIUM_YEARLY_V4:Lcom/citynav/jakdojade/pl/android/billing/output/GoogleProduct;
return-object v0
""".trimIndent()
)
}
}