Fix(Jakdojade) Renamed ad to ads and used returnEarly
This commit is contained in:
parent
36d1e83f2a
commit
4a71df5214
3 changed files with 73 additions and 1 deletions
|
|
@ -352,7 +352,7 @@ public final class app/revanced/patches/irplus/ad/RemoveAdsPatchKt {
|
||||||
public static final fun getRemoveAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getRemoveAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/jakdojade/ad/DisableAdsPatchKt {
|
public final class app/revanced/patches/jakdojade/ads/DisableAdsPatchKt {
|
||||||
public static final fun getDisableAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getDisableAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package app.revanced.patches.jakdojade.ads
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
import app.revanced.util.returnEarly
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
val disableAdsPatch = bytecodePatch(
|
||||||
|
name = "Disable 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.returnEarly(true)
|
||||||
|
|
||||||
|
// Spoof Premium renewal date in the UI.
|
||||||
|
// We need to do the spoofing in order to avoid app crashes when opening profile menu.
|
||||||
|
getPremiumRenewalDateFingerprint.method.returnEarly("")
|
||||||
|
// 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
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package app.revanced.patches.jakdojade.ads
|
||||||
|
|
||||||
|
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,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal val getPremiumRenewalDateFingerprint = 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;")
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue