PreferenceUtils.java
6.32 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package com.bitstrips.imoji.util;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.text.TextUtils;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public class PreferenceUtils
{
private final Context a;
private final SharedPreferences b;
public PreferenceUtils(Context paramContext, int paramInt)
{
this.a = paramContext;
this.b = paramContext.getSharedPreferences(paramContext.getString(paramInt), 0);
}
private Map<String, String> a()
{
return MapUtils.asMap(getString(2131231319, null));
}
public void clearKey(int paramInt)
{
this.b.edit().remove(this.a.getString(paramInt)).apply();
}
public void clearSnapchatUserData()
{
this.b.edit().remove(this.a.getString(2131231250)).apply();
}
public void clearTokens()
{
this.b.edit().remove(this.a.getString(2131231186)).remove(this.a.getString(2131231251)).remove(this.a.getString(2131231318)).remove(this.a.getString(2131231283)).apply();
}
public boolean containsKey(int paramInt)
{
return this.b.contains(this.a.getString(paramInt));
}
public boolean getBoolean(int paramInt, boolean paramBoolean)
{
return this.b.getBoolean(this.a.getString(paramInt), paramBoolean);
}
public boolean getBoolean(String paramString, boolean paramBoolean)
{
return this.b.getBoolean(paramString, paramBoolean);
}
public Integer getInt(int paramInt1, int paramInt2)
{
return Integer.valueOf(this.b.getInt(this.a.getString(paramInt1), paramInt2));
}
public Integer getInt(String paramString, int paramInt)
{
return Integer.valueOf(this.b.getInt(paramString, paramInt));
}
public Long getLong(int paramInt, long paramLong)
{
return Long.valueOf(this.b.getLong(this.a.getString(paramInt), paramLong));
}
public Long getLong(String paramString, long paramLong)
{
return Long.valueOf(this.b.getLong(paramString, paramLong));
}
public Map<String, Integer> getShareImagePackagePriorityMap(String[] paramArrayOfString)
{
Object localObject1 = a();
int i = paramArrayOfString.length - 1;
Object localObject2;
while (i >= 0)
{
localObject2 = paramArrayOfString[i];
if (!((Map)localObject1).containsKey(localObject2)) {
((Map)localObject1).put(localObject2, String.valueOf(paramArrayOfString.length - i));
}
i -= 1;
}
paramArrayOfString = getString(2131231292, null);
if (!TextUtils.isEmpty(paramArrayOfString)) {
((Map)localObject1).put(paramArrayOfString, "2147483647");
}
paramArrayOfString = new HashMap(((Map)localObject1).size());
localObject1 = ((Map)localObject1).entrySet().iterator();
while (((Iterator)localObject1).hasNext())
{
localObject2 = (Map.Entry)((Iterator)localObject1).next();
paramArrayOfString.put(((Map.Entry)localObject2).getKey(), Integer.valueOf(Integer.parseInt((String)((Map.Entry)localObject2).getValue())));
}
return paramArrayOfString;
}
public String getString(int paramInt, String paramString)
{
return this.b.getString(this.a.getString(paramInt), paramString);
}
public PreferenceTimer getTimer(int paramInt)
{
return new PreferenceTimer(this, paramInt);
}
public void increaseShareImageAppPriority(String paramString)
{
Map localMap = a();
if (!localMap.containsKey(paramString)) {
localMap.put(paramString, "0");
}
localMap.put(paramString, String.valueOf(Integer.parseInt((String)localMap.get(paramString)) + 1000));
putString(2131231319, MapUtils.toString(localMap));
putString(2131231292, paramString);
}
public void logoutForSnapchatLoginIfDifferentAvatarId(String paramString1, String paramString2)
{
if (!paramString2.equals(paramString1))
{
paramString1 = getString(2131231318, null);
paramString2 = getString(2131231236, "{}");
reset();
putString(2131231318, paramString1);
putString(2131231236, paramString2);
}
}
public void putBoolean(int paramInt, boolean paramBoolean)
{
SharedPreferences.Editor localEditor = this.b.edit();
localEditor.putBoolean(this.a.getString(paramInt), paramBoolean);
localEditor.apply();
}
public void putBoolean(String paramString, boolean paramBoolean)
{
SharedPreferences.Editor localEditor = this.b.edit();
localEditor.putBoolean(paramString, paramBoolean);
localEditor.apply();
}
public void putInt(int paramInt1, int paramInt2)
{
SharedPreferences.Editor localEditor = this.b.edit();
localEditor.putInt(this.a.getString(paramInt1), paramInt2);
localEditor.apply();
}
public void putInt(String paramString, int paramInt)
{
SharedPreferences.Editor localEditor = this.b.edit();
localEditor.putInt(paramString, paramInt);
localEditor.apply();
}
public void putLong(int paramInt, long paramLong)
{
SharedPreferences.Editor localEditor = this.b.edit();
localEditor.putLong(this.a.getString(paramInt), paramLong);
localEditor.apply();
}
public void putLong(String paramString, long paramLong)
{
SharedPreferences.Editor localEditor = this.b.edit();
localEditor.putLong(paramString, paramLong);
localEditor.apply();
}
public void putString(int paramInt, String paramString)
{
SharedPreferences.Editor localEditor = this.b.edit();
localEditor.putString(this.a.getString(paramInt), paramString);
localEditor.apply();
}
public void registerOnSharedPreferenceChangeListener(SharedPreferences.OnSharedPreferenceChangeListener paramOnSharedPreferenceChangeListener)
{
this.b.registerOnSharedPreferenceChangeListener(paramOnSharedPreferenceChangeListener);
}
public boolean reset()
{
return this.b.edit().clear().commit();
}
public void unregisterOnSharedPreferenceChangeListener(SharedPreferences.OnSharedPreferenceChangeListener paramOnSharedPreferenceChangeListener)
{
this.b.unregisterOnSharedPreferenceChangeListener(paramOnSharedPreferenceChangeListener);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/util/PreferenceUtils.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/