diff --git a/proguard-rules.pro b/proguard-rules.pro index 0f28bdddf..640276083 100644 --- a/proguard-rules.pro +++ b/proguard-rules.pro @@ -7,6 +7,10 @@ -keep class com.kyleduo.switchbutton.Configuration +-keep class com.google.gson.reflect.TypeToken +-keep class * extends com.google.gson.reflect.TypeToken +-keep public class * implements java.lang.reflect.Type + -keep class com.soundcloud.android.crop.** -keep class com.google.android.gms.** diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 909efb7a9..80fe39a7b 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -691,7 +691,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable } public String getOccupantId() { - return occupantId; + return this.occupantId; } public void setMucUser(MucOptions.User user) { diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index 19d065832..1b6cc9844 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -887,7 +887,7 @@ public class MucOptions { private final MucOptions options; private ChatState chatState = Config.DEFAULT_CHAT_STATE; protected Set hats; - protected String occupantId; + private String occupantId; protected boolean online = true; public User(MucOptions options, Jid fullJid, final String occupantId, final String nick, final Set hats) { @@ -924,7 +924,7 @@ public class MucOptions { } public String getOccupantId() { - return occupantId; + return this.occupantId; } public String getNick() { diff --git a/src/main/java/eu/siacs/conversations/entities/Reaction.java b/src/main/java/eu/siacs/conversations/entities/Reaction.java index 67d169374..38eb46d4c 100644 --- a/src/main/java/eu/siacs/conversations/entities/Reaction.java +++ b/src/main/java/eu/siacs/conversations/entities/Reaction.java @@ -5,12 +5,11 @@ import androidx.annotation.NonNull; import com.google.common.base.MoreObjects; import com.google.common.base.Strings; import com.google.common.collect.Collections2; -import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; import com.google.common.collect.Multimaps; import com.google.common.collect.Ordering; -import com.google.common.reflect.TypeToken; +import com.google.gson.reflect.TypeToken; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; @@ -22,6 +21,7 @@ import com.google.gson.stream.JsonWriter; import eu.siacs.conversations.xmpp.Jid; import java.io.IOException; +import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -76,7 +76,8 @@ public class Reaction { return Collections.emptyList(); } try { - return GSON.fromJson(asString, new TypeToken>() {}.getType()); + Type type = new TypeToken>() {}.getType(); + return GSON.fromJson(asString, type); } catch (final JsonSyntaxException e) { return Collections.emptyList(); } diff --git a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java index a1671d04c..ee47cb305 100644 --- a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java +++ b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java @@ -151,7 +151,7 @@ public abstract class AbstractParser { fullJid = null; } } - Jid realJid = item.getAttributeAsJid("jid"); + final Jid realJid = item.getAttributeAsJid("jid"); if (fullJid != null) nick = fullJid.getResource(); String nickname = null; if (nick != null && nicknameIn != null) nickname = nick.equals(nicknameIn) ? nick : null; diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index d511360b6..0f8ee017d 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -575,6 +575,8 @@ public class MessageParser extends AbstractParser implements Consumer