From 9d7138b6a623dd7a55ddc464b68f08d31fe795ab Mon Sep 17 00:00:00 2001 From: Ave but on a massive iMac Date: Mon, 31 May 2021 18:31:10 +0300 Subject: [PATCH] Add showtag --- patches/showtag/78204.patch | 73 +++++++++++++++++++++++++++++++++++++ patches/showtag/README.md | 7 ++++ 2 files changed, 80 insertions(+) create mode 100644 patches/showtag/78204.patch diff --git a/patches/showtag/78204.patch b/patches/showtag/78204.patch new file mode 100644 index 0000000..0ae2bf0 --- /dev/null +++ b/patches/showtag/78204.patch @@ -0,0 +1,73 @@ +Binary files com.discord-base/build/apk/classes.dex and com.discord/build/apk/classes.dex differ +Binary files com.discord-base/dist/com.discord-78204.apk and com.discord/dist/com.discord-78204.apk differ +diff -crB com.discord-base/smali/com/discord/models/member/GuildMember$Companion.smali com.discord/smali/com/discord/models/member/GuildMember$Companion.smali +*** com.discord-base/smali/com/discord/models/member/GuildMember$Companion.smali 2021-05-31 14:05:54.000000000 +0300 +--- com.discord/smali/com/discord/models/member/GuildMember$Companion.smali 2021-05-31 18:27:22.000000000 +0300 +*************** +*** 530,535 **** +--- 530,567 ---- + :goto_4 + if-eqz v0, :cond_8 + ++ new-instance v1, Ljava/lang/StringBuilder; ++ ++ invoke-direct {v1, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V ++ ++ const-string v2, " (" ++ ++ invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; ++ ++ invoke-interface {p1}, Lcom/discord/models/user/User;->getUsername()Ljava/lang/String; ++ ++ move-result-object v2 ++ ++ invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; ++ ++ const-string v2, "#" ++ ++ invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; ++ ++ invoke-interface {p1}, Lcom/discord/models/user/User;->getDiscriminator()I ++ ++ move-result v2 ++ ++ invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; ++ ++ const-string v2, ")" ++ ++ invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; ++ ++ invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; ++ ++ move-result-object v0 ++ + goto :goto_5 + + :cond_8 +*************** +*** 537,542 **** +--- 569,592 ---- + + move-result-object v0 + ++ new-instance v1, Ljava/lang/StringBuilder; ++ ++ invoke-direct {v1, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V ++ ++ const-string v2, "#" ++ ++ invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; ++ ++ invoke-interface {p1}, Lcom/discord/models/user/User;->getDiscriminator()I ++ ++ move-result v2 ++ ++ invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; ++ ++ invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; ++ ++ move-result-object v0 ++ + :goto_5 + return-object v0 + .end method diff --git a/patches/showtag/README.md b/patches/showtag/README.md index c45d855..c1ef29f 100644 --- a/patches/showtag/README.md +++ b/patches/showtag/README.md @@ -10,6 +10,13 @@ Example, with nickname: ![](https://lasagna.cat/i/uy68njkr.png) + +#### Technical notes + +This hooks into `getNickOrUsername` function, specifically after `getNickname` is verified to be not empty. It creates a stringbuilder and appends ` (username#discriminator)` to it. + +As of 78.4 - Alpha, it also appends `#discriminator` to username. + #### Available and tested on: - 33.1 - 34.0