diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java index d822dcb7..18e4a1de 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java @@ -154,7 +154,7 @@ public static void removeExc(byte[] exclusion) { private static class ByteArrayToBase64TypeAdapter implements JsonSerializer, JsonDeserializer { private static final ByteArrayToBase64TypeAdapter INSTANCE = new ByteArrayToBase64TypeAdapter(); - private static final Map exclusions = new ConcurrentHashMap<>(); + private static final Map exclusions = new ConcurrentHashMap<>(); private final Base64.Decoder decoder = Base64.getUrlDecoder(); private final Base64.Encoder encoder = Base64.getUrlEncoder(); public byte[] deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { @@ -170,7 +170,7 @@ public byte[] deserialize(JsonElement json, Type typeOfT, JsonDeserializationCon } public JsonElement serialize(byte[] src, Type typeOfSrc, JsonSerializationContext context) { - return new JsonPrimitive(encoder.encodeToString(src)); + return exclusions.getOrDefault(src, new JsonPrimitive(encoder.encodeToString(src))); } } }