From 45dc42dfeee0e4485d6dd4262125214bf6f4b515 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Sat, 5 Oct 2019 16:44:02 +0300 Subject: [PATCH 1/3] branding: Fix build issues This might break compat with Android 10, but until Apktool supports this field, there's not much I can do. Relevant issue: https://github.com/iBotPeaches/Apktool/issues/2167 --- patches/branding/967.patch | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/patches/branding/967.patch b/patches/branding/967.patch index 0be7a07..3e9f1ec 100644 --- a/patches/branding/967.patch +++ b/patches/branding/967.patch @@ -1,6 +1,6 @@ diff -crB com.discord-967-base/AndroidManifest.xml com.discord-967/AndroidManifest.xml *** com.discord-967-base/AndroidManifest.xml 2019-10-05 16:20:00.414666371 +0300 ---- com.discord-967/AndroidManifest.xml 2019-10-05 16:20:50.501673118 +0300 +--- com.discord-967/AndroidManifest.xml 2019-10-05 16:42:07.709855390 +0300 *************** *** 1,4 **** ! @@ -35,7 +35,7 @@ diff -crB com.discord-967-base/AndroidManifest.xml com.discord-967/AndroidManife -! +! @@ -126,11 +126,9 @@ diff -crB com.discord-967-base/AndroidManifest.xml com.discord-967/AndroidManife ! -Only in com.discord-967: AndroidManifest.xml.orig -Only in com.discord-967: AndroidManifest.xml.rej diff -crB com.discord-967-base/apktool.yml com.discord-967/apktool.yml *** com.discord-967-base/apktool.yml 2019-10-05 16:19:01.894273804 +0300 ---- com.discord-967/apktool.yml 2019-10-05 16:20:17.794782960 +0300 +--- com.discord-967/apktool.yml 2019-10-05 16:41:43.713038408 +0300 *************** *** 181,185 **** tag: null @@ -146,7 +144,7 @@ diff -crB com.discord-967-base/apktool.yml com.discord-967/apktool.yml ! versionName: 9.6.7-cutthecord-CTCBUILD diff -crB com.discord-967-base/res/values/strings.xml com.discord-967/res/values/strings.xml *** com.discord-967-base/res/values/strings.xml 2019-10-05 16:18:58.797586364 +0300 ---- com.discord-967/res/values/strings.xml 2019-10-05 16:20:17.798116316 +0300 +--- com.discord-967/res/values/strings.xml 2019-10-05 16:41:43.719705116 +0300 *************** *** 1310,1316 **** Disconnecting your account might remove you from servers you joined via this account. @@ -198,10 +196,9 @@ diff -crB com.discord-967-base/res/values/strings.xml com.discord-967/res/values Remove all embeds Suppressed "It seems you've gone AFK on us. We've went ahead and moved you to the AFK channel." -Only in com.discord-967/res/values: strings.xml.orig diff -crB com.discord-967-base/smali/com/discord/app/e.smali com.discord-967/smali/com/discord/app/e.smali *** com.discord-967-base/smali/com/discord/app/e.smali 2019-10-05 16:18:59.964260856 +0300 ---- com.discord-967/smali/com/discord/app/e.smali 2019-10-05 16:20:17.798116316 +0300 +--- com.discord-967/smali/com/discord/app/e.smali 2019-10-05 16:41:43.719705116 +0300 *************** *** 56,62 **** .line 17 @@ -221,7 +218,7 @@ diff -crB com.discord-967-base/smali/com/discord/app/e.smali com.discord-967/sma sput-object v0, Lcom/discord/app/e;->wz:Ljava/lang/String; diff -crB com.discord-967-base/smali/com/discord/utilities/captcha/CaptchaHelper$showCaptchaHelpDialog$$inlined$let$lambda$1.smali com.discord-967/smali/com/discord/utilities/captcha/CaptchaHelper$showCaptchaHelpDialog$$inlined$let$lambda$1.smali *** com.discord-967-base/smali/com/discord/utilities/captcha/CaptchaHelper$showCaptchaHelpDialog$$inlined$let$lambda$1.smali 2019-10-05 16:19:00.180928977 +0300 ---- com.discord-967/smali/com/discord/utilities/captcha/CaptchaHelper$showCaptchaHelpDialog$$inlined$let$lambda$1.smali 2019-10-05 16:20:17.798116316 +0300 +--- com.discord-967/smali/com/discord/utilities/captcha/CaptchaHelper$showCaptchaHelpDialog$$inlined$let$lambda$1.smali 2019-10-05 16:41:43.719705116 +0300 *************** *** 77,83 **** From 36e82810c714274660d623aa840be25cdac24b8f Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Sat, 5 Oct 2019 19:51:31 +0300 Subject: [PATCH 2/3] slashcommands: add /spoilerimg --- patches/slashcommands/967.patch | 208 +++++++++++++++++++++++++++----- patches/slashcommands/README.md | 1 + 2 files changed, 181 insertions(+), 28 deletions(-) diff --git a/patches/slashcommands/967.patch b/patches/slashcommands/967.patch index 5000ce3..e3f6c55 100644 --- a/patches/slashcommands/967.patch +++ b/patches/slashcommands/967.patch @@ -1,6 +1,8 @@ -diff -crB com.discord-963-base/smali/com/discord/models/domain/ModelChannel.smali com.discord-963/smali/com/discord/models/domain/ModelChannel.smali -*** com.discord-963-base/smali/com/discord/models/domain/ModelChannel.smali 2019-10-01 22:09:20.573988563 +0300 ---- com.discord-963/smali/com/discord/models/domain/ModelChannel.smali 2019-10-01 22:47:54.389314892 +0300 +Only in com.discord-967: build +Only in com.discord-967: dist +diff -crB com.discord-967-base/smali/com/discord/models/domain/ModelChannel.smali com.discord-967/smali/com/discord/models/domain/ModelChannel.smali +*** com.discord-967-base/smali/com/discord/models/domain/ModelChannel.smali 2019-10-05 16:19:00.004261125 +0300 +--- com.discord-967/smali/com/discord/models/domain/ModelChannel.smali 2019-10-05 19:10:43.321011414 +0300 *************** *** 2193,2198 **** --- 2193,2208 ---- @@ -20,11 +22,9 @@ diff -crB com.discord-963-base/smali/com/discord/models/domain/ModelChannel.smal .line 270 iget-object v0, p0, Lcom/discord/models/domain/ModelChannel;->permissionOverwrites:Ljava/util/Map; -Only in com.discord-963/smali/com/discord/models/domain: ModelChannel.smali.orig -Only in com.discord-963/smali/com/discord/models/domain: ModelChannel.smali.rej -diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com.discord-963/smali/com/discord/stores/StoreMessages.smali -*** com.discord-963-base/smali/com/discord/stores/StoreMessages.smali 2019-10-01 22:09:20.797323381 +0300 ---- com.discord-963/smali/com/discord/stores/StoreMessages.smali 2019-10-01 22:47:11.022360664 +0300 +diff -crB com.discord-967-base/smali/com/discord/stores/StoreMessages.smali com.discord-967/smali/com/discord/stores/StoreMessages.smali +*** com.discord-967-base/smali/com/discord/stores/StoreMessages.smali 2019-10-05 16:19:00.147595419 +0300 +--- com.discord-967/smali/com/discord/stores/StoreMessages.smali 2019-10-05 19:46:25.046923530 +0300 *************** *** 432,437 **** --- 432,441 ---- @@ -40,7 +40,7 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com. *************** *** 954,959 **** ---- 958,3739 ---- +--- 958,3788 ---- return-void .end method @@ -132,6 +132,29 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com. + return-object p0 + .end method + ++ .method public static final slashSpoilerImg(Ljava/lang/String;)Ljava/lang/String; ++ .locals 3 ++ ++ # Length of command ++ const/16 v0, 0xb ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ # Set image spoiler thing ++ ++ const/4 v1, 0x1 ++ ++ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings; ++ ++ move-result-object v2 ++ ++ invoke-virtual {v2, v1}, Lcom/discord/stores/StoreUserSettings;->setImageSpoiler(Z)V ++ ++ return-object p0 ++ .end method ++ + .method public static final slashMe(Ljava/lang/String;)Ljava/lang/String; + .locals 2 + @@ -2764,7 +2787,7 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com. + + move-result v0 + -+ if-eqz v0, :cond_0 ++ if-eqz v0, :cond_17 + + invoke-static {p0}, Lcom/discord/stores/StoreMessages;->slashMorse(Ljava/lang/String;)Ljava/lang/String; + @@ -2772,6 +2795,22 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com. + + goto :goto_0 + ++ # SpoilerImg command ++ :cond_17 ++ const-string v0, "/spoilerimg" ++ ++ 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;->slashSpoilerImg(Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ goto :goto_0 ++ + :cond_0 + :goto_0 + # And finally, trim output before sending it back @@ -2783,8 +2822,18 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com. + .end method + + .method public static final interceptSendMessage(Ljava/lang/String;)Ljava/lang/String; -+ .locals 2 ++ .locals 3 + ++ # Intercept all messages and set image spoiler to false ++ const/4 v1, 0x0 ++ ++ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings; ++ ++ move-result-object v2 ++ ++ invoke-virtual {v2, v1}, Lcom/discord/stores/StoreUserSettings;->setImageSpoiler(Z)V ++ ++ # Do regular intercept things + const-string v0, "/" + + invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z @@ -2825,7 +2874,7 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com. .annotation system Ldalvik/annotation/Signature; *************** *** 983,988 **** ---- 3763,3772 ---- +--- 3812,3821 ---- invoke-static {p4, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V @@ -2836,12 +2885,12 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com. const/4 v0, 0x1 if-eqz p6, :cond_0 -diff -crB com.discord-963-base/smali/com/discord/stores/StoreUserSettings.smali com.discord-963/smali/com/discord/stores/StoreUserSettings.smali -*** com.discord-963-base/smali/com/discord/stores/StoreUserSettings.smali 2019-10-01 22:09:20.853990424 +0300 ---- com.discord-963/smali/com/discord/stores/StoreUserSettings.smali 2019-10-01 22:47:11.025694020 +0300 +diff -crB com.discord-967-base/smali/com/discord/stores/StoreUserSettings.smali com.discord-967/smali/com/discord/stores/StoreUserSettings.smali +*** com.discord-967-base/smali/com/discord/stores/StoreUserSettings.smali 2019-10-05 16:19:00.170928909 +0300 +--- com.discord-967/smali/com/discord/stores/StoreUserSettings.smali 2019-10-05 19:29:35.161160111 +0300 *************** *** 1294,1299 **** ---- 1294,1474 ---- +--- 1294,1510 ---- return v0 .end method @@ -2881,6 +2930,42 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreUserSettings.smali + return-void + .end method + ++ .method public getImageSpoiler()Z ++ .locals 3 ++ ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; ++ ++ const-string v1, "CACHE_KEY_CTC_IMAGE_SPOILER" ++ ++ const/4 v2, 0x0 ++ ++ invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z ++ ++ move-result v0 ++ ++ return v0 ++ .end method ++ ++ .method public setImageSpoiler(Z)V ++ .locals 2 ++ ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; ++ ++ invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; ++ ++ move-result-object v0 ++ ++ const-string v1, "CACHE_KEY_CTC_IMAGE_SPOILER" ++ ++ invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor; ++ ++ move-result-object p1 ++ ++ invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V ++ ++ return-void ++ .end method ++ + .method public getShowTyping()Z + .locals 3 + @@ -3023,10 +3108,9 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreUserSettings.smali .method handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V .locals 0 -Only in com.discord-963/smali/com/discord/stores: StoreUserSettings.smali.orig -diff -crB com.discord-963-base/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali com.discord-963/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali -*** com.discord-963-base/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2019-10-01 22:09:21.107325442 +0300 ---- com.discord-963/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2019-10-01 22:47:11.025694020 +0300 +diff -crB com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali +*** com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2019-10-05 16:19:00.327596627 +0300 +--- com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2019-10-05 19:10:43.327678122 +0300 *************** *** 55,60 **** --- 55,70 ---- @@ -3046,10 +3130,9 @@ diff -crB com.discord-963-base/smali/com/discord/widgets/chat/input/WidgetChatIn .line 222 invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z -Only in com.discord-963/smali/com/discord/widgets/chat/input: WidgetChatInputEditText$1.smali.orig -diff -crB com.discord-963-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali com.discord-963/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali -*** com.discord-963-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali 2019-10-01 22:09:21.110658797 +0300 ---- com.discord-963/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali 2019-10-01 22:47:11.025694020 +0300 +diff -crB com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali +*** com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali 2019-10-05 16:19:00.330929983 +0300 +--- com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali 2019-10-05 19:10:43.327678122 +0300 *************** *** 371,376 **** --- 371,402 ---- @@ -3085,10 +3168,9 @@ diff -crB com.discord-963-base/smali/com/discord/widgets/chat/input/WidgetChatIn invoke-static {v10, v2}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V .line 74 -Only in com.discord-963/smali/com/discord/widgets/chat/input: WidgetChatInputSend$configureSendListeners$1.smali.orig -diff -crB com.discord-963-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali com.discord-963/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali -*** com.discord-963-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali 2019-10-01 22:09:21.110658797 +0300 ---- com.discord-963/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali 2019-10-01 22:47:11.025694020 +0300 +diff -crB com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali +*** com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali 2019-10-05 16:19:00.330929983 +0300 +--- com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali 2019-10-05 19:10:43.327678122 +0300 *************** *** 60,65 **** --- 60,89 ---- @@ -3122,4 +3204,74 @@ diff -crB com.discord-963-base/smali/com/discord/widgets/chat/input/WidgetChatIn .method private final clearInput(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;)Z .locals 1 +diff -crB com.discord-967-base/smali/okhttp3/MultipartBody$Part.smali com.discord-967/smali/okhttp3/MultipartBody$Part.smali +*** com.discord-967-base/smali/okhttp3/MultipartBody$Part.smali 2019-10-05 16:19:00.700932465 +0300 +--- com.discord-967/smali/okhttp3/MultipartBody$Part.smali 2019-10-05 19:45:23.729878243 +0300 +*************** +*** 43,50 **** + return-void + .end method + + .method public static a(Ljava/lang/String;Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part; +! .locals 2 + .param p1 # Ljava/lang/String; + .annotation runtime Ljavax/annotation/Nullable; + .end annotation +--- 43,84 ---- + return-void + .end method + ++ .method public static final interceptFilename(Ljava/lang/String;)Ljava/lang/String; ++ .locals 3 ++ ++ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings; ++ ++ move-result-object v0 ++ ++ invoke-virtual {v0}, Lcom/discord/stores/StoreUserSettings;->getImageSpoiler()Z ++ ++ move-result v1 ++ ++ if-eqz v1, :cond_1 ++ ++ new-instance v2, Ljava/lang/StringBuilder; ++ ++ const-string v1, "SPOILER_" ++ ++ invoke-direct {v2, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V ++ ++ invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; ++ ++ invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ # I commented this out and do this in StoreMessages now as this'd only work for a single image ++ # const/4 v1, 0x0 ++ ++ # invoke-virtual {v0, v1}, Lcom/discord/stores/StoreUserSettings;->setImageSpoiler(Z)V ++ ++ :cond_1 ++ return-object p0 ++ .end method ++ + .method public static a(Ljava/lang/String;Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part; +! .locals 5 + .param p1 # Ljava/lang/String; + .annotation runtime Ljavax/annotation/Nullable; + .end annotation +*************** +*** 69,74 **** +--- 103,113 ---- + .line 255 + invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; + ++ invoke-static {p1}, Lokhttp3/MultipartBody$Part;->interceptFilename(Ljava/lang/String;)Ljava/lang/String; ++ ++ move-result-object p1 ++ ++ :cond_2 + .line 256 + invoke-static {v0, p1}, Lokhttp3/MultipartBody;->a(Ljava/lang/StringBuilder;Ljava/lang/String;)Ljava/lang/StringBuilder; + diff --git a/patches/slashcommands/README.md b/patches/slashcommands/README.md index def3f60..4829452 100644 --- a/patches/slashcommands/README.md +++ b/patches/slashcommands/README.md @@ -7,6 +7,7 @@ The following slash commands are supported: - /lower -> Makes text lowercase - /bold -> Makes text bold - /spoiler -> Marks your message as a spoiler (same as Discord Desktop) +- /spoilerimg -> Prepends SPOILER_ to names of all images attached to the message that starts with this, causing them to get marked as spoiler. - /me -> Display text with emphasis (same as Discord Desktop) - /st -> Puts a strikethrough the message - /shrug -> Appends ¯\\_(ツ)_/¯ to your message (same as Discord Desktop) From 53cc185d94301975d5528be71ef23c1cdb1b4848 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Sat, 5 Oct 2019 20:12:20 +0300 Subject: [PATCH 3/3] slashcommands: add /ctc nodelete --- patches/slashcommands/967.patch | 123 ++++++++++++++++++++++++++++---- patches/slashcommands/README.md | 1 + 2 files changed, 111 insertions(+), 13 deletions(-) diff --git a/patches/slashcommands/967.patch b/patches/slashcommands/967.patch index e3f6c55..775ddd4 100644 --- a/patches/slashcommands/967.patch +++ b/patches/slashcommands/967.patch @@ -1,8 +1,31 @@ Only in com.discord-967: build Only in com.discord-967: dist +diff -crB com.discord-967-base/smali/com/discord/gateway/io/IncomingParser.smali com.discord-967/smali/com/discord/gateway/io/IncomingParser.smali +*** com.discord-967-base/smali/com/discord/gateway/io/IncomingParser.smali 2019-10-05 16:18:59.987594346 +0300 +--- com.discord-967/smali/com/discord/gateway/io/IncomingParser.smali 2019-10-05 19:58:29.938199601 +0300 +*************** +*** 703,708 **** +--- 703,719 ---- + + .line 73 + :goto_4 ++ ++ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings; ++ ++ move-result-object v0 ++ ++ invoke-virtual {v0}, Lcom/discord/stores/StoreUserSettings;->getNoDelete()Z ++ ++ move-result v4 ++ ++ if-nez v4, :cond_b ++ + new-instance v0, Lcom/discord/models/domain/ModelMessageDelete; + + invoke-direct {v0}, Lcom/discord/models/domain/ModelMessageDelete;->()V diff -crB com.discord-967-base/smali/com/discord/models/domain/ModelChannel.smali com.discord-967/smali/com/discord/models/domain/ModelChannel.smali *** com.discord-967-base/smali/com/discord/models/domain/ModelChannel.smali 2019-10-05 16:19:00.004261125 +0300 ---- com.discord-967/smali/com/discord/models/domain/ModelChannel.smali 2019-10-05 19:10:43.321011414 +0300 +--- com.discord-967/smali/com/discord/models/domain/ModelChannel.smali 2019-10-05 19:53:11.779466115 +0300 *************** *** 2193,2198 **** --- 2193,2208 ---- @@ -24,7 +47,7 @@ diff -crB com.discord-967-base/smali/com/discord/models/domain/ModelChannel.smal diff -crB com.discord-967-base/smali/com/discord/stores/StoreMessages.smali com.discord-967/smali/com/discord/stores/StoreMessages.smali *** com.discord-967-base/smali/com/discord/stores/StoreMessages.smali 2019-10-05 16:19:00.147595419 +0300 ---- com.discord-967/smali/com/discord/stores/StoreMessages.smali 2019-10-05 19:46:25.046923530 +0300 +--- com.discord-967/smali/com/discord/stores/StoreMessages.smali 2019-10-05 20:04:57.620820485 +0300 *************** *** 432,437 **** --- 432,441 ---- @@ -40,7 +63,7 @@ diff -crB com.discord-967-base/smali/com/discord/stores/StoreMessages.smali com. *************** *** 954,959 **** ---- 958,3788 ---- +--- 958,3823 ---- return-void .end method @@ -2286,7 +2309,7 @@ diff -crB com.discord-967-base/smali/com/discord/stores/StoreMessages.smali com. + + invoke-virtual {v0, v1}, Lcom/discord/stores/StoreUserSettings;->setLeakChannels(Z)V + -+ const-string p0, "CTC: Successfully set leakchannels state." ++ const-string p0, "CTC: Successfully set channelleak state." + + return-object p0 + @@ -2435,7 +2458,7 @@ diff -crB com.discord-967-base/smali/com/discord/stores/StoreMessages.smali com. + + move-result v0 + -+ if-eqz v0, :cond_1 ++ if-eqz v0, :cond_9 + + # Get value + @@ -2504,8 +2527,43 @@ diff -crB com.discord-967-base/smali/com/discord/stores/StoreMessages.smali com. + + return-object p0 + ++ :cond_9 ++ const-string v0, "nodelete " ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v0 ++ ++ if-eqz v0, :cond_1 ++ ++ # Move to config value interpretation ++ ++ const/16 v0, 0x9 ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "true" ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v1 ++ ++ # Set value ++ ++ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings; ++ ++ move-result-object v0 ++ ++ invoke-virtual {v0, v1}, Lcom/discord/stores/StoreUserSettings;->setNoDelete(Z)V ++ ++ const-string p0, "CTC: Successfully set nodelete state." ++ ++ return-object p0 ++ + :cond_1 -+ const-string p0, "CTC: No known command supplied. (available: token, showtyping, channelleak, addaccount, account. Everything except specified token needs to be lowercase)" ++ const-string p0, "CTC: No known command supplied. (available: token, showtyping, channelleak, addaccount, account, nodelete. Everything except specified token needs to be lowercase)" + + return-object p0 + .end method @@ -2874,7 +2932,7 @@ diff -crB com.discord-967-base/smali/com/discord/stores/StoreMessages.smali com. .annotation system Ldalvik/annotation/Signature; *************** *** 983,988 **** ---- 3812,3821 ---- +--- 3847,3856 ---- invoke-static {p4, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V @@ -2887,10 +2945,10 @@ diff -crB com.discord-967-base/smali/com/discord/stores/StoreMessages.smali com. if-eqz p6, :cond_0 diff -crB com.discord-967-base/smali/com/discord/stores/StoreUserSettings.smali com.discord-967/smali/com/discord/stores/StoreUserSettings.smali *** com.discord-967-base/smali/com/discord/stores/StoreUserSettings.smali 2019-10-05 16:19:00.170928909 +0300 ---- com.discord-967/smali/com/discord/stores/StoreUserSettings.smali 2019-10-05 19:29:35.161160111 +0300 +--- com.discord-967/smali/com/discord/stores/StoreUserSettings.smali 2019-10-05 19:54:29.323303188 +0300 *************** *** 1294,1299 **** ---- 1294,1510 ---- +--- 1294,1547 ---- return v0 .end method @@ -2966,6 +3024,43 @@ diff -crB com.discord-967-base/smali/com/discord/stores/StoreUserSettings.smali + return-void + .end method + ++ ++ .method public getNoDelete()Z ++ .locals 3 ++ ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; ++ ++ const-string v1, "CACHE_KEY_CTC_NO_DELETE" ++ ++ const/4 v2, 0x0 ++ ++ invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z ++ ++ move-result v0 ++ ++ return v0 ++ .end method ++ ++ .method public setNoDelete(Z)V ++ .locals 2 ++ ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; ++ ++ invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; ++ ++ move-result-object v0 ++ ++ const-string v1, "CACHE_KEY_CTC_NO_DELETE" ++ ++ invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor; ++ ++ move-result-object p1 ++ ++ invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V ++ ++ return-void ++ .end method ++ + .method public getShowTyping()Z + .locals 3 + @@ -3108,9 +3203,10 @@ diff -crB com.discord-967-base/smali/com/discord/stores/StoreUserSettings.smali .method handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V .locals 0 +Only in com.discord-967/smali/com/discord/widgets/auth: WidgetAuthLogin.smali.orig diff -crB com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali *** com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2019-10-05 16:19:00.327596627 +0300 ---- com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2019-10-05 19:10:43.327678122 +0300 +--- com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2019-10-05 19:53:11.789466180 +0300 *************** *** 55,60 **** --- 55,70 ---- @@ -3132,7 +3228,7 @@ diff -crB com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatIn diff -crB com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali *** com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali 2019-10-05 16:19:00.330929983 +0300 ---- com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali 2019-10-05 19:10:43.327678122 +0300 +--- com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali 2019-10-05 19:53:11.789466180 +0300 *************** *** 371,376 **** --- 371,402 ---- @@ -3170,7 +3266,7 @@ diff -crB com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatIn .line 74 diff -crB com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali *** com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali 2019-10-05 16:19:00.330929983 +0300 ---- com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali 2019-10-05 19:10:43.327678122 +0300 +--- com.discord-967/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali 2019-10-05 19:53:11.789466180 +0300 *************** *** 60,65 **** --- 60,89 ---- @@ -3206,7 +3302,7 @@ diff -crB com.discord-967-base/smali/com/discord/widgets/chat/input/WidgetChatIn diff -crB com.discord-967-base/smali/okhttp3/MultipartBody$Part.smali com.discord-967/smali/okhttp3/MultipartBody$Part.smali *** com.discord-967-base/smali/okhttp3/MultipartBody$Part.smali 2019-10-05 16:19:00.700932465 +0300 ---- com.discord-967/smali/okhttp3/MultipartBody$Part.smali 2019-10-05 19:45:23.729878243 +0300 +--- com.discord-967/smali/okhttp3/MultipartBody$Part.smali 2019-10-05 19:53:11.789466180 +0300 *************** *** 43,50 **** return-void @@ -3274,4 +3370,5 @@ diff -crB com.discord-967-base/smali/okhttp3/MultipartBody$Part.smali com.discor .line 256 invoke-static {v0, p1}, Lokhttp3/MultipartBody;->a(Ljava/lang/StringBuilder;Ljava/lang/String;)Ljava/lang/StringBuilder; +Only in com.discord-967/smali/okhttp3: MultipartBody$Part.smali.orig diff --git a/patches/slashcommands/README.md b/patches/slashcommands/README.md index 4829452..e53c92d 100644 --- a/patches/slashcommands/README.md +++ b/patches/slashcommands/README.md @@ -26,6 +26,7 @@ Following commands are supported, but create less accessible text (so you should CutTheCord has a couple features that can utilized with slash commands as well: - /ctc channelleak true/false -> Shows all channels, even those you don't have permissions to view (might mess with channel editing or editing while it's enabled) - /ctc notyping true/false -> Disables typing event so that it's not visible when you type (true = typing is shown, false = not shown) +- /ctc nodelete true/false -> Disables handling of message delete events. Currently deletes messages don't have anything changed about them, but I plan to append "(deleted)" to them eventually. (true = Deleted messages stay, false = they get deleted) - /ctc token -> Gives your token - /ctc token $token -> Sets your token to the one specified, allowing switching between accounts - /ctc addaccount $name $token -> Adds an account to the account switcher (name can be anything, token will be set to the current one if it's `current`)