OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 AccountInputFragment.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.user;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import androidx.fragment.app.Fragment;
import com.excelliance.kxqp.gs.dialog.f;
import com.excelliance.kxqp.gs.util.UserUtil;
import com.excelliance.kxqp.gs.util.av;
import com.excelliance.kxqp.gs.util.aw;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bk;
import com.excelliance.kxqp.gs.util.bu;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.c;
import com.excelliance.kxqp.gs.util.cg;
import com.excelliance.kxqp.gs.util.o;
import com.excelliance.kxqp.gs.util.t;
import com.excelliance.kxqp.gs.util.w;
import org.json.JSONException;
import org.json.JSONObject;
public class AccountInputFragment extends Fragment {
private Context f11580b;
private EditText c;
private ImageView d;
private Button e;
private SharedPreferences f;
private bu g = null;
Handler f11579a = new Handler() {
@Override
public void handleMessage(Message message) {
super.handleMessage(message);
if (message.what != 10) {
return;
}
cg.a(AccountInputFragment.this.f11580b, w.e(AccountInputFragment.this.f11580b, "server_exception"));
}
};
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
Log.d("AccountInputFragment", "onAttach()");
this.f11580b = activity;
this.f = this.f11580b.getSharedPreferences("USERINFO", Build.VERSION.SDK_INT < 11 ? 0 : 4);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
}
@Override
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
Log.d("AccountInputFragment", "onCreateView()");
View b2 = w.b(this.f11580b, "fragment_account_input");
this.c = (EditText) b2.findViewById(w.d(this.f11580b, "et_input_account"));
this.c.requestFocus();
this.c.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void afterTextChanged(Editable editable) {
if (TextUtils.isEmpty(editable)) {
AccountInputFragment.this.e.setEnabled(false);
AccountInputFragment.this.e.setTextColor(w.a(AccountInputFragment.this.f11580b, "login_button_text"));
} else {
AccountInputFragment.this.e.setEnabled(true);
AccountInputFragment.this.e.setTextColor(w.a(AccountInputFragment.this.f11580b, "app_title_white"));
}
}
});
this.d = (ImageView) b2.findViewById(w.d(this.f11580b, "iv_clear"));
this.d.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AccountInputFragment.this.c.setText("");
}
});
this.e = (Button) b2.findViewById(w.d(this.f11580b, "btn_next_step"));
this.e.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (AccountInputFragment.this.a(AccountInputFragment.this.c.getText().toString().trim())) {
return;
}
AccountInputFragment.this.a(AccountInputFragment.this.c.getText().toString().trim(), "******");
}
});
return b2;
}
public boolean a(String str) {
if (!o.b(str)) {
return false;
}
new f.b(getContext()).c("dialog_simple_dialog").a(w.e(getContext(), "continue_login")).b(w.e(getContext(), "login_google")).d(w.e(getContext(), "title")).e(w.e(getContext(), "login_check_is_mail")).a(new f.a() {
@Override
public void a(View view, Dialog dialog) {
dialog.dismiss();
AccountInputFragment.this.a(AccountInputFragment.this.c.getText().toString().trim(), "******");
}
}).b(new f.a() {
@Override
public void a(View view, Dialog dialog) {
dialog.dismiss();
aw.a(AccountInputFragment.this.f11580b);
}
}).b();
return true;
}
@Override
public void onActivityCreated(Bundle bundle) {
super.onActivityCreated(bundle);
Log.d("AccountInputFragment", "onActivityCreated()");
}
@Override
public void onResume() {
super.onResume();
Log.d("AccountInputFragment", "onResume()");
((InputMethodManager) this.f11580b.getSystemService("input_method")).toggleSoftInput(0, 2);
if (TextUtils.isEmpty(((LoginActivity) this.f11580b).a())) {
String a2 = bx.a().a(this.f, t.j);
if (TextUtils.isEmpty(a2) || this.c == null) {
return;
}
this.c.setText(a2);
((LoginActivity) this.f11580b).a(a2);
this.c.setSelection(a2.length());
}
}
@Override
public void onPause() {
super.onPause();
if (this.c != null) {
((InputMethodManager) this.f11580b.getSystemService("input_method")).hideSoftInputFromWindow(this.c.getWindowToken(), 0);
}
}
@Override
public void onDestroy() {
super.onDestroy();
}
public void a(String str, String str2) {
if (!av.a().b(this.f11580b)) {
cg.a(this.f11580b, w.e(this.f11580b, "network_unavailable"));
} else {
if (!bx.a(str)) {
String e = w.e(this.f11580b, "user_account_error");
if (o.b(str)) {
e = w.e(this.f11580b, "gspace_account_error_for_gaccount");
}
cg.a(this.f11580b, e);
return;
}
a(str, str2, 1);
}
}
private void a(String str, String str2, int i) {
Log.d("AccountInputFragment", "tosever start");
String requestParamsForLogin = UserUtil.getInstance().getRequestParamsForLogin(this.f11580b, str, str2, i);
if (TextUtils.isEmpty(requestParamsForLogin)) {
Log.d("AccountInputFragment", "requestParams is empty");
this.f11579a.removeMessages(10);
this.f11579a.sendEmptyMessage(10);
return;
}
a(requestParamsForLogin, str, str2);
}
private void a(String str, final String str2, final String str3) {
az.d("AccountInputFragment", "requestParams:" + str);
String a2 = c.a(str);
az.d("AccountInputFragment", "content : " + a2);
bk.a().a("https://sdk.ourplay.com.cn/account/login.php", a2, new bk.a() {
@Override
public void a(String str4) {
if (AccountInputFragment.this.g == null) {
AccountInputFragment.this.g = bu.a();
AccountInputFragment.this.g.a(AccountInputFragment.this.f11580b);
}
AccountInputFragment.this.g.b();
Log.d("AccountInputFragment", "response = " + str4);
try {
String a3 = c.a(str4, t.f12027a);
az.d("AccountInputFragment", "AES content = " + a3);
if (TextUtils.isEmpty(a3)) {
throw new Exception("content is empty");
}
try {
AccountInputFragment.this.a(new JSONObject(a3), str2, str3);
} catch (JSONException e) {
e.printStackTrace();
Log.d("AccountInputFragment", "json exception");
AccountInputFragment.this.f11579a.removeMessages(10);
AccountInputFragment.this.f11579a.sendEmptyMessage(10);
}
} catch (Exception e2) {
e2.printStackTrace();
Log.d("AccountInputFragment", "AES exception = " + e2.getMessage().toString());
AccountInputFragment.this.f11579a.removeMessages(10);
AccountInputFragment.this.f11579a.sendEmptyMessage(10);
}
}
@Override
public void b(String str4) {
Log.d("AccountInputFragment", "onFailed info = " + str4);
AccountInputFragment.this.f11579a.removeMessages(10);
AccountInputFragment.this.f11579a.sendEmptyMessage(10);
}
});
}
public void a(JSONObject jSONObject, String str, String str2) {
int optInt = jSONObject.optInt("flag");
Log.d("AccountInputFragment", "flag = " + optInt);
if (optInt == 2) {
bx.a();
if (!bx.a(str)) {
cg.a(this.f11580b, w.e(this.f11580b, "user_input_legal_phone_number"));
return;
} else {
((LoginActivity) this.f11580b).b(false);
((LoginActivity) this.f11580b).a(str);
((LoginActivity) this.f11580b).a(2);
return;
}
}
if (optInt == 3) {
((LoginActivity) this.f11580b).b(false);
((LoginActivity) this.f11580b).a(str);
((LoginActivity) this.f11580b).a(1);
} else if (optInt == 4) {
((LoginActivity) this.f11580b).b(true);
((LoginActivity) this.f11580b).a(str);
((LoginActivity) this.f11580b).a(1);
} else {
this.f11579a.removeMessages(10);
this.f11579a.sendEmptyMessage(10);
}
}
@Override
public void onHiddenChanged(boolean z) {
super.onHiddenChanged(z);
if (isAdded()) {
if (z) {
onPause();
} else {
onResume();
}
}
}
}