From 7d47f603a04eb2c24c3ad94f16d3774e6cc5c6a6 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Mon, 28 Jan 2019 15:51:30 +0300 Subject: [PATCH] compact, smalltime: Introduce patches --- patches/compact/835.patch | 82 ++++++++++++++++ patches/compact/README.md | 9 ++ patches/smalltime/835.patch | 190 ++++++++++++++++++++++++++++++++++++ patches/smalltime/README.md | 7 ++ 4 files changed, 288 insertions(+) create mode 100644 patches/compact/835.patch create mode 100644 patches/compact/README.md create mode 100644 patches/smalltime/835.patch create mode 100644 patches/smalltime/README.md diff --git a/patches/compact/835.patch b/patches/compact/835.patch new file mode 100644 index 00000000..2c973aa8 --- /dev/null +++ b/patches/compact/835.patch @@ -0,0 +1,82 @@ +diff -crB -x dist -x build com.discord-835-base/res/layout-v17/widget_chat_list_adapter_item_text.xml com.discord-835/res/layout-v17/widget_chat_list_adapter_item_text.xml +*** com.discord-835-base/res/layout-v17/widget_chat_list_adapter_item_text.xml 2019-01-25 10:57:34.419248514 +0300 +--- com.discord-835/res/layout-v17/widget_chat_list_adapter_item_text.xml 2019-01-28 15:43:17.237442681 +0300 +*************** +*** 2,12 **** + + +- + + + + + +- + +\ No newline at end of file +--- 2,14 ---- + + + + ++ + ++ + ++ ++ + + +\ No newline at end of file +*** com.discord-835-base/res/layout/widget_chat_list_adapter_item_text.xml 2019-01-25 10:57:34.355914908 +0300 +--- com.discord-835/res/layout/widget_chat_list_adapter_item_text.xml 2019-01-28 15:47:10.325214783 +0300 +*************** +*** 2,12 **** + + +- + + + + + +- + +\ No newline at end of file +--- 2,11 ---- + + + + + + ++ + + +\ No newline at end of file +diff -crB -x dist -x build com.discord-835-base/res/values/dimens.xml com.discord-835/res/values/dimens.xml +*** com.discord-835-base/res/values/dimens.xml 2019-01-25 10:57:34.429248557 +0300 +--- com.discord-835/res/values/dimens.xml 2019-01-28 13:48:12.582594416 +0300 +*************** +*** 330,337 **** + 4.0dip + 0.75dip + 96.0dip +! 58.0dip +! 62.0dip + 48.0dip + 72.0dip + 3.0dip +--- 330,337 ---- + 4.0dip + 0.75dip + 96.0dip +! 20.0dip +! 24.0dip + 48.0dip + 72.0dip + 3.0dip \ No newline at end of file diff --git a/patches/compact/README.md b/patches/compact/README.md new file mode 100644 index 00000000..1ae67825 --- /dev/null +++ b/patches/compact/README.md @@ -0,0 +1,9 @@ +## DisTok CutTheCord: Compact Message Patch + +This patch, when combined with `smalltime` patch, emulates the "compact"/"irc" theme of the discord desktop client. + +![](https://elixi.re/i/nbuosbqc.png) + +#### Available and tested on: +- 8.3.5g + diff --git a/patches/smalltime/835.patch b/patches/smalltime/835.patch new file mode 100644 index 00000000..8ecd613c --- /dev/null +++ b/patches/smalltime/835.patch @@ -0,0 +1,190 @@ +diff -crB -x dist -x build com.discord-835-base/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali com.discord-835/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali +*** com.discord-835-base/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali 2019-01-25 10:57:34.672582939 +0300 +--- com.discord-835/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali 2019-01-28 15:23:40.845156072 +0300 +*************** +*** 247,419 **** + .end method + + .method public toReadableTimeString(Ljava/lang/Long;)Ljava/lang/String; +! .locals 6 +! +! .line 126 +! invoke-virtual {p0}, Lcom/miguelgaeta/simple_time/SimpleTime;->currentTimeMillis()J +! +! move-result-wide v0 +! +! invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; +! +! move-result-object v0 +! +! invoke-virtual {p0, v0}, Lcom/miguelgaeta/simple_time/SimpleTime;->toCalendar(Ljava/lang/Long;)Ljava/util/Calendar; +! +! move-result-object v0 +! +! const/4 v1, 0x0 +! +! const/16 v2, 0xb +! +! .line 128 +! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V +! +! const/16 v2, 0xc +! +! .line 129 +! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V +! +! const/16 v2, 0xd +! +! .line 130 +! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V +! +! const/16 v2, 0xe +! +! .line 131 +! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V +! +! .line 133 +! iget-object v1, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->locale:Ljava/util/Locale; +! +! invoke-virtual {v1}, Ljava/util/Locale;->getLanguage()Ljava/lang/String; +! +! move-result-object v1 +! +! const-string v2, "en" +! +! invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z +! +! move-result v1 +! +! if-nez v1, :cond_1 +! +! .line 136 +! invoke-virtual {p1}, Ljava/lang/Long;->longValue()J +! +! move-result-wide v1 +! +! invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J +! +! move-result-wide v3 +! +! cmp-long v0, v1, v3 +! +! if-lez v0, :cond_0 +! +! .line 137 + iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat; + + invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String; + +- move-result-object p1 +- +- return-object p1 +- +- .line 139 +- :cond_0 +- iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterDateTime:Ljava/text/DateFormat; +- +- invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String; +- +- move-result-object p1 +- +- return-object p1 +- +- .line 143 +- :cond_1 +- invoke-virtual {p1}, Ljava/lang/Long;->longValue()J +- +- move-result-wide v1 +- +- invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J +- +- move-result-wide v3 +- +- cmp-long v5, v1, v3 +- +- if-lez v5, :cond_2 +- +- .line 144 +- new-instance v0, Ljava/lang/StringBuilder; +- +- const-string v1, "Today at " +- +- invoke-direct {v0, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V +- +- iget-object v1, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat; +- +- invoke-virtual {v1, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String; +- +- move-result-object p1 +- +- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; +- +- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; +- +- move-result-object p1 +- +- return-object p1 +- +- :cond_2 +- const/4 v1, 0x5 +- +- const/4 v2, -0x1 +- +- .line 147 +- invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->add(II)V +- +- .line 149 +- invoke-virtual {p1}, Ljava/lang/Long;->longValue()J +- +- move-result-wide v1 +- +- invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J +- +- move-result-wide v3 +- +- cmp-long v0, v1, v3 +- +- if-lez v0, :cond_3 +- +- .line 150 +- new-instance v0, Ljava/lang/StringBuilder; +- +- const-string v1, "Yesterday at " +- +- invoke-direct {v0, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V +- +- iget-object v1, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat; +- +- invoke-virtual {v1, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String; +- +- move-result-object p1 +- +- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; +- +- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; +- +- move-result-object p1 +- +- return-object p1 +- +- .line 153 +- :cond_3 +- iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterDateTime:Ljava/text/DateFormat; +- +- invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String; +- + move-result-object p1 + + return-object p1 +--- 247,257 ---- + .end method + + .method public toReadableTimeString(Ljava/lang/Long;)Ljava/lang/String; +! .locals 1 + iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat; + + invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String; + + move-result-object p1 + + return-object p1 \ No newline at end of file diff --git a/patches/smalltime/README.md b/patches/smalltime/README.md new file mode 100644 index 00000000..9bc8fcb3 --- /dev/null +++ b/patches/smalltime/README.md @@ -0,0 +1,7 @@ +## DisTok CutTheCord: Small Time Patch + +This patch replaces the long time string with just a simple time string. This is useful when combined with `compact` patch. + +#### Available and tested on: +- 8.3.5g +