mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
[FIX] Забытая обработка исключений base64 в CommonHelper.
This commit is contained in:
parent
af421c3e96
commit
408da409df
1 changed files with 2 additions and 2 deletions
|
@ -154,7 +154,7 @@ public static void removeExc(byte[] exclusion) {
|
|||
|
||||
private static class ByteArrayToBase64TypeAdapter implements JsonSerializer<byte[]>, JsonDeserializer<byte[]> {
|
||||
private static final ByteArrayToBase64TypeAdapter INSTANCE = new ByteArrayToBase64TypeAdapter();
|
||||
private static final Map<byte[], JsonArray> exclusions = new ConcurrentHashMap<>();
|
||||
private static final Map<byte[], JsonElement> 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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue