*** com.discord-base/smali/com/discord/widgets/chat/list/WidgetChatListAdapterItemMessage.smali Wed Jan 13 14:03:21 2021
---…
I made the patch file using WinMerge so it may be formatted incorrectly. Hope this helps though.
Done in version 1392 (latest)
@BlueMods Do you have a problem with me merging this, with credits given to you?
No problem, it's nice to give back to a project that helped me as long as I get credit for it
To be clear, this guy originally copied the smali out of my Bluecord mod, and originally did not give any credit nor mention where it came from. Nice patch though!
Is it supposed to change your nickname in a specific guild or across Discord?
Couldn't find 34.0 APK, so I just modded 33.1. Should be very easy to port to latest.
Sorry I don't know how to PR, but this should be helpful, have any questions, let me know.
Below method found in Lcom/discord/widgets/chat/input/emoji/EmojiPickerViewModel$Companion;
patches are near end of method and the modified / added lines begin with a -
.method private final buildEmojiListItems(Ljava/util/List;Ljava/lang/String;Z)Ljava/util/List;
.locals 7
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"+",
"Lcom/discord/models/domain/emoji/Emoji;",
">;",
"Ljava/lang/String;",
"Z)",
"Ljava/util/List<",
"Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;",
">;"
}
.end annotation
.line 1
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
if-nez p1, :cond_0
return-object v0
.line 2
:cond_0
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p1
:cond_1
:goto_0
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_3
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/discord/models/domain/emoji/Emoji;
.line 3
invoke-interface {v1}, Lcom/discord/models/domain/emoji/Emoji;->getNames()Ljava/util/List;
move-result-object v2
invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v2
:cond_2
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_1
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/String;
const-string v4, "name"
.line 4
invoke-static {v3, v4}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;
move-result-object v4
const-string v5, "Locale.getDefault()"
invoke-static {v4, v5}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v3, v4}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
move-result-object v4
const-string v5, "(this as java.lang.String).toLowerCase(locale)"
invoke-static {v4, v5}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const/4 v5, 0x0
const/4 v6, 0x2
invoke-static {v4, p2, v5, v6}, Lj0/t/p;->contains$default(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZI)Z
move-result v4
if-eqz v4, :cond_2
# check if allowed for use
- invoke-interface {v1}, Lcom/discord/models/domain/emoji/Emoji;->isActuallyAvailable()Z
- move-result v4
# if and only if it's allowed, we add to the list
- if-eqz v4, :cond_2
.line 5
new-instance v2, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapter$EmojiItem;
invoke-direct {v2, v1, v3, p3}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapter$EmojiItem;-><init>(Lcom/discord/models/domain/emoji/Emoji;Ljava/lang/String;Z)V
.line 6
invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_0
:cond_3
return-object v0
.end method
methods below are required to make this patch and the pseudo nitro patch to be compatible these are just the unmodded methods for emote checking to see if we are allowed to use it we need to override in both classes that implement the abstract Emoji class for it to work
Lcom/discord/models/domain/emoji/Emoji;
.method public abstract isActuallyAvailable()Z
.end method
Lcom/discord/models/domain/emoji/ModelEmojiCustom;
.method public isActuallyAvailable()Z
.locals 1
.line 1
iget-boolean v0, p0, Lcom/discord/models/domain/emoji/ModelEmojiCustom;->isUsable:Z
return v0
.end method
Lcom/discord/models/domain/emoji/ModelEmojiUnicode;
.method public isActuallyAvailable()Z
.locals 1
const/4 v0, 0x1
return v0
.end method
Definitely not possible to remotely update with the way it's set up, you'd need a way to update the binary and Discord definitely doesn't have the ability. Perhaps it's an AB test?