BehaviourHelper.java
8.41 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
package com.bitstrips.imoji.behaviour;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.net.Uri;
import android.net.Uri.Builder;
import android.os.Build;
import android.os.Build.VERSION;
import android.support.annotation.NonNull;
import com.bitstrips.imoji.abv3.AvatarBuilderStyle;
import com.bitstrips.imoji.experiments.Experiments;
import com.bitstrips.imoji.monouser.controllers.UserLogoutController;
import com.bitstrips.imoji.monouser.models.OAuth2Constants;
import com.bitstrips.imoji.ui.BitmojiBaseActivity;
import com.bitstrips.imoji.util.PreferenceUtils;
import dagger.Lazy;
import javax.inject.Inject;
import javax.inject.Singleton;
@Singleton
public class BehaviourHelper
{
private final Context a;
private final Lazy<UserLogoutController> b;
@Inject
public BehaviourHelper(Context paramContext, Lazy<UserLogoutController> paramLazy)
{
this.a = paramContext;
this.b = paramLazy;
}
private SharedPreferences a()
{
return this.a.getSharedPreferences(this.a.getString(2131231182), 0);
}
public boolean avatarBuilderPreloadAdjacent(Experiments paramExperiments)
{
return getBoolean(this.a.getString(2131231159), false);
}
public boolean faceRecognitionIsEnabled(Experiments paramExperiments)
{
float f2 = Float.valueOf(getString(this.a.getString(2131231226), "-1")).floatValue();
float f1 = f2;
if (f2 == -1.0F) {
f1 = paramExperiments.getFloat("settings.face-recognition-v2-enable-ratio", 0.0F);
}
return Math.random() < f1;
}
public String getAccountsEndpoint()
{
return getString(this.a.getString(2131231281), OAuth2Constants.OAUTH2_ACCOUNTS_ENDPOINT);
}
public int getAppIndexingJobPeriod()
{
return 12;
}
public boolean getBoolean(String paramString, boolean paramBoolean)
{
return a().getBoolean(paramString, paramBoolean);
}
public String getChillvibesContentGroup(Experiments paramExperiments)
{
return paramExperiments.getString("experiments.chillvibes.content-group", "default");
}
public AvatarBuilderStyle getDefaultStyle()
{
if (!getBoolean(this.a.getString(2131231190), true)) {
return AvatarBuilderStyle.STYLE_BITSTRIPS;
}
return AvatarBuilderStyle.STYLE_CM;
}
public String getEndpoint()
{
return getString(this.a.getResources().getString(2131231222), this.a.getResources().getString(2131231197));
}
public int getForcedGboardRequiredStorage()
{
return 0;
}
public int getInteger(String paramString, int paramInt)
{
return Integer.valueOf(a().getString(paramString, String.valueOf(paramInt))).intValue();
}
public String getPreviewEndpoint()
{
if (this.a.getResources().getString(2131231308).equals(getEndpoint())) {
return this.a.getResources().getString(2131231169);
}
return getEndpoint();
}
public String getRenderEndpoint()
{
if (this.a.getResources().getString(2131231323).equals(getEndpoint())) {
return this.a.getResources().getString(2131231325);
}
if (this.a.getResources().getString(2131231200).equals(getEndpoint())) {
return this.a.getResources().getString(2131231202);
}
return this.a.getResources().getString(2131231315);
}
public String getResetPasswordURL()
{
if (this.a.getResources().getString(2131231323).equals(getEndpoint())) {
return this.a.getResources().getString(2131231326);
}
return this.a.getResources().getString(2131231317);
}
public boolean getSmartvibesReorderContentEnabled(Experiments paramExperiments)
{
return paramExperiments.getBoolean("experiments.smartvibes.reorderContentEnabled", false);
}
public boolean getSmartvibesSuggestContentEnabled(Experiments paramExperiments)
{
return paramExperiments.getBoolean("experiments.smartvibes.suggestContentEnabled", false);
}
public String getString(String paramString1, String paramString2)
{
return a().getString(paramString1, paramString2);
}
public String getSupportURL(PreferenceUtils paramPreferenceUtils)
{
String str3 = this.a.getResources().getString(2131231293);
try
{
String str1 = this.a.getPackageManager().getPackageInfo(this.a.getPackageName(), 0).versionName;
return Uri.parse(str3).buildUpon().appendQueryParameter("bitmoji-version", str1).appendQueryParameter("device", Build.MANUFACTURER + " " + Build.MODEL).appendQueryParameter("os-version", "Android-" + Build.VERSION.RELEASE).appendQueryParameter("avatar-id", paramPreferenceUtils.getString(2131231270, null)).build().toString();
}
catch (PackageManager.NameNotFoundException localNameNotFoundException)
{
for (;;)
{
String str2 = "";
}
}
}
public int getWebpQuality()
{
return Integer.valueOf(getString(this.a.getString(2131231341), "50")).intValue();
}
public boolean isAnalyticsDebugEnabled()
{
return false;
}
public boolean isBiggerSelfieEnabled(Experiments paramExperiments)
{
boolean bool2 = getBoolean(this.a.getString(2131231184), false);
boolean bool1 = bool2;
if (!bool2) {
bool1 = paramExperiments.getBoolean("experiments.bigger-selfie.enabled", false);
}
return bool1;
}
public boolean isCMSaveEnabled()
{
boolean bool = true;
if (getEndpoint().equals(this.a.getResources().getString(2131231197))) {
bool = getBoolean(this.a.getString(2131231212), true);
}
return bool;
}
public boolean isFewerOptionTraitsEnabled(Experiments paramExperiments)
{
boolean bool2 = getBoolean(this.a.getString(2131231157), false);
boolean bool1 = bool2;
if (!bool2) {
bool1 = paramExperiments.getBoolean("experiments.filter-option-traits.enabled", false);
}
return bool1;
}
public boolean isLogcatPostRequestEnabled()
{
return false;
}
public boolean isLoggedInWithSnapchat(PreferenceUtils paramPreferenceUtils)
{
return (paramPreferenceUtils.getString(2131231318, null) != null) || (paramPreferenceUtils.getString(2131231283, null) != null);
}
public boolean isLoginFailureForced()
{
return false;
}
public boolean isMirrorGeoIpValidationOverrideEnabled()
{
return getBoolean(this.a.getString(2131231278), false);
}
public boolean isMonoUserLoginEnabled(Experiments paramExperiments)
{
boolean bool = getBoolean(this.a.getString(2131231215), true);
if (Math.random() < paramExperiments.getFloat("settings.monouser-enable", 1.0F)) {}
for (int i = 1; (i != 0) && (bool); i = 0) {
return true;
}
return false;
}
public boolean isSignUpButtonEnabled()
{
return false;
}
public boolean isStagingEndpoint()
{
return !getEndpoint().equals(this.a.getResources().getString(2131231197));
}
public boolean isSvgAvatarPreview()
{
return getBoolean(this.a.getString(2131231161), false);
}
public boolean isTokenRefreshForced()
{
return getBoolean(this.a.getString(2131231287), false);
}
public Boolean isUpgradeTeaserExperimentEnabled(Experiments paramExperiments)
{
boolean bool2 = getBoolean(this.a.getString(2131231339), false);
boolean bool1 = bool2;
if (!bool2) {
bool1 = paramExperiments.getBoolean("experiments.full-upgrade-teaser-android.enabled", false);
}
return Boolean.valueOf(bool1);
}
public boolean isWebLoginForced()
{
return getBoolean(this.a.getString(2131231290), false);
}
public boolean isWebpEnabled()
{
return false;
}
public float mirrorSaveRatio()
{
return Float.valueOf(getString(this.a.getString(2131231280), "-1")).floatValue();
}
public boolean setAccountsEndpoint(@NonNull String paramString)
{
String str = this.a.getString(2131231281);
return a().edit().putString(str, paramString).commit();
}
public void setEndpoint(String paramString)
{
String str = this.a.getResources().getString(2131231222);
a().edit().putString(str, paramString).commit();
((UserLogoutController)this.b.get()).logout();
BitmojiBaseActivity.sendShowForceLogoutDialogBroadcast(this.a);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/behaviour/BehaviourHelper.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/