feat(Sync for Reddit): Add Fix post thumbnails
patch
This commit is contained in:
@ -575,6 +575,10 @@ public final class app/revanced/patches/reddit/customclients/sync/syncforreddit/
|
|||||||
public static final fun getFixSLinksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getFixSLinksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/thumbnail/FixPostThumbnailsPatchKt {
|
||||||
|
public static final fun getFixPostThumbnailsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/user/UseUserEndpointPatchKt {
|
public final class app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/user/UseUserEndpointPatchKt {
|
||||||
public static final fun getUseUserEndpointPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getUseUserEndpointPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.thumbnail
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
internal val customImageViewLoadFingerprint = fingerprint {
|
||||||
|
accessFlags(AccessFlags.PUBLIC)
|
||||||
|
parameters("Ljava/lang/String;", "Z", "Z", "I", "I")
|
||||||
|
custom { _, classDef ->
|
||||||
|
classDef.endsWith("CustomImageView;")
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.thumbnail
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
val fixPostThumbnailsPatch = bytecodePatch(
|
||||||
|
name = "Fix post thumbnails",
|
||||||
|
description = "Fixes loading post thumbnails by correcting their URLs.",
|
||||||
|
) {
|
||||||
|
|
||||||
|
compatibleWith(
|
||||||
|
"com.laurencedawson.reddit_sync",
|
||||||
|
"com.laurencedawson.reddit_sync.pro",
|
||||||
|
"com.laurencedawson.reddit_sync.dev"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Image URLs contain escaped ampersands (&), let's replace these with unescaped ones (&).
|
||||||
|
execute {
|
||||||
|
customImageViewLoadFingerprint.method.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
# url = url.replace("&", "&");
|
||||||
|
const-string v0, "&"
|
||||||
|
const-string v1, "&"
|
||||||
|
invoke-virtual { p1, v0, v1 }, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
|
||||||
|
move-result-object p1
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user