From cdc9b03ebf00c5090ca32849b84467b4da94d0a6 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Tue, 21 May 2019 17:53:03 +0300 Subject: [PATCH] slashcommands: Add lenny, small, smaller, flip, clap, owo Also I did minor optimizations on the performance of message speed by ensuring that message starts with / before sending it through slashCommands function OwO is untested. --- patches/slashcommands/900.patch | 941 +++++++++++++++++- patches/slashcommands/README.md | 30 +- patches/slashcommands/textreplacegen-array.py | 102 ++ 3 files changed, 1053 insertions(+), 20 deletions(-) create mode 100644 patches/slashcommands/textreplacegen-array.py diff --git a/patches/slashcommands/900.patch b/patches/slashcommands/900.patch index b88dd541..dac46221 100644 --- a/patches/slashcommands/900.patch +++ b/patches/slashcommands/900.patch @@ -1,8 +1,8 @@ Only in com.discord-900: build Only in com.discord-900: dist diff -crB com.discord-900-base/smali/com/discord/stores/StoreMessages.smali com.discord-900/smali/com/discord/stores/StoreMessages.smali -*** com.discord-900-base/smali/com/discord/stores/StoreMessages.smali 2019-05-19 21:52:46.439797252 +0300 ---- com.discord-900/smali/com/discord/stores/StoreMessages.smali 2019-05-20 02:01:19.969867668 +0300 +*** com.discord-900-base/smali/com/discord/stores/StoreMessages.smali 2019-05-19 21:52:46.439797252 +0300 +--- com.discord-900/smali/com/discord/stores/StoreMessages.smali 2019-05-21 17:51:10.909682423 +0300 *************** *** 432,437 **** --- 432,441 ---- @@ -18,7 +18,7 @@ diff -crB com.discord-900-base/smali/com/discord/stores/StoreMessages.smali com. *************** *** 948,953 **** ---- 952,2136 ---- +--- 952,3059 ---- return-void .end method @@ -239,6 +239,31 @@ diff -crB com.discord-900-base/smali/com/discord/stores/StoreMessages.smali com. + return-object p0 + .end method + ++ .method public static final slashLenny(Ljava/lang/String;)Ljava/lang/String; ++ .locals 2 ++ ++ # Length of command (no space) ++ const/4 v0, 0x6 ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ new-instance v0, Ljava/lang/StringBuilder; ++ ++ const-string v1, " ( ͡° ͜ʖ ͡°)" ++ ++ invoke-direct {v0, p0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V ++ ++ invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; ++ ++ invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ return-object p0 ++ .end method ++ + .method public static final slashFw(Ljava/lang/String;)Ljava/lang/String; + .locals 2 + @@ -1000,6 +1025,789 @@ diff -crB com.discord-900-base/smali/com/discord/stores/StoreMessages.smali com. + return-object p0 + .end method + ++ .method public static final slashSmall(Ljava/lang/String;)Ljava/lang/String; ++ .locals 2 ++ ++ # Length of command + space ++ const/16 v0, 0x7 ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ invoke-virtual {p0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ # Start of automatically generated code with textreplacegen.py ++ ++ const-string v0, "a" ++ ++ const-string v1, "ᴀ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "b" ++ ++ const-string v1, "ʙ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "c" ++ ++ const-string v1, "ᴄ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "d" ++ ++ const-string v1, "ᴅ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "e" ++ ++ const-string v1, "ᴇ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "f" ++ ++ const-string v1, "ꜰ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "g" ++ ++ const-string v1, "ɢ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "h" ++ ++ const-string v1, "ʜ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "i" ++ ++ const-string v1, "ɪ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "j" ++ ++ const-string v1, "ᴊ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "k" ++ ++ const-string v1, "ᴋ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "l" ++ ++ const-string v1, "ʟ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "m" ++ ++ const-string v1, "ᴍ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "n" ++ ++ const-string v1, "ɴ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "o" ++ ++ const-string v1, "ᴏ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "p" ++ ++ const-string v1, "ᴘ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "q" ++ ++ const-string v1, "ǫ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "r" ++ ++ const-string v1, "ʀ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "s" ++ ++ const-string v1, "s" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "t" ++ ++ const-string v1, "ᴛ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "u" ++ ++ const-string v1, "ᴜ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "v" ++ ++ const-string v1, "ᴠ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "w" ++ ++ const-string v1, "ᴡ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "x" ++ ++ const-string v1, "x" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "y" ++ ++ const-string v1, "ʏ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "z" ++ ++ const-string v1, "ᴢ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ # End of automatically generated code by textreplacegen.py ++ ++ return-object p0 ++ .end method ++ ++ .method public static final slashSmaller(Ljava/lang/String;)Ljava/lang/String; ++ .locals 2 ++ ++ # Length of command + space ++ const/16 v0, 0x9 ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ invoke-virtual {p0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ # Start of automatically generated code with textreplacegen.py ++ ++ const-string v0, "a" ++ ++ const-string v1, "ᵃ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "b" ++ ++ const-string v1, "ᵇ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "c" ++ ++ const-string v1, "ᶜ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "d" ++ ++ const-string v1, "ᵈ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "e" ++ ++ const-string v1, "ᵉ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "f" ++ ++ const-string v1, "ᶠ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "g" ++ ++ const-string v1, "ᵍ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "h" ++ ++ const-string v1, "ʰ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "i" ++ ++ const-string v1, "ᶦ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "j" ++ ++ const-string v1, "ʲ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "k" ++ ++ const-string v1, "ᵏ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "l" ++ ++ const-string v1, "ˡ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "m" ++ ++ const-string v1, "ᵐ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "n" ++ ++ const-string v1, "ⁿ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "o" ++ ++ const-string v1, "ᵒ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "p" ++ ++ const-string v1, "ᵖ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "q" ++ ++ const-string v1, "ᑫ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "r" ++ ++ const-string v1, "ʳ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "s" ++ ++ const-string v1, "ˢ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "t" ++ ++ const-string v1, "ᵗ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "u" ++ ++ const-string v1, "ᵘ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "v" ++ ++ const-string v1, "ᵛ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "w" ++ ++ const-string v1, "ʷ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "x" ++ ++ const-string v1, "ˣ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "y" ++ ++ const-string v1, "ʸ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "z" ++ ++ const-string v1, "ᶻ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ # End of automatically generated code by textreplacegen.py ++ ++ return-object p0 ++ .end method ++ ++ .method public static final slashFlip(Ljava/lang/String;)Ljava/lang/String; ++ .locals 2 ++ ++ # Length of command + space ++ const/16 v0, 0x6 ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ invoke-virtual {p0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ # Reverse text ++ ++ new-instance v0, Ljava/lang/StringBuilder; ++ ++ invoke-direct {v0, p0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V ++ ++ invoke-virtual {v0}, Ljava/lang/StringBuilder;->reverse()Ljava/lang/StringBuilder; ++ ++ invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ # Start of automatically generated code with textreplacegen.py ++ ++ const-string v0, "a" ++ ++ const-string v1, "ɐ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "b" ++ ++ const-string v1, "q" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "c" ++ ++ const-string v1, "ɔ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "d" ++ ++ const-string v1, "p" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "e" ++ ++ const-string v1, "ǝ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "f" ++ ++ const-string v1, "ɟ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "g" ++ ++ const-string v1, "ƃ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "h" ++ ++ const-string v1, "ɥ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "i" ++ ++ const-string v1, "ı" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "j" ++ ++ const-string v1, "ɾ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "k" ++ ++ const-string v1, "ʞ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "l" ++ ++ const-string v1, "ן" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "m" ++ ++ const-string v1, "ɯ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "n" ++ ++ const-string v1, "u" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "o" ++ ++ const-string v1, "o" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "p" ++ ++ const-string v1, "d" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "q" ++ ++ const-string v1, "b" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "r" ++ ++ const-string v1, "ɹ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "s" ++ ++ const-string v1, "s" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "t" ++ ++ const-string v1, "ʇ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "u" ++ ++ const-string v1, "n" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "v" ++ ++ const-string v1, "ʌ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "w" ++ ++ const-string v1, "ʍ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "x" ++ ++ const-string v1, "x" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "y" ++ ++ const-string v1, "ʎ" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "z" ++ ++ const-string v1, "z" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ # End of automatically generated code by textreplacegen.py ++ ++ return-object p0 ++ .end method ++ ++ .method public static final slashClap(Ljava/lang/String;)Ljava/lang/String; ++ .locals 2 ++ ++ # Length of command + space ++ const/4 v0, 0x6 ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, " " ++ ++ const-string v1, " :clap: " ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ return-object p0 ++ .end method ++ ++ .method public static final slashOwo(Ljava/lang/String;)Ljava/lang/String; ++ .locals 2 ++ ++ # Length of command + space ++ const/4 v0, 0x5 ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ # Thanks Cynthia for the regex! ++ ++ const-string v0, "(?:r|l)" ++ ++ const-string v1, "w" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "(?:R|L)" ++ ++ const-string v1, "W" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "n([aeiou])" ++ ++ const-string v1, "ny$1" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "N([aeiou])" ++ ++ const-string v1, "Ny$1" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "N([AEIOU])" ++ ++ const-string v1, "NY$1" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "ove" ++ ++ const-string v1, "uv" ++ ++ invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ return-object p0 ++ .end method ++ + .method public static final slashCommands(Ljava/lang/String;)Ljava/lang/String; + .locals 1 + @@ -1155,9 +1963,106 @@ diff -crB com.discord-900-base/smali/com/discord/stores/StoreMessages.smali com. + + goto :goto_0 + -+ # Fw command ++ # Lenny command + :cond_9 -+ const-string v0, "/fw" ++ const-string v0, "/lenny" ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v0 ++ ++ if-eqz v0, :cond_10 ++ ++ invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashLenny(Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ goto :goto_0 ++ ++ # Fw command ++ :cond_10 ++ const-string v0, "/fw " ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v0 ++ ++ if-eqz v0, :cond_11 ++ ++ invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashFw(Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ goto :goto_0 ++ ++ # Small command ++ :cond_11 ++ const-string v0, "/small " ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v0 ++ ++ if-eqz v0, :cond_12 ++ ++ invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashSmall(Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ goto :goto_0 ++ ++ # Smaller command ++ :cond_12 ++ const-string v0, "/smaller " ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v0 ++ ++ if-eqz v0, :cond_13 ++ ++ invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashSmaller(Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ goto :goto_0 ++ ++ # Flip command ++ :cond_13 ++ const-string v0, "/flip " ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v0 ++ ++ if-eqz v0, :cond_14 ++ ++ invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashFlip(Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ goto :goto_0 ++ ++ # Clap command ++ # *jeb voice* please clap ++ :cond_14 ++ const-string v0, "/clap " ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v0 ++ ++ if-eqz v0, :cond_15 ++ ++ invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashClap(Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ goto :goto_0 ++ ++ # OwO command ++ :cond_15 ++ const-string v0, "/owo " + + invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z + @@ -1165,7 +2070,7 @@ diff -crB com.discord-900-base/smali/com/discord/stores/StoreMessages.smali com. + + if-eqz v0, :cond_0 + -+ invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashFw(Ljava/lang/String;)Ljava/lang/String; ++ invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashOwo(Ljava/lang/String;)Ljava/lang/String; + + move-result-object p0 + @@ -1182,22 +2087,40 @@ diff -crB com.discord-900-base/smali/com/discord/stores/StoreMessages.smali com. + .end method + + .method public static final interceptSendMessage(Ljava/lang/String;)Ljava/lang/String; -+ .locals 1 ++ .locals 2 ++ ++ const-string v0, "/" ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v0 ++ ++ if-eqz v0, :cond_0 + + invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashCommands(Ljava/lang/String;)Ljava/lang/String; + + move-result-object p0 + ++ :cond_0 + return-object p0 + .end method + + .method public static final interceptEditMessage(Ljava/lang/String;)Ljava/lang/String; -+ .locals 1 ++ .locals 2 ++ ++ const-string v0, "/" ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v0 ++ ++ if-eqz v0, :cond_0 + + invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashCommands(Ljava/lang/String;)Ljava/lang/String; + + move-result-object p0 + ++ :cond_0 + return-object p0 + .end method + @@ -1206,7 +2129,7 @@ diff -crB com.discord-900-base/smali/com/discord/stores/StoreMessages.smali com. .annotation system Ldalvik/annotation/Signature; *************** *** 977,982 **** ---- 2160,2169 ---- +--- 3083,3092 ---- invoke-static {p4, v0}, Lkotlin/jvm/internal/j;->h(Ljava/lang/Object;Ljava/lang/String;)V diff --git a/patches/slashcommands/README.md b/patches/slashcommands/README.md index 9cf2124e..d9a64b02 100644 --- a/patches/slashcommands/README.md +++ b/patches/slashcommands/README.md @@ -3,18 +3,26 @@ This patch adds a message intercept feature with minimal changes to the original code, and adds slash commands. The following slash commands are supported: -- /upper -- /lower -- /bold -- /spoiler -- /me -- /st (strikethrough) -- /shrug -- /tableflip -- /unflip -- /fw (fullwidth text) +- /upper -> Makes text uppercase +- /lower -> Makes text lowercase +- /bold -> Makes text bold +- /spoiler -> Marks your message as a spoiler (same as Discord Desktop) +- /me -> Display text with emphasis (same as Discord Desktop) +- /st -> Puts a strikethrough the message +- /shrug -> Appends ¯\\_(ツ)_/¯ to your message (same as Discord Desktop) +- /tableflip -> Appends (╯°□°)╯︵ ┻━┻ to your message (same as Discord Desktop) +- /unflip -> Appends ┬─┬ ノ( ゜-゜ノ) to your message (same as Discord Desktop) +- /lenny -> Appends ( ͡° ͜ʖ ͡°) to your message +- /owo -> Myakes tyext reawwy owo-ly, nya :3 -Commands like fw can be generated by `textreplacegen.py` provided in this folder. +Following commands are supported, but create less accessible text (so you should probably ensure that no one around you will be affected before you use them): +- /fw -> Makes text fullwidth (like "Sent from my Android Device") +- /small -> Makes text smaller (like "ᴛʜɪs") +- /smaller -> Makes text even smaller (like "ᵗʰvˢ") +- /flip -> Flips text (like "ʇɥıs") +- /clap -> Please :clap: clap + +Commands like fw can be generated by `textreplacegen.py` or `textreplacegen-array.py` provided in this folder. #### Available and tested on: - 9.0.0 diff --git a/patches/slashcommands/textreplacegen-array.py b/patches/slashcommands/textreplacegen-array.py new file mode 100644 index 00000000..ff9ac48a --- /dev/null +++ b/patches/slashcommands/textreplacegen-array.py @@ -0,0 +1,102 @@ +smol = { + "a": "ᴀ", + "b": "ʙ", + "c": "ᴄ", + "d": "ᴅ", + "e": "ᴇ", + "f": "ꜰ", + "g": "ɢ", + "h": "ʜ", + "i": "ɪ", + "j": "ᴊ", + "k": "ᴋ", + "l": "ʟ", + "m": "ᴍ", + "n": "ɴ", + "o": "ᴏ", + "p": "ᴘ", + "q": "ǫ", + "r": "ʀ", + "s": "s", + "t": "ᴛ", + "u": "ᴜ", + "v": "ᴠ", + "w": "ᴡ", + "x": "x", + "y": "ʏ", + "z": "ᴢ" +} + +smoller = { + "a": "ᵃ", + "b": "ᵇ", + "c": "ᶜ", + "d": "ᵈ", + "e": "ᵉ", + "f": "ᶠ", + "g": "ᵍ", + "h": "ʰ", + "i": "ᶦ", + "j": "ʲ", + "k": "ᵏ", + "l": "ˡ", + "m": "ᵐ", + "n": "ⁿ", + "o": "ᵒ", + "p": "ᵖ", + "q": "ᑫ", + "r": "ʳ", + "s": "ˢ", + "t": "ᵗ", + "u": "ᵘ", + "v": "ᵛ", + "w": "ʷ", + "x": "ˣ", + "y": "ʸ", + "z": "ᶻ" +} + +flipped = { + "a": "ɐ", + "b": "q", + "c": "ɔ", + "d": "p", + "e": "ǝ", + "f": "ɟ", + "g": "ƃ", + "h": "ɥ", + "i": "ı", + "j": "ɾ", + "k": "ʞ", + "l": "ן", + "m": "ɯ", + "n": "u", + "o": "o", + "p": "d", + "q": "b", + "r": "ɹ", + "s": "s", + "t": "ʇ", + "u": "n", + "v": "ʌ", + "w": "ʍ", + "x": "x", + "y": "ʎ", + "z": "z" +} + +code = """ + const-string v0, "before" + + const-string v1, "after" + + invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; + + move-result-object p0""" + +fw = flipped + +for entry in fw: + if entry in ["\\", "\""]: + continue + print(code.replace("before", entry).replace("after", fw[entry]))