From cf6f10a0e1eb4f3f0ed8bb8f73132b65ee02b59e Mon Sep 17 00:00:00 2001 From: Ave Date: Thu, 28 May 2020 15:26:04 +0300 Subject: [PATCH] pseudonitro-viewer: Add patch Closes #61 --- patches/README.md | 4 ++++ patches/pseudonitro-viewer/1150.patch | 22 ++++++++++++++++++++++ patches/pseudonitro-viewer/README.md | 16 ++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 patches/pseudonitro-viewer/1150.patch create mode 100644 patches/pseudonitro-viewer/README.md diff --git a/patches/README.md b/patches/README.md index f896285..6656764 100644 --- a/patches/README.md +++ b/patches/README.md @@ -71,6 +71,10 @@ Video demonstration: https://www.youtube.com/watch?v=NMRPsAgqtWQ - nospoiler: Automatically shows all spoilers. Useful for moderation. - **notrack**: Disables most of the tracking in Discord. Included in all official branches. - nozlib: Disables zlib-stream field on wss, making it easier to parse wss communications when MITMing the app. +- psuedonitro-viewer: This patch allows viewing emojis sent with pseudoNitro. + +![An image of pseudoNitro](https://lasagna.cat/i/nw0kfk2r.png) + - profilemention: Restores the behavior where tapping a user's profile picture adds their mention to the chat box instead of opening their profile. - **supplemental**: Adds some helper functions needed by certain patches. diff --git a/patches/pseudonitro-viewer/1150.patch b/patches/pseudonitro-viewer/1150.patch new file mode 100644 index 0000000..f2b3147 --- /dev/null +++ b/patches/pseudonitro-viewer/1150.patch @@ -0,0 +1,22 @@ +diff -crB com.discord-base/smali/com/discord/utilities/textprocessing/Rules.smali com.discord/smali/com/discord/utilities/textprocessing/Rules.smali +*** com.discord-base/smali/com/discord/utilities/textprocessing/Rules.smali 2020-05-27 16:23:07.799975486 +0300 +--- com.discord/smali/com/discord/utilities/textprocessing/Rules.smali 2020-05-28 15:14:32.542156347 +0300 +*************** +*** 165,171 **** + + sput-object v1, Lcom/discord/utilities/textprocessing/Rules;->PATTERN_UNICODE_EMOJI$delegate:Lkotlin/Lazy; + +! const-string v1, "^<(a)?:([a-zA-Z_0-9]+):(\\d+)>" + + .line 10 + invoke-static {v1}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern; +--- 165,172 ---- + + sput-object v1, Lcom/discord/utilities/textprocessing/Rules;->PATTERN_UNICODE_EMOJI$delegate:Lkotlin/Lazy; + +! # There's a ZWSP there +! const-string v1, "^<&?​?(a)?:([a-zA-Z_0-9]+):(\\d+)>" + + .line 10 + invoke-static {v1}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern; + diff --git a/patches/pseudonitro-viewer/README.md b/patches/pseudonitro-viewer/README.md new file mode 100644 index 0000000..db8689c --- /dev/null +++ b/patches/pseudonitro-viewer/README.md @@ -0,0 +1,16 @@ +## DisTok CutTheCord: Pseudo Nitro Viewer Patch + +This patch allows viewing emojis sent with pseudoNitro. + +pseudoNitro is a way of sending emojis from all guilds to all guilds, even without Nitro. Both receivers need psuedoNitro to view these. +- The old format is inserting a `&` between `<` and `:` (such as `<&:thinkEyes:406800811700781076>`). +- The new format is inserting a zwsp between `<` and `:` (such as `<​:thinkEyes:406800811700781076>`). +- This patch supports receiving both. + +TL;DR: + +![](https://lasagna.cat/i/nw0kfk2r.png) + +#### Available and tested on: +- 24 +