fix(Instagram): Make Change link sharing domain and Sanitize sharing links work with latest versions again (#6518)
This commit is contained in:
+3
-4
@@ -16,15 +16,14 @@ internal fun editShareLinksPatch(block: MutableMethod.(index: Int, register: Int
|
|||||||
liveUrlResponseJsonParserFingerprint
|
liveUrlResponseJsonParserFingerprint
|
||||||
)
|
)
|
||||||
|
|
||||||
for (fingerprint in fingerprintsToPatch) {
|
fingerprintsToPatch.forEachIndexed { index, fingerprint ->
|
||||||
|
|
||||||
fingerprint.method.apply {
|
fingerprint.method.apply {
|
||||||
val putSharingUrlIndex = indexOfFirstInstruction(
|
val putSharingUrlIndex = indexOfFirstInstruction(
|
||||||
permalinkResponseJsonParserFingerprint.stringMatches!!.first().index,
|
index,
|
||||||
Opcode.IPUT_OBJECT
|
Opcode.IPUT_OBJECT
|
||||||
)
|
)
|
||||||
|
|
||||||
val sharingUrlRegister = getInstruction<TwoRegisterInstruction>(putSharingUrlIndex).registerA
|
val sharingUrlRegister = getInstruction<TwoRegisterInstruction>(putSharingUrlIndex).registerA
|
||||||
|
|
||||||
block(putSharingUrlIndex, sharingUrlRegister)
|
block(putSharingUrlIndex, sharingUrlRegister)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-4
@@ -1,23 +1,32 @@
|
|||||||
package app.revanced.patches.instagram.misc.share
|
package app.revanced.patches.instagram.misc.share
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint
|
import app.revanced.patcher.fingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
internal val TARGET_STRING_ARRAY = arrayOf(
|
||||||
|
"permalink",
|
||||||
|
"story_item_to_share_url",
|
||||||
|
"profile_to_share_url",
|
||||||
|
"live_to_share_url",
|
||||||
|
)
|
||||||
|
|
||||||
internal val permalinkResponseJsonParserFingerprint = fingerprint {
|
internal val permalinkResponseJsonParserFingerprint = fingerprint {
|
||||||
strings("permalink", "PermalinkResponse")
|
strings(TARGET_STRING_ARRAY[0])
|
||||||
|
opcodes(Opcode.NEW_INSTANCE,Opcode.INVOKE_DIRECT,Opcode.INVOKE_VIRTUAL)
|
||||||
custom { method, _ -> method.name == "parseFromJson" }
|
custom { method, _ -> method.name == "parseFromJson" }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val storyUrlResponseJsonParserFingerprint = fingerprint {
|
internal val storyUrlResponseJsonParserFingerprint = fingerprint {
|
||||||
strings("story_item_to_share_url", "StoryItemUrlResponse")
|
strings(TARGET_STRING_ARRAY[1])
|
||||||
custom { method, _ -> method.name == "parseFromJson" }
|
custom { method, _ -> method.name == "parseFromJson" }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val profileUrlResponseJsonParserFingerprint = fingerprint {
|
internal val profileUrlResponseJsonParserFingerprint = fingerprint {
|
||||||
strings("profile_to_share_url")
|
strings(TARGET_STRING_ARRAY[2])
|
||||||
custom { method, _ -> method.name == "parseFromJson" }
|
custom { method, _ -> method.name == "parseFromJson" }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val liveUrlResponseJsonParserFingerprint = fingerprint {
|
internal val liveUrlResponseJsonParserFingerprint = fingerprint {
|
||||||
strings("live_to_share_url", "LiveItemLinkUrlResponse")
|
strings(TARGET_STRING_ARRAY[3])
|
||||||
custom { method, _ -> method.name == "parseFromJson" }
|
custom { method, _ -> method.name == "parseFromJson" }
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user