diff --git a/patches/api/patches.api b/patches/api/patches.api index 7615d8ae6..56743543c 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -276,6 +276,10 @@ public final class app/revanced/patches/instagram/feed/LimitFeedToFollowedProfil public static final fun getLimitFeedToFollowedProfiles ()Lapp/revanced/patcher/patch/BytecodePatch; } +public final class app/revanced/patches/instagram/ghost/story/AnonymousStoryViewingPatchKt { + public static final fun getAnonymousStoryViewingPatch ()Lapp/revanced/patcher/patch/BytecodePatch; +} + public final class app/revanced/patches/instagram/hide/explore/HideExploreFeedKt { public static final fun getHideExploreFeedPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/ghost/story/AnonymousStoryViewingPatch.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/ghost/story/AnonymousStoryViewingPatch.kt new file mode 100644 index 000000000..72cae7fd2 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/ghost/story/AnonymousStoryViewingPatch.kt @@ -0,0 +1,23 @@ +package app.revanced.patches.instagram.ghost.story + +import app.revanced.patcher.patch.bytecodePatch +import app.revanced.util.Utils.trimIndentMultiline +import app.revanced.util.returnEarly + +@Suppress("unused") +val anonymousStoryViewingPatch = bytecodePatch( + name = "Anonymous story viewing", + description = """ + View stories without sending any information to the server. + Your view will not appear in the story viewers list. + Note: Since no data is sent, a story you have already viewed may appear as new on another device. + """.trimIndentMultiline(), + use = false +) { + compatibleWith("com.instagram.android") + + execute { + // Prevent the hashmap of the seen media to be filled + setMediaSeenHashmapFingerprint.method.returnEarly() + } +} diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/ghost/story/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/ghost/story/Fingerprints.kt new file mode 100644 index 000000000..59cce2aac --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/ghost/story/Fingerprints.kt @@ -0,0 +1,9 @@ +package app.revanced.patches.instagram.ghost.story + +import app.revanced.patcher.fingerprint + +internal val setMediaSeenHashmapFingerprint = fingerprint { + parameters() + returns("V") + strings("media/seen/") +}