AvatarInfoDeserializer.java
3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com.bitstrips.imoji.deserializers;
import com.bitstrips.imoji.models.AvatarInfo;
import com.bitstrips.imoji.util.PreferenceUtils;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.List;
public class AvatarInfoDeserializer
implements JsonDeserializer<AvatarInfo>
{
private static final String[] b = { "bare", "shirt04", "pants05" };
private static final String[] c = { "barebm0a" };
PreferenceUtils a;
public AvatarInfoDeserializer(PreferenceUtils paramPreferenceUtils)
{
this.a = paramPreferenceUtils;
}
private static boolean a(JsonArray paramJsonArray, String[] paramArrayOfString)
{
boolean bool2 = false;
paramArrayOfString = Arrays.asList(paramArrayOfString);
int i = 0;
for (;;)
{
boolean bool1 = bool2;
if (i < paramJsonArray.size())
{
if (paramArrayOfString.indexOf(paramJsonArray.get(i).getAsString()) == -1) {
bool1 = true;
}
}
else {
return bool1;
}
i += 1;
}
}
public AvatarInfo deserialize(JsonElement paramJsonElement, Type paramType, JsonDeserializationContext paramJsonDeserializationContext)
throws JsonParseException
{
paramJsonElement = paramJsonElement.getAsJsonObject();
this.a.putString(2131231236, paramJsonElement.toString());
if (paramJsonElement.get("style") != null)
{
int i = paramJsonElement.get("style").getAsInt();
paramJsonDeserializationContext = paramJsonElement.get("styled_char_data").getAsJsonObject().get(Integer.toString(i)).getAsJsonObject();
paramType = paramJsonDeserializationContext.get("colours").getAsJsonObject();
paramJsonDeserializationContext = paramJsonDeserializationContext.get("body").getAsJsonObject();
i = paramType.get("ffcc99").getAsInt();
int j = paramJsonDeserializationContext.get("body_type").getAsInt();
int k = paramJsonDeserializationContext.get("breast_type").getAsInt();
paramJsonElement.addProperty("skinTone", Integer.valueOf(i));
paramJsonElement.addProperty("bodyType", Integer.valueOf(j));
paramJsonElement.addProperty("breastType", Integer.valueOf(k));
paramType = paramJsonDeserializationContext.get("new_clothes");
if (paramType == null) {
break label203;
}
}
label203:
for (boolean bool = a(paramType.getAsJsonArray(), c);; bool = a(paramJsonDeserializationContext.get("clothes").getAsJsonArray(), b))
{
paramJsonElement.addProperty("isDressed", Boolean.valueOf(bool));
paramJsonElement.remove("styled_char_data");
return (AvatarInfo)new Gson().fromJson(paramJsonElement, AvatarInfo.class);
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/deserializers/AvatarInfoDeserializer.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/