BitmojiBaseActivity.java
5.06 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
package com.bitstrips.imoji.ui;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AppCompatActivity;
import com.bitstrips.imoji.InjectorApplication;
import com.bitstrips.imoji.analytics.LegacyAnalyticsService;
import com.bitstrips.imoji.api.BitmojiApi;
import com.bitstrips.imoji.behaviour.BehaviourHelper;
import com.bitstrips.imoji.browser.ImojiBrowserActivity;
import com.bitstrips.imoji.manager.SnapchatManager;
import com.bitstrips.imoji.monouser.controllers.UserLogoutController;
import com.bitstrips.imoji.monouser.oauth2.OAuth2Manager;
import com.bitstrips.imoji.monouser.oauth2.OAuth2Manager.OnOAuth2TokenRefreshCallback;
import com.bitstrips.imoji.util.BugReporter;
import com.squareup.okhttp.Cache;
import javax.inject.Inject;
public abstract class BitmojiBaseActivity
extends AppCompatActivity
implements OAuth2Manager.OnOAuth2TokenRefreshCallback
{
public static final String INTENT_ACTION_SHOW_FORCE_LOGOUT_DIALOG = "com.bitstrips.imoji.actions.show.force.logout.dialog";
@Inject
LegacyAnalyticsService K;
@Inject
BitmojiApi L;
@Inject
SnapchatManager M;
@Inject
Cache N;
@Inject
BugReporter O;
@Inject
BehaviourHelper P;
@Inject
OAuth2Manager Q;
@Inject
UserLogoutController R;
private BroadcastReceiver n;
private boolean o = false;
private void a()
{
showAlertDialog(getString(2131230887), getString(2131230904), new Runnable()
{
public final void run()
{
BitmojiBaseActivity.this.returnToLogin();
}
}, null);
}
public static void sendShowForceLogoutDialogBroadcast(Context paramContext)
{
LocalBroadcastManager.getInstance(paramContext).sendBroadcast(new Intent("com.bitstrips.imoji.actions.show.force.logout.dialog"));
}
protected boolean isActivityValid()
{
if (isFinishing()) {}
while ((Build.VERSION.SDK_INT >= 17) && (isDestroyed())) {
return false;
}
return true;
}
public void logout()
{
this.R.logout();
returnToLogin();
}
public void onCreate(@Nullable Bundle paramBundle)
{
super.onCreate(paramBundle);
((InjectorApplication)getApplication()).inject(this);
this.n = new BroadcastReceiver()
{
public final void onReceive(Context paramAnonymousContext, Intent paramAnonymousIntent)
{
if ((paramAnonymousIntent.getAction().equals("com.bitstrips.imoji.actions.show.force.logout.dialog")) && (BitmojiBaseActivity.a(BitmojiBaseActivity.this))) {
BitmojiBaseActivity.b(BitmojiBaseActivity.this);
}
}
};
LocalBroadcastManager.getInstance(this).unregisterReceiver(this.n);
paramBundle = new IntentFilter("com.bitstrips.imoji.actions.show.force.logout.dialog");
LocalBroadcastManager.getInstance(this).registerReceiver(this.n, paramBundle);
}
public void onDestroy()
{
super.onDestroy();
LocalBroadcastManager.getInstance(this).unregisterReceiver(this.n);
}
public void onPause()
{
super.onPause();
this.o = false;
}
public void onResume()
{
super.onResume();
this.o = true;
if (this.Q.isUserLoggedIn())
{
boolean bool = this.P.isTokenRefreshForced();
this.Q.asyncRefreshToken(bool, this);
}
}
public void onStart()
{
super.onStart();
this.K.reportStart(this);
if ((this instanceof ImojiBrowserActivity)) {}
for (String str = "sharing";; str = "identity")
{
this.O.updateTags(new String[] { str });
return;
}
}
public void onStop()
{
super.onStop();
this.K.reportStop(this);
}
public void onTokenRefreshFailed(boolean paramBoolean)
{
if ((paramBoolean) && (this.o)) {
a();
}
}
public void onTokenRefreshSucceeded(boolean paramBoolean) {}
protected void returnToLogin()
{
if (this.M.getCurrentLinkingIntent() != null)
{
this.M.goBackToSnapchat(this);
finish();
}
do
{
return;
startActivity(new Intent(getApplicationContext(), LoginActivity.class));
} while ((this instanceof LoginActivity));
finish();
}
@Deprecated
public void showAlertDialog(String paramString1, @NonNull String paramString2, Runnable paramRunnable1, Runnable paramRunnable2)
{
if (!isActivityValid()) {
return;
}
paramString2 = new BitmojiAlertDialog(this).withMessage(paramString2);
if (paramString1 != null) {
paramString2.withTitle(paramString1);
}
if (paramRunnable1 != null) {
paramString2.withOnPositiveClick(paramRunnable1);
}
if (paramRunnable2 != null) {
paramString2.withOnNegativeClick(paramRunnable2);
}
paramString2.show();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/ui/BitmojiBaseActivity.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/