Compare commits

...

3 commits

Author SHA1 Message Date
53cc185d94
slashcommands: add /ctc nodelete 2019-10-05 20:12:20 +03:00
36e82810c7
slashcommands: add /spoilerimg 2019-10-05 19:51:31 +03:00
45dc42dfee
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
2019-10-05 16:44:02 +03:00
3 changed files with 288 additions and 40 deletions

View file

@ -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 ****
! <?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" android:installLocation="auto" package="com.discord" platformBuildVersionCode="967" platformBuildVersionName="9.6.7">
@ -35,7 +35,7 @@ diff -crB com.discord-967-base/AndroidManifest.xml com.discord-967/AndroidManife
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
! <application android:allowBackup="true" android:debuggable="true" android:appCategory="social" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:icon="@mipmap/ic_logo_square" android:label="@string/discord" android:largeHeap="true" android:name="com.discord.app.App" android:requestLegacyExternalStorage="true" android:roundIcon="@mipmap/ic_logo_round" android:supportsRtl="true" android:theme="@style/AppTheme.Dark" android:usesCleartextTraffic="@bool/use_cleartext_traffic">
! <application android:allowBackup="true" android:debuggable="true" android:appCategory="social" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:icon="@mipmap/ic_logo_square" android:label="@string/discord" android:largeHeap="true" android:name="com.discord.app.App" android:roundIcon="@mipmap/ic_logo_round" android:supportsRtl="true" android:theme="@style/AppTheme.Dark" android:usesCleartextTraffic="@bool/use_cleartext_traffic">
<activity android:name="com.discord.samsung.SamsungConnectActivity" android:theme="@style/AppTheme.Translucent"/>
<activity android:name="com.discord.app.AppActivity" android:screenOrientation="fullUser" android:theme="@style/AppTheme.Dark" android:windowSoftInputMode="adjustResize|stateHidden"/>
<activity android:exported="true" android:launchMode="singleTask" android:name="com.discord.app.AppActivity$Main" android:screenOrientation="fullUser" android:theme="@style/AppTheme.Loading" android:windowSoftInputMode="adjustResize|stateHidden">
@ -126,11 +126,9 @@ diff -crB com.discord-967-base/AndroidManifest.xml com.discord-967/AndroidManife
<meta-data android:name="com.android.vending.derived.apk.id" android:value="1"/>
</application>
! </manifest>
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 ****
<string name="disconnect_account_body">Disconnecting your account might remove you from servers you joined via this account.</string>
@ -198,10 +196,9 @@ diff -crB com.discord-967-base/res/values/strings.xml com.discord-967/res/values
<string name="suppress_all_embeds">Remove all embeds</string>
<string name="suppressed">Suppressed</string>
<string name="suppressed_afk_body">"It seems you've gone AFK on us. We've went ahead and moved you to the AFK channel."</string>
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 ****

View file

@ -1,6 +1,31 @@
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/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;-><init>()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:53:11.779466115 +0300
***************
*** 2193,2198 ****
--- 2193,2208 ----
@ -20,11 +45,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 20:04:57.620820485 +0300
***************
*** 432,437 ****
--- 432,441 ----
@ -40,7 +63,7 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com.
***************
*** 954,959 ****
--- 958,3739 ----
--- 958,3823 ----
return-void
.end method
@ -132,6 +155,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
+
@ -2263,7 +2309,7 @@ diff -crB com.discord-963-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
+
@ -2412,7 +2458,7 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com.
+
+ move-result v0
+
+ if-eqz v0, :cond_1
+ if-eqz v0, :cond_9
+
+ # Get value
+
@ -2481,8 +2527,43 @@ diff -crB com.discord-963-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
@ -2764,7 +2845,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 +2853,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 +2880,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 +2932,7 @@ diff -crB com.discord-963-base/smali/com/discord/stores/StoreMessages.smali com.
.annotation system Ldalvik/annotation/Signature;
***************
*** 983,988 ****
--- 3763,3772 ----
--- 3847,3856 ----
invoke-static {p4, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
@ -2836,12 +2943,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:54:29.323303188 +0300
***************
*** 1294,1299 ****
--- 1294,1474 ----
--- 1294,1547 ----
return v0
.end method
@ -2881,6 +2988,79 @@ 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 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
+
@ -3023,10 +3203,10 @@ 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
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:53:11.789466180 +0300
***************
*** 55,60 ****
--- 55,70 ----
@ -3046,10 +3226,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:53:11.789466180 +0300
***************
*** 371,376 ****
--- 371,402 ----
@ -3085,10 +3264,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:53:11.789466180 +0300
***************
*** 60,65 ****
--- 60,89 ----
@ -3122,4 +3300,75 @@ 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:53:11.789466180 +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;-><init>(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;
Only in com.discord-967/smali/okhttp3: MultipartBody$Part.smali.orig

View file

@ -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)
@ -25,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`)