BSLoginActivity.java
5.14 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
package com.bitstrips.imoji.ui;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import com.bitstrips.imoji.InjectorApplication;
import com.bitstrips.imoji.analytics.LegacyAnalyticsService;
import com.bitstrips.imoji.analytics.PageViewReporter;
import com.bitstrips.imoji.api.BSAuthResponse;
import com.bitstrips.imoji.api.BitmojiApi;
import com.bitstrips.imoji.experiments.Experiments;
import com.bitstrips.imoji.identity.AvatarManager;
import com.bitstrips.imoji.identity.AvatarManager.UpdateAvatarInfoCallback;
import com.bitstrips.imoji.ui.views.Form;
import com.bitstrips.imoji.ui.views.Form.EmailValidator;
import com.bitstrips.imoji.ui.views.Form.PasswordValidator;
import com.bitstrips.imoji.ui.views.FormField;
import com.bitstrips.imoji.util.PreferenceUtils;
import javax.inject.Inject;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;
public class BSLoginActivity
extends OnboardingFormBaseActivity
{
public static final String KEY_EXTRA_LINKING = "com.bitstrips.imoji.login.linking";
@Inject
LegacyAnalyticsService n;
@Inject
AvatarManager o;
@Inject
BitmojiApi p;
@Inject
PreferenceUtils q;
@Inject
PageViewReporter r;
@Inject
Experiments s;
private FormField t;
private FormField u;
private boolean a()
{
if (getIntent() == null) {
return false;
}
return getIntent().getBooleanExtra("com.bitstrips.imoji.login.linking", false);
}
private void b()
{
disableButtons();
String str1 = this.t.getText().toString();
String str2 = this.u.getText().toString();
this.p.getToken("imoji", str2, "password", str1, str2, new Callback()
{
public final void failure(RetrofitError paramAnonymousRetrofitError)
{
paramAnonymousRetrofitError = paramAnonymousRetrofitError.getResponse();
if ((paramAnonymousRetrofitError != null) && (paramAnonymousRetrofitError.getStatus() == 400)) {
BSLoginActivity.b(BSLoginActivity.this);
}
for (;;)
{
BSLoginActivity.this.enableButtons();
return;
BSLoginActivity.c(BSLoginActivity.this);
}
}
});
}
public Menu getOptionsMenu()
{
return this.mOptionsMenu;
}
public void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
{
super.onActivityResult(paramInt1, paramInt2, paramIntent);
}
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
((InjectorApplication)getApplication()).inject(this);
setContentView(2130903079);
setSupportActionBar((Toolbar)findViewById(2131689623));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setTitle(2131230987);
this.t = ((FormField)findViewById(2131689539));
this.u = ((FormField)findViewById(2131689656));
paramBundle = (Button)findViewById(2131689657);
TextView localTextView = (TextView)findViewById(2131689658);
setMainButton(paramBundle);
if (a()) {
this.r.loginScreenFromWelcomeScreenInSnapchatAppContext();
}
for (;;)
{
paramBundle.setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymousView)
{
BSLoginActivity.this.onLoginClicked(paramAnonymousView);
}
});
localTextView.setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymousView)
{
BSLoginActivity.this.onForgotPasswordClicked(paramAnonymousView);
}
});
paramBundle = new Form(this);
paramBundle.addField(this.t, new Form.EmailValidator(this.t, paramBundle));
paramBundle.addField(this.u, new Form.PasswordValidator(this.u, paramBundle));
return;
this.r.loginScreenFromWelcomeScreenInBitmojiAppContext();
}
}
public boolean onCreateOptionsMenu(Menu paramMenu)
{
getMenuInflater().inflate(2131755008, paramMenu);
return super.onCreateOptionsMenu(paramMenu);
}
public void onForgotPasswordClicked(View paramView)
{
paramView = new Intent(getApplicationContext(), BSPasswordRecoveryActivity.class);
if (a()) {
paramView.putExtra("com.bitstrips.imoji.login.linking", true);
}
startActivity(paramView);
}
public void onLoginClicked(View paramView)
{
b();
}
public boolean onOptionsItemSelected(MenuItem paramMenuItem)
{
int i = paramMenuItem.getItemId();
if (i == 2131689972)
{
b();
return true;
}
if (i == 16908332)
{
finish();
return true;
}
return super.onOptionsItemSelected(paramMenuItem);
}
protected void onPause()
{
super.onPause();
}
public void onResume()
{
super.onResume();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/ui/BSLoginActivity.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/