mirror of
https://github.com/revanced/revanced-patches
synced 2024-09-12 09:16:43 +02:00
feat(Sync for Reddit): Add Fix /s/ links
patch
This commit is contained in:
parent
e0ec9c687b
commit
f15ef3f634
@ -550,6 +550,12 @@ public final class app/revanced/patches/reddit/customclients/syncforreddit/detec
|
||||
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/reddit/customclients/syncforreddit/fix/slink/FixSLinksPatch : app/revanced/patcher/patch/BytecodePatch {
|
||||
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/syncforreddit/fix/slink/FixSLinksPatch;
|
||||
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/reddit/layout/disablescreenshotpopup/DisableScreenshotPopupPatch : app/revanced/patcher/patch/BytecodePatch {
|
||||
public static final field INSTANCE Lapp/revanced/patches/reddit/layout/disablescreenshotpopup/DisableScreenshotPopupPatch;
|
||||
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||
|
@ -0,0 +1,32 @@
|
||||
package app.revanced.patches.reddit.customclients.syncforreddit.fix.slink
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.reddit.customclients.syncforreddit.fix.slink.fingerprints.LinkHelperOpenLinkFingerprint
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Fix /s/ links",
|
||||
description = "Fixes the issue where /s/ links do not work.",
|
||||
compatiblePackages = [
|
||||
CompatiblePackage("com.laurencedawson.reddit_sync"),
|
||||
CompatiblePackage("com.laurencedawson.reddit_sync.pro"),
|
||||
CompatiblePackage("com.laurencedawson.reddit_sync.dev")
|
||||
],
|
||||
requiresIntegrations = true
|
||||
)
|
||||
object FixSLinksPatch : BytecodePatch(
|
||||
setOf(LinkHelperOpenLinkFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) =
|
||||
LinkHelperOpenLinkFingerprint.result?.mutableMethod?.addInstructions(
|
||||
1,
|
||||
"""
|
||||
invoke-static { p3 }, Lapp/revanced/integrations/syncforreddit/FixSLinksPatch;->resolveSLink(Ljava/lang/String;)Ljava/lang/String;
|
||||
move-result-object p3
|
||||
"""
|
||||
) ?: throw LinkHelperOpenLinkFingerprint.exception
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package app.revanced.patches.reddit.customclients.syncforreddit.fix.slink.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
|
||||
internal object LinkHelperOpenLinkFingerprint: MethodFingerprint(
|
||||
strings = listOf("Link title: ")
|
||||
)
|
Loading…
Reference in New Issue
Block a user