IntentCreatorService.java
9.49 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
package com.bitstrips.imoji.ui;
import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import com.bitstrips.imoji.abv3.AvatarBuilderActivityMode;
import com.bitstrips.imoji.abv3.AvatarBuilderActivityV3;
import com.bitstrips.imoji.behaviour.BehaviourHelper;
import com.bitstrips.imoji.behaviour.SecretBehaviourActivity;
import com.bitstrips.imoji.browser.ImojiBrowserActivity;
import com.bitstrips.imoji.services.PackageService;
import com.bitstrips.imoji.ui.activities.ConnectSnapchatActivity;
import com.bitstrips.imoji.ui.activities.SignUpActivity;
import com.bitstrips.imoji.util.PreferenceUtils;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
@Singleton
public class IntentCreatorService
{
public static final String EXTRA_ACTION_GOTO_CONNECT_SC = "com.bitstrips.imoji.browser.extra.action.connect.sc";
public static final String EXTRA_ACTION_KEY = "com.bitstrips.imoji.browser.extra.action";
public static final String IMOJI_PACKAGE_NAME = "com.bitstrips.imoji";
private final PreferenceUtils a;
private final Context b;
private final PackageService c;
private final BehaviourHelper d;
@Inject
public IntentCreatorService(Context paramContext, PreferenceUtils paramPreferenceUtils, PackageService paramPackageService, BehaviourHelper paramBehaviourHelper)
{
this.b = paramContext;
this.a = paramPreferenceUtils;
this.c = paramPackageService;
this.d = paramBehaviourHelper;
}
private static Intent a(Activity paramActivity, AvatarBuilderActivityMode paramAvatarBuilderActivityMode)
{
paramActivity = new Intent(paramActivity, AvatarBuilderActivityV3.class);
Bundle localBundle = new Bundle();
localBundle.putSerializable("EXTRA_AVATAR_BUILDER_MODE", paramAvatarBuilderActivityMode);
paramActivity.putExtras(localBundle);
return paramActivity;
}
public void displayUpgradeDialog(final Activity paramActivity)
{
String str = paramActivity.getString(2131231059);
new AlertDialog.Builder(paramActivity).setTitle(2131231165).setMessage(str).setPositiveButton(2131231058, new DialogInterface.OnClickListener()
{
public final void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
{
if (IntentCreatorService.a(IntentCreatorService.this).isAppInstalled("com.bitstrips.imoji"))
{
IntentCreatorService.a(IntentCreatorService.this).launchApp("com.bitstrips.imoji");
return;
}
IntentCreatorService.this.goToGooglePlayStore("com.bitstrips.imoji", paramActivity);
}
}).setNegativeButton(2131230868, new DialogInterface.OnClickListener()
{
public final void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt) {}
}).show();
}
public void goToAvatarBuilderCreate(Activity paramActivity)
{
paramActivity.startActivity(a(paramActivity, AvatarBuilderActivityMode.CREATE));
}
public void goToAvatarBuilderCreateWithinSnapchatLinkingFlow(Activity paramActivity)
{
Intent localIntent = a(paramActivity, AvatarBuilderActivityMode.CREATE);
localIntent.putExtra("com.bitstrips.imoji.avatar.issnapchat", true);
paramActivity.startActivity(localIntent);
}
public void goToAvatarBuilderEdit(Activity paramActivity)
{
paramActivity.startActivity(a(paramActivity, AvatarBuilderActivityMode.EDIT));
}
public void goToAvatarBuilderEdit(Activity paramActivity, String paramString, int paramInt)
{
Intent localIntent = a(paramActivity, AvatarBuilderActivityMode.EDIT);
localIntent.putExtra("EXTRA_EDIT_START_CATEGORY", paramString);
paramActivity.startActivityForResult(localIntent, paramInt);
}
public void goToAvatarBuilderFromSnapchat(Activity paramActivity)
{
Intent localIntent = a(paramActivity, AvatarBuilderActivityMode.EDIT);
localIntent.putExtra("com.bitstrips.imoji.avatar.isEditFromSnapchat", true);
paramActivity.startActivity(localIntent);
paramActivity.finish();
}
public void goToAvatarBuilderReset(Activity paramActivity)
{
paramActivity.startActivity(a(paramActivity, AvatarBuilderActivityMode.RESET));
}
public void goToAvatarBuilderResetFromUpgradeTeaser(Activity paramActivity)
{
Intent localIntent = a(paramActivity, AvatarBuilderActivityMode.RESET);
Bundle localBundle2 = localIntent.getExtras();
Bundle localBundle1 = localBundle2;
if (localBundle2 == null) {
localBundle1 = new Bundle();
}
localBundle1.putBoolean("EXTRA_RESET_UPGRADE_TO_CM", true);
localIntent.putExtras(localBundle1);
paramActivity.startActivity(localIntent);
}
public void goToConnectSnapchatActivity(Activity paramActivity, String paramString)
{
Intent localIntent = new Intent(paramActivity, ConnectSnapchatActivity.class);
localIntent.putExtra("request_token", paramString);
paramActivity.startActivityForResult(localIntent, 55);
}
public void goToForcedConnectSnapchatActivity(Activity paramActivity)
{
Intent localIntent = new Intent(paramActivity, ConnectSnapchatActivity.class);
localIntent.setFlags(536870912);
paramActivity.startActivityForResult(localIntent, 55);
}
public void goToGooglePlayStore(String paramString, Context paramContext)
{
Intent localIntent = new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=" + paramString));
localIntent.addFlags(268435456);
if (this.b.getPackageManager().queryIntentActivities(localIntent, 65536).size() > 0) {
try
{
paramContext.startActivity(localIntent);
return;
}
catch (ActivityNotFoundException localActivityNotFoundException) {}
}
localIntent.setData(Uri.parse("http://play.google.com/store/apps/details?id=" + paramString));
paramContext.startActivity(localIntent);
}
public void goToImojiBrowser(Activity paramActivity)
{
goToImojiBrowser(paramActivity, null);
}
public void goToImojiBrowser(Activity paramActivity, Bundle paramBundle)
{
Intent localIntent1 = new Intent(paramActivity, ImojiBrowserActivity.class);
Intent localIntent2 = paramActivity.getIntent();
localIntent1.setAction(localIntent2.getAction());
localIntent1.setFlags(33554432);
Object localObject = paramActivity.getIntent().getExtras();
if (localObject != null) {}
for (;;)
{
localIntent1.putExtras((Bundle)localObject);
localObject = localIntent2.getData();
if (localObject != null) {
localIntent1.putExtra("schemeHost", ((Uri)localObject).getHost());
}
if (paramBundle != null) {
localIntent1.putExtra("com.bitstrips.imoji.browser.extra.bundle", paramBundle);
}
paramActivity.startActivity(localIntent1);
paramActivity.finish();
return;
localObject = new Bundle();
}
}
public void goToImojiBrowserThenSnapchatActivity(Activity paramActivity, String paramString)
{
Bundle localBundle = new Bundle();
localBundle.putString("request_token", paramString);
localBundle.putString("com.bitstrips.imoji.browser.extra.action", "com.bitstrips.imoji.browser.extra.action.connect.sc");
goToImojiBrowser(paramActivity, localBundle);
}
public void goToLinkBSAuth(Activity paramActivity)
{
Intent localIntent = new Intent(paramActivity, SignUpActivity.class);
localIntent.putExtra("linkBSAuth", true);
paramActivity.startActivity(localIntent);
}
public void goToLoginActivity(Activity paramActivity)
{
paramActivity.startActivity(new Intent(paramActivity, LoginActivity.class));
}
public void goToOutfitBuilder(Activity paramActivity, int paramInt)
{
goToAvatarBuilderEdit(paramActivity, "outfit", paramInt);
}
public void goToOutfitBuilderFromSnapchat(Activity paramActivity, int paramInt)
{
goToOutfitBuilder(paramActivity, paramInt);
}
public void goToPrivacyPolicy(Activity paramActivity)
{
Intent localIntent = new Intent(paramActivity, ImojiWebViewActivity.class);
localIntent.setData(Uri.parse(paramActivity.getString(2131231306)));
localIntent.putExtra("android.intent.extra.TITLE", paramActivity.getString(2131231008));
paramActivity.startActivity(localIntent);
}
public void goToSecretBehaviourActivity(Activity paramActivity)
{
Intent localIntent = new Intent(paramActivity, SecretBehaviourActivity.class);
localIntent.setFlags(268435456);
paramActivity.startActivity(localIntent);
}
public void goToSupportPage(Activity paramActivity)
{
Intent localIntent = new Intent(paramActivity, ImojiWebViewActivity.class);
localIntent.setData(Uri.parse(this.d.getSupportURL(this.a)));
localIntent.putExtra("android.intent.extra.TITLE", paramActivity.getString(2131231042));
paramActivity.startActivity(localIntent);
}
public void goToTermsOfService(Activity paramActivity)
{
Intent localIntent = new Intent(paramActivity, ImojiWebViewActivity.class);
localIntent.setData(Uri.parse(paramActivity.getString(2131231072)));
localIntent.putExtra("android.intent.extra.TITLE", paramActivity.getString(2131231043));
paramActivity.startActivity(localIntent);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/ui/IntentCreatorService.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/