diff --git a/resources/patches/betterdmheader/87202.patch b/resources/patches/betterdmheader/87202.patch deleted file mode 100644 index a258298..0000000 --- a/resources/patches/betterdmheader/87202.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -crB from/smali_classes2/com/discord/widgets/home/WidgetHomeHeaderManager$getOnConfigureAction$1.smali to/smali_classes2/com/discord/widgets/home/WidgetHomeHeaderManager$getOnConfigureAction$1.smali -*** from/smali_classes2/com/discord/widgets/home/WidgetHomeHeaderManager$getOnConfigureAction$1.smali 2020-11-19 15:23:43.685245089 +0000 ---- to/smali_classes2/com/discord/widgets/home/WidgetHomeHeaderManager$getOnConfigureAction$1.smali 2020-11-19 15:26:07.886953277 +0000 -*************** -*** 181,187 **** - - invoke-static {v3, v9}, Ld0/z/d/m;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V - -! invoke-interface {v3, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem; - - .line 7 - invoke-interface {p1, v8}, Landroid/view/Menu;->findItem(I)Landroid/view/MenuItem; ---- 181,187 ---- - - invoke-static {v3, v9}, Ld0/z/d/m;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V - -! invoke-interface {v3, v2}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem; - - .line 7 - invoke-interface {p1, v8}, Landroid/view/Menu;->findItem(I)Landroid/view/MenuItem; -*************** -*** 360,366 **** - - invoke-static {v3, v9}, Ld0/z/d/m;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V - -! invoke-interface {v3, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem; - - .line 19 - invoke-interface {p1, v6}, Landroid/view/Menu;->findItem(I)Landroid/view/MenuItem; ---- 360,366 ---- - - invoke-static {v3, v9}, Ld0/z/d/m;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V - -! invoke-interface {v3, v2}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem; - - .line 19 - invoke-interface {p1, v6}, Landroid/view/Menu;->findItem(I)Landroid/view/MenuItem; diff --git a/resources/patches/disable-mobileindicator/87202.patch b/resources/patches/disable-mobileindicator/87202.patch index 04bcf67..954dd9f 100644 --- a/resources/patches/disable-mobileindicator/87202.patch +++ b/resources/patches/disable-mobileindicator/87202.patch @@ -1,4 +1,29 @@ diff -crB from/smali/com/discord/utilities/analytics/AnalyticSuperProperties.smali to/smali/com/discord/utilities/analytics/AnalyticSuperProperties.smali +*** from/smali_classes2/com/discord/widgets/home/WidgetHomeHeaderManager$getOnConfigureAction$1.smali 2021-08-04 19:46:28.632872300 +0100 +--- to/smali_classes2/com/discord/widgets/home/WidgetHomeHeaderManager$getOnConfigureAction$1.smali 2021-08-04 21:06:15.420553000 +0100 +*************** +*** 181,187 **** + + invoke-static {v3, v9}, Ld0/z/d/m;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V + +! invoke-interface {v3, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem; + + .line 7 + invoke-interface {p1, v8}, Landroid/view/Menu;->findItem(I)Landroid/view/MenuItem; +--- 181,187 ---- + + invoke-static {v3, v9}, Ld0/z/d/m;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V + +! invoke-interface {v3, v2}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem; + + .line 7 + invoke-interface {p1, v8}, Landroid/view/Menu;->findItem(I)Landroid/view/MenuItem; +clienthax@DESKTOP-KM4G6JD:/mnt/c/Users/clienthax/Documents/Projects/cutthecord/ugh$ +clienthax@DESKTOP-KM4G6JD:/mnt/c/Users/clienthax/Documents/Projects/cutthecord/ugh$ +clienthax@DESKTOP-KM4G6JD:/mnt/c/Users/clienthax/Documents/Projects/cutthecord/ugh$ +clienthax@DESKTOP-KM4G6JD:/mnt/c/Users/clienthax/Documents/Projects/cutthecord/ugh$ +clienthax@DESKTOP-KM4G6JD:/mnt/c/Users/clienthax/Documents/Projects/cutthecord/ugh$ +clienthax@DESKTOP-KM4G6JD:/mnt/c/Users/clienthax/Documents/Projects/cutthecord/ugh$ diff -crB from/smali/com/discord/utilities/analytics/AnalyticSuperProperties.smali to/smali/com/discord/utilities/analytics/AnalyticSuperProperties.smali *** from/smali/com/discord/utilities/analytics/AnalyticSuperProperties.smali 2021-08-04 19:45:49.058376400 +0100 --- to/smali/com/discord/utilities/analytics/AnalyticSuperProperties.smali 2021-08-04 21:13:23.168882700 +0100 *************** diff --git a/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/CTCCommands.java b/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/CTCCommands.java index 39e07e3..7da7eca 100644 --- a/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/CTCCommands.java +++ b/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/CTCCommands.java @@ -1,13 +1,9 @@ package com.cutthecord.commands; -import com.cutthecord.commands.commands.CmdCtc; -import com.cutthecord.commands.commands.CmdEmojify; -import com.cutthecord.commands.commands.CmdOwo; -import com.cutthecord.commands.commands.CmdSpoilerImg; +import com.cutthecord.commands.commands.*; import com.discord.api.commands.ApplicationCommandType; import com.discord.api.commands.CommandChoice; -import com.discord.models.commands.ApplicationCommand; -import com.discord.models.commands.ApplicationCommandOption; +import com.discord.models.commands.*; import com.discord.stores.BuiltInCommands; import d0.z.d.m; import d0.z.d.o; @@ -15,10 +11,7 @@ import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.DefaultConstructorMarker; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; @SuppressWarnings("SameParameterValue") public class CTCCommands { @@ -42,6 +35,8 @@ public class CTCCommands { public static void CreateCTCCommands(BuiltInCommands builtIn) { // Used in command creation in BuiltinCommands, one more than the last reference + // TODO help text? + // Add existing commands ArrayList commands = new ArrayList<>(builtIn.getBuiltInCommands()); @@ -66,16 +61,25 @@ public class CTCCommands { commands.add(createHandleRawMessageCommand("owo", "Myakes tyext reawwy owo-ly, nya :3", "Message", new CmdOwo())); // owo commands.add(createHandleRawMessageCommand("emojify", "Emojify text", "Message", new CmdEmojify())); // emojify - commands.add(createHandleRawMessageCommand("spoilerimg", "Prepends SPOILER_ to names of all images attached to the message that starts with this, causing them to get marked as spoiler", "Message", new CmdSpoilerImg())); - commands.add(createEnableDisableCommand("channelleak", "Shows all hidden channels", new CmdCtc.CmdCtcChannelLeak())); - commands.add(createEnableDisableCommand("showtyping", "Change typing event so that its visible/not when you type", new CmdCtc.CmdCtcShowTyping())); - commands.add(createEnableDisableCommand("nodelete", "Disables handling of message delete events", new CmdCtc.CmdCtcNoDelete())); - commands.add(createHandleRawMessageCommand("gettoken", "Get current token, DO NOT USE IN PUBLIC", null, new CmdCtc.CmdCtcGetToken())); - commands.add(createHandleRawMessageCommand("settoken", "Set current token, DO NOT USE IN PUBLIC", "Token", new CmdCtc.CmdCtcSetToken())); - commands.add(createHandleRawMessageCommand("switchaccount", "Switch to specified account, DO NOT USE IN PUBLIC", "Name", new CmdCtc.CmdCtcSwitchAccount())); - // TODO addaccount + // TODO + /* + + cmds.put("spoilerimg", new CmdSpoilerImg()); + + // TODO can we add an CTC user that responds for these? + Command ctcCommand = new CmdCtc(); + + ctcCommand.registerSubCommand("channelleak", new CmdCtc.CmdCtcChannelLeak()); + ctcCommand.registerSubCommand("showtyping", new CmdCtc.CmdCtcShowTyping()); + ctcCommand.registerSubCommand("token", new CmdCtc.CmdCtcToken()); + ctcCommand.registerSubCommand("account", new CmdCtc.CmdCtcAccount()); + ctcCommand.registerSubCommand("addaccount", new CmdCtc.CmdCtcAddAccount()); + ctcCommand.registerSubCommand("nodelete", new CmdCtc.CmdCtcNoDelete()); + + cmds.put("ctc", ctcCommand); + */ // Builtin list is non modifiable, lets hijack it instead :) try { @@ -266,44 +270,10 @@ public class CTCCommands { } } - final static class EnableDisableCommand extends o implements Function1, String> { - public final EnableDisableHandler handler; - - public EnableDisableCommand(EnableDisableHandler handler) { - super(1); - this.handler = handler; - } - - public final String invoke(Map options) { - m.checkNotNullParameter(options, "commandOptions"); - StringBuilder newMessage = new StringBuilder(); - - boolean enabled = (boolean) options.get("enabled"); - - newMessage.append(handler.processEnableDisable(enabled)); - return newMessage.toString(); - } - } - private static ApplicationCommand createHandleRawMessageCommand(String name, String cmdDesc, String optionDesc, RawMsgHandler handler) { - boolean required = true; - if (optionDesc == null) { - required = false; - } return makeCtcCommand(name, cmdDesc, Collections.singletonList( - makeOption(ApplicationCommandType.STRING, "message", optionDesc, null, required, required, null, null, 192, null) + makeOption(ApplicationCommandType.STRING, "message", optionDesc, null, false, false, null, null, 192, null) ), new RawMessageCommand(handler)); } - private static ApplicationCommand createEnableDisableCommand(String name, String cmdDesc, EnableDisableHandler handler) { - ArrayList truefalse = new ArrayList<>(); - truefalse.add(new CommandChoice("on", "true")); - truefalse.add(new CommandChoice("off", "false")); - - return makeCtcCommand(name, cmdDesc, Collections.singletonList( - makeOption(ApplicationCommandType.BOOLEAN, "enabled", "Enable/Disable", null, true, true, truefalse, null, 192, null) - ), new EnableDisableCommand(handler)); - } - - } diff --git a/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/EnableDisableHandler.java b/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/EnableDisableHandler.java deleted file mode 100644 index e90a9e3..0000000 --- a/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/EnableDisableHandler.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.cutthecord.commands; - -public interface EnableDisableHandler { - - String processEnableDisable(boolean enabled); - -} diff --git a/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/commands/CmdCtc.java b/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/commands/CmdCtc.java index 24066b3..f8c1614 100644 --- a/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/commands/CmdCtc.java +++ b/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/commands/CmdCtc.java @@ -1,175 +1,131 @@ -package com.cutthecord.commands.commands; +/*package com.cutthecord.commands.commands; -import com.cutthecord.commands.EnableDisableHandler; -import com.cutthecord.commands.RawMsgHandler; +import com.cutthecord.commands.CommandHandler; import com.discord.stores.StoreStream; import com.discord.stores.StoreUserSettings; -import java.lang.reflect.Method; - -public class CmdCtc { +public class CmdCtc extends CommandHandler.PrivateCommand { // TODO make token calls write directly to clipboard - // TODO make supplemental inject a interface so we can just cast instead of using reflection + // TODO replace patched method calls with reflection + @Override + public String getPopupInfo() { + return "cheese"; + } - public static class CmdCtcChannelLeak implements EnableDisableHandler { + + + public static class CmdCtcChannelLeak extends CommandHandler.PrivateCommand { @Override - public String processEnableDisable(boolean enabled) { - try { - //noinspection JavaReflectionMemberAccess - final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setLeakChannels", boolean.class); - m.invoke(StoreStream.getUserSettings(), enabled); - } catch (Exception e) { - System.out.println("Failed to call StoreStream.getUserSettings().setLeakChannels"); + public String handleCommand(String msg) { + StoreStream.getUserSettings().setLeakChannels(msg.startsWith("false")); + return "CTC: Successfully set channelleak state."; + } - System.out.println("Declared"); - for (Method m : StoreStream.getUserSettings().getClass().getDeclaredMethods()) { - System.out.println(m.getName()+" "+ m.toString()); - } - - System.out.println(); - System.out.println("Methods"); - for (Method m : StoreStream.getUserSettings().getClass().getMethods()) { - System.out.println(m.getName()+" "+ m.toString()); - } - - e.printStackTrace(); - return "Failed to call StoreStream.getUserSettings().setLeakChannels"; - } - return "CTC: Successfully set channelleak state."; // TODO use notification + @Override + public String getPopupInfo() { + return "Shows all channels, even those you don’t have permissions to view"; } } - public static class CmdCtcShowTyping implements EnableDisableHandler { + public static class CmdCtcShowTyping extends CommandHandler.PrivateCommand { @Override - public String processEnableDisable(boolean enabled) { + public String handleCommand(String msg) { + StoreStream.getUserSettings().setShowTyping(msg.startsWith("true")); + return "CTC: Successfully set showtyping state."; + } - try { - //noinspection JavaReflectionMemberAccess - final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setShowTyping", boolean.class); - m.invoke(StoreStream.getUserSettings(), enabled); - } catch (Exception e) { - System.out.println("Failed to call StoreStream.getUserSettings().setShowTyping"); - e.printStackTrace(); - } - - return "CTC: Successfully set showtyping state."; // TODO use notification + @Override + public String getPopupInfo() { + return "Change typing event so that its visible/not when you type"; } } - public static class CmdCtcNoDelete implements EnableDisableHandler { + public static class CmdCtcToken extends CommandHandler.PrivateCommand { @Override - public String processEnableDisable(boolean enabled) { - - try { - //noinspection JavaReflectionMemberAccess - final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setNoDelete", boolean.class); - m.invoke(StoreStream.getUserSettings(), enabled); - } catch (Exception e) { - System.out.println("Failed to call StoreStream.getUserSettings().setNoDelete"); - e.printStackTrace(); - } - - return "CTC: Successfully set nodelete state."; // TODO use notification - } - - } - - public static class CmdCtcGetToken implements RawMsgHandler { - - @Override - public String processRawMessage(String orig) { - try { - //noinspection JavaReflectionMemberAccess - final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("getStoredToken"); - return (String) m.invoke(StoreStream.getUserSettings()); // TODO notification - } catch (Exception e) { - System.out.println("Failed to call StoreStream.getUserSettings().getStoredToken()"); - e.printStackTrace(); - } - - return ""; - } - - } - - public static class CmdCtcSetToken implements RawMsgHandler { - - @Override - public String processRawMessage(String msg) { - - try { - //noinspection JavaReflectionMemberAccess - final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setStoredToken", String.class); - m.invoke(StoreStream.getUserSettings(), msg); - } catch (Exception e) { - System.out.println("Failed to call StoreStream.getUserSettings().setStoredToken()"); - e.printStackTrace(); + public String handleCommand(String msg) { + if (msg.isEmpty()) { + // Print token + return StoreStream.getUserSettings().getStoredToken(); } + // Set token + StoreStream.getUserSettings().setStoredToken(msg); return "CTC: Successfully changed token. Please restart application."; } - } - - public static class CmdCtcSwitchAccount implements RawMsgHandler { - @Override - public String processRawMessage(String msg) { - String trim = msg.trim(); - StoreUserSettings userSettings = StoreStream.getUserSettings(); - - try { - //noinspection JavaReflectionMemberAccess - final Method m1 = userSettings.getClass().getDeclaredMethod("getAccountToken", String.class); - String accountToken = (String) m1.invoke(userSettings, trim); - if (accountToken.startsWith("none")) { - return "CTC: No such account found."; - } - - //noinspection JavaReflectionMemberAccess - final Method m2 = userSettings.getClass().getDeclaredMethod("setStoredToken", String.class); - m2.invoke(userSettings, accountToken); - return "CTC: Successfully changed accounts. Please restart application."; - } catch (Exception e) { - e.printStackTrace(); - } - - return ""; + public String getPopupInfo() { + return "Gives or sets token"; } } - public static class CmdCtcAddAccount implements RawMsgHandler {//TODO + public static class CmdCtcAccount extends CommandHandler.PrivateCommand { @Override - public String processRawMessage(String msg) { - String substring3 = msg.substring(msg.indexOf(" ")); - String accName = msg.replace(substring3, "").trim(); - String accToken = substring3.trim(); - + public String handleCommand(String msg) { + String trim = msg.trim(); StoreUserSettings userSettings = StoreStream.getUserSettings(); - if (accName.startsWith("current")) { - accName = StoreStream.getUsers().getMe().getUsername(); - accToken = StoreStream.getUsers().getMe().getToken(); + String accountToken = userSettings.getAccountToken(trim); + if (accountToken.startsWith("none")) { + return "CTC: No such account found."; } - try { - final Method m = userSettings.getClass().getDeclaredMethod("setAccountToken", String.class, String.class); - m.invoke(userSettings, accName, accToken); - } catch (Exception e) { - e.printStackTrace(); - } + userSettings.setStoredToken(accountToken); + return "CTC: Successfully changed accounts. Please restart application."; + } + @Override + public String getPopupInfo() { + return "Switches to the account specified"; + } + + } + + public static class CmdCtcAddAccount extends CommandHandler.PrivateCommand { + + @Override + public String handleCommand(String msg) { + String substring3 = msg.substring(msg.indexOf(" ")); + String trim2 = msg.replace(substring3, "").trim(); + String trim3 = substring3.trim(); + StoreUserSettings userSettings2 = StoreStream.getUserSettings(); + if (trim2.startsWith("current")) { + trim2 = userSettings2.getStoredToken(); + } + userSettings2.setAccountToken(trim2, trim3); return "CTC: Added account."; } + @Override + public String getPopupInfo() { + return "Adds an account to the account switcher"; + } + } + public static class CmdCtcNoDelete extends CommandHandler.PrivateCommand { + + @Override + public String handleCommand(String msg) { + StoreStream.getUserSettings().setNoDelete(msg.startsWith("true")); + return "CTC: Successfully set nodelete state."; + } + + @Override + public String getPopupInfo() { + return "Disables handling of message delete events"; + } + + } + + } +*/ \ No newline at end of file diff --git a/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/commands/CmdSpoilerImg.java b/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/commands/CmdSpoilerImg.java index f01e617..8c2ea5f 100644 --- a/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/commands/CmdSpoilerImg.java +++ b/resources/patches/slashcommands/code/src/main/java/com/cutthecord/commands/commands/CmdSpoilerImg.java @@ -1,25 +1,17 @@ package com.cutthecord.commands.commands; -import com.cutthecord.commands.RawMsgHandler; import com.discord.stores.StoreStream; -import java.lang.reflect.Method; +public class CmdSpoilerImg { -public class CmdSpoilerImg implements RawMsgHandler { + public String handleCommand(String msg) { + // TODO StoreStream.getUserSettings().setImageSpoiler(true); + return msg; + } - @Override - public String processRawMessage(String orig) { - try { - // Added by Supplemental patch - //noinspection JavaReflectionMemberAccess - final Method m = StoreStream.getUserSettings().getClass().getDeclaredMethod("setImageSpoiler", Boolean.class); - m.invoke(StoreStream.getUserSettings(), true); - } catch (Exception e) { - System.out.println("Failed to call StoreStream.getUserSettings().setImageSpoiler(true)"); - e.printStackTrace(); - } - return orig; + public String getPopupInfo() { + return "Prepends SPOILER_ to names of all images attached to the message that starts with this, causing them to get marked as spoiler"; } } diff --git a/resources/patches/supplemental/87202.patch b/resources/patches/supplemental/87202.patch index 9a4e77e..ec54853 100644 --- a/resources/patches/supplemental/87202.patch +++ b/resources/patches/supplemental/87202.patch @@ -21,65 +21,77 @@ diff -crB from/smali/com/discord/gateway/io/IncomingParser.smali to/smali/com/di new-instance v0, Lcom/discord/models/domain/ModelMessageDelete; invoke-direct {v0}, Lcom/discord/models/domain/ModelMessageDelete;->()V -diff -crB from/smali/com/discord/api/channel/Channel.smali to/smali/com/discord/api/channel/Channel.smali +diff -crB from/smali/com/discord/models/domain/ModelChannel.smali to/smali/com/discord/models/domain/ModelChannel.smali *** from/smali/com/discord/api/channel/Channel.smali 2021-08-10 20:23:56.976468100 +0100 --- to/smali/com/discord/api/channel/Channel.smali 2021-08-11 17:13:48.876902500 +0100 *************** -*** 1774,1783 **** +*** 1774,1779 **** +--- 1774,1789 ---- } .end annotation -! .line 1 -! iget-object v0, p0, Lcom/discord/api/channel/Channel;->permissionOverwrites:Ljava/util/List; - - return-object v0 - .end method - - .method public final t()I ---- 1774,1800 ---- - } - .end annotation - -! invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings; -! -! move-result-object v0 -! -! invoke-virtual {v0}, Lcom/discord/stores/StoreUserSettings;->getLeakChannels()Z -! -! move-result v0 -! -! if-eqz v0, :cond_0 - -+ invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List; ++ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings; + + move-result-object v0 + -+ :goto_0 - return-object v0 ++ invoke-virtual {v0}, Lcom/discord/stores/StoreUserSettings;->getLeakChannels()Z + -+ :cond_0 -+ iget-object v0, p0, Lcom/discord/api/channel/Channel;->permissionOverwrites:Ljava/util/List; ++ move-result v0 + -+ goto :goto_0 - .end method ++ if-eqz v0, :cond_0 ++ + .line 1 + iget-object v0, p0, Lcom/discord/api/channel/Channel;->permissionOverwrites:Ljava/util/List; - .method public final t()I diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/discord/stores/StoreUserSettings.smali *** from/smali/com/discord/stores/StoreUserSettings.smali 2020-11-16 13:22:49.513198310 +0000 --- to/smali/com/discord/stores/StoreUserSettings.smali 2020-11-16 13:57:09.234000134 +0000 *************** *** 2899,2904 **** ---- 2899,3178 ---- +--- 2899,3188 ---- return-void .end method ++ .method public getAutoplayGifs()Z ++ .locals 3 ++ ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; ++ ++ const-string v1, "CACHE_KEY_CTC_AUTOPLAY_GIFS" ++ ++ const/4 v2, 0x1 ++ ++ invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z ++ ++ move-result v0 ++ ++ return v0 ++ .end method ++ ++ .method public setAutoplayGifs(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_AUTOPLAY_GIFS" ++ ++ 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 getLeakChannels()Z + .locals 3 + -+ .line 1 -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; + + const-string v1, "CACHE_KEY_CTC_LEAK_CHANNELS" + @@ -95,9 +107,7 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + .method public setLeakChannels(Z)V + .locals 2 + -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; + + invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; + @@ -117,14 +127,11 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + .method public getImageSpoiler()Z + .locals 3 + -+ .line 1 -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; + + const-string v1, "CACHE_KEY_CTC_IMAGE_SPOILER" + -+ const/4 v2, 0x1 ++ const/4 v2, 0x0 + + invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z + @@ -136,9 +143,7 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + .method public setImageSpoiler(Z)V + .locals 2 + -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; + + invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; + @@ -155,17 +160,15 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + return-void + .end method + ++ + .method public getNoDelete()Z + .locals 3 + -+ .line 1 -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; + + const-string v1, "CACHE_KEY_CTC_NO_DELETE" + -+ const/4 v2, 0x1 ++ const/4 v2, 0x0 + + invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z + @@ -177,9 +180,7 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + .method public setNoDelete(Z)V + .locals 2 + -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; + + invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; + @@ -199,10 +200,7 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + .method public getShowTyping()Z + .locals 3 + -+ .line 1 -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; + + const-string v1, "CACHE_KEY_CTC_SHOW_TYPING" + @@ -218,9 +216,7 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + .method public setShowTyping(Z)V + .locals 2 + -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; + + invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; + @@ -237,12 +233,11 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + return-void + .end method + ++ + .method public getStoredToken()Ljava/lang/String; + .locals 3 + -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreAuthentication;->prefs:Landroid/content/SharedPreferences; + + const-string v1, "none" + @@ -259,9 +254,7 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + .method public setStoredToken(Ljava/lang/String;)V + .locals 2 + -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreAuthentication;->prefs:Landroid/content/SharedPreferences; + + invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; + @@ -297,9 +290,7 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + + move-result-object v2 + -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreAuthentication;->prefs:Landroid/content/SharedPreferences; + + const-string v1, "none" + @@ -330,9 +321,7 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis + + move-result-object v1 + -+ invoke-virtual {p0}, Lcom/discord/stores/Store;->getPrefs()Landroid/content/SharedPreferences; -+ -+ move-result-object v0 ++ iget-object v0, p0, Lcom/discord/stores/StoreAuthentication;->prefs:Landroid/content/SharedPreferences; + + invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; + diff --git a/resources/xmlpatches/betterdmheader/87202.xml b/resources/xmlpatches/betterdmheader/87202.xml deleted file mode 100644 index d858450..0000000 --- a/resources/xmlpatches/betterdmheader/87202.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - never - never - always - -