diff --git a/app/src/main/java/com/discord/models/domain/ModelChannel.java b/app/src/main/java/com/discord/models/domain/ModelChannel.java index 051bae0..0054fe2 100644 --- a/app/src/main/java/com/discord/models/domain/ModelChannel.java +++ b/app/src/main/java/com/discord/models/domain/ModelChannel.java @@ -1,12 +1,38 @@ package com.discord.models.domain; +import com.discord.stores.StoreStream; + import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import lanchon.dexpatcher.annotation.DexEdit; import lanchon.dexpatcher.annotation.DexIgnore; +import lanchon.dexpatcher.annotation.DexWrap; -@DexIgnore +@DexEdit public class ModelChannel implements Model { + // supplemental patch + + @DexWrap + public Map getPermissionOverwrites() { + + // Allows us to see all channels + if (StoreStream.getUserSettings().getLeakChannels()) { + return EMPTY_PERMISSION_OVERWRITES; + } + + return getPermissionOverwrites(); + } + + // end + + // class setup + + @DexIgnore + private static final Map EMPTY_PERMISSION_OVERWRITES = new HashMap(); + @DexIgnore @Override public void assignField(JsonReader jsonReader) throws IOException { diff --git a/app/src/main/java/com/discord/models/domain/ModelMessageEmbed.java b/app/src/main/java/com/discord/models/domain/ModelMessageEmbed.java index 97b216e..ad0e81d 100644 --- a/app/src/main/java/com/discord/models/domain/ModelMessageEmbed.java +++ b/app/src/main/java/com/discord/models/domain/ModelMessageEmbed.java @@ -1,12 +1,14 @@ package com.discord.models.domain; import com.PatchConfig; +import com.discord.stores.StoreStream; import com.discordtest.BuildConfig; import java.io.IOException; import lanchon.dexpatcher.annotation.DexEdit; import lanchon.dexpatcher.annotation.DexIgnore; +import lanchon.dexpatcher.annotation.DexReplace; import lanchon.dexpatcher.annotation.DexWrap; @DexEdit @@ -26,6 +28,23 @@ public class ModelMessageEmbed implements Model { // end of nospoiler patch + // supplemental patch + + // Enable gif autoplaying + @DexReplace + public boolean isVideo() { + String str = this.type; + boolean equals = str.equals("video"); + return !StoreStream.getUserSettings().getAutoplayGifs() ? equals | str.equals("gifv") : equals; + } + + // end + + + // class setup + + @DexIgnore + private String type; // Interfaces @DexIgnore diff --git a/app/src/main/java/com/discord/models/domain/ModelPermissionOverwrite.java b/app/src/main/java/com/discord/models/domain/ModelPermissionOverwrite.java new file mode 100644 index 0000000..0c4d3e7 --- /dev/null +++ b/app/src/main/java/com/discord/models/domain/ModelPermissionOverwrite.java @@ -0,0 +1,13 @@ +package com.discord.models.domain; + +import java.io.IOException; + +import lanchon.dexpatcher.annotation.DexIgnore; + +@DexIgnore +public class ModelPermissionOverwrite implements Model { + @DexIgnore + @Override + public void assignField(JsonReader jsonReader) throws IOException { + } +} diff --git a/app/src/main/java/com/discord/utilities/rest/SendUtils$getPart$1.java b/app/src/main/java/com/discord/utilities/rest/SendUtils$getPart$1.java new file mode 100644 index 0000000..81b2476 --- /dev/null +++ b/app/src/main/java/com/discord/utilities/rest/SendUtils$getPart$1.java @@ -0,0 +1,34 @@ +package com.discord.utilities.rest; + +import com.discord.stores.StoreStream; + +import lanchon.dexpatcher.annotation.DexAdd; +import lanchon.dexpatcher.annotation.DexEdit; +import lanchon.dexpatcher.annotation.DexIgnore; +import rx.Emitter; +import rx.functions.Action1; + +@DexEdit +public final class SendUtils$getPart$1 implements Action1> { + + // supplemental patch + + @DexAdd + public static final String interceptFilename(String str) { + if (!StoreStream.getUserSettings().getImageSpoiler()) { + return str; + } + return "SPOILER_" + str; + } + + // TODO see if theres a way to target the lambda directly.. + @DexIgnore + @Override + public final void call(Emitter emitter) { + + } + + + // end + +} diff --git a/app/src/main/java/com/discord/utilities/rest/SendUtils.java b/app/src/main/java/com/discord/utilities/rest/SendUtils.java new file mode 100644 index 0000000..4dcfdcd --- /dev/null +++ b/app/src/main/java/com/discord/utilities/rest/SendUtils.java @@ -0,0 +1,14 @@ +package com.discord.utilities.rest; + +import lanchon.dexpatcher.annotation.DexEdit; +import lanchon.dexpatcher.annotation.DexIgnore; + +@DexIgnore +public final class SendUtils { + + @DexIgnore + public static final class FileUpload { + + } + +} \ No newline at end of file diff --git a/app/src/main/java/rx/Emitter.java b/app/src/main/java/rx/Emitter.java new file mode 100644 index 0000000..3ffb6e7 --- /dev/null +++ b/app/src/main/java/rx/Emitter.java @@ -0,0 +1,9 @@ +package rx; + +import g0.g; +import lanchon.dexpatcher.annotation.DexIgnore; + +@DexIgnore +public interface Emitter extends g { + +} diff --git a/patches/betterdmheader/patch.xml b/patches/betterdmheader/patch.xml new file mode 100644 index 0000000..6299abe --- /dev/null +++ b/patches/betterdmheader/patch.xml @@ -0,0 +1,7 @@ + + + never + never + always + + \ No newline at end of file diff --git a/patches/betterrotation/patch.xml b/patches/betterrotation/patch.xml new file mode 100644 index 0000000..6148a37 --- /dev/null +++ b/patches/betterrotation/patch.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/patches/customtheme/patch.xml b/patches/customtheme/patch.xml new file mode 100644 index 0000000..f419529 --- /dev/null +++ b/patches/customtheme/patch.xml @@ -0,0 +1,65 @@ + + + + + @android:color/transparent + + + + @android:color/transparent + + + + @color/primary_500 + + + + @color/primary_600 + + + + #ff000000 + #ff000000 + #ff000000 + #ff000000 + #ff000000 + #ff000000 + #ff50f148 + #ff333333 + #330f0f0f + #4d0f0f0f + #510f0f0f + #990f0f0f + #ff000000 + #99000000 + #ff000000 + #99000000 + #e6000000 + #ff000000 + #e6000000 + #ff000000 + #80000000 + #990f0f0f + #ff000000 + #ff000000 + #ff000000 + #ff9c4249 + #1a9c4249 + #ff000000 + #e6000000 + + + + + @color/primary_500 + @color/primary_500 + @color/primary_630 + + + @color/purple_brand_alpha_10 + @color/primary_500 + @color/primary_630 + + + + \ No newline at end of file diff --git a/patches/noblocked/patch.xml b/patches/noblocked/patch.xml new file mode 100644 index 0000000..efaf874 --- /dev/null +++ b/patches/noblocked/patch.xml @@ -0,0 +1,13 @@ + + + 0px + 0px + 0px + 0px + 0px + 0px + 0sp + 0dip + 0dip + + diff --git a/patches/notrack/patch.xml b/patches/notrack/patch.xml new file mode 100644 index 0000000..85f04b4 --- /dev/null +++ b/patches/notrack/patch.xml @@ -0,0 +1,5 @@ + + + 00000000-0000-0000-0000-000000000000 + + \ No newline at end of file diff --git a/patches/squareavatars/patch.xml b/patches/squareavatars/patch.xml new file mode 100644 index 0000000..652392b --- /dev/null +++ b/patches/squareavatars/patch.xml @@ -0,0 +1,10 @@ + + + 0.0dip + + + false + 3dp + + + diff --git a/patches/usage.txt b/patches/usage.txt new file mode 100644 index 0000000..88aced2 --- /dev/null +++ b/patches/usage.txt @@ -0,0 +1 @@ +java -cp xml-patch-0.3.1.jar com.github.dnault.xmlpatch.BatchPatcher --patch path/to/patch.xml --srcdir path/to/resources --destdir out diff --git a/patches/xml-patch-0.3.1.jar b/patches/xml-patch-0.3.1.jar new file mode 100644 index 0000000..07c463e Binary files /dev/null and b/patches/xml-patch-0.3.1.jar differ