mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2025-05-11 13:15:39 +02:00
Merge ad8b01ea03
into 25e7dc1568
This commit is contained in:
commit
1181685dec
3 changed files with 51 additions and 0 deletions
|
@ -551,6 +551,14 @@ public final class app/revanced/patches/reddit/customclients/sync/syncforreddit/
|
|||
public static final fun getFixSLinksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/thumbnail/FingerprintsKt {
|
||||
public static final fun getCustomImageViewLoadFingerprint ()Lapp/revanced/patcher/Fingerprint;
|
||||
}
|
||||
|
||||
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 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
|
||||
|
||||
val customImageViewLoadFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC)
|
||||
parameters("Ljava/lang/String;", "Z", "Z", "I", "I")
|
||||
custom { _, classDef ->
|
||||
classDef.type == "Lcom/laurencedawson/reddit_sync/ui/views/images/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
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue