CarrotChat v2.8.60.240131版本的 MD5 值为:2baf8b9f31830b86b5c5a85ae6b47e05
以下内容为反编译后的 AccountApplyActivity.java 源代码,内容仅作参考
package ak.im.ui.activity;
import ak.im.module.AKTextInputFilter;
import ak.im.module.IDNOInputFilter;
import ak.im.module.PasswordInputFilter;
import ak.im.module.RSAKey;
import ak.im.utils.AkeyChatUtils;
import ak.im.utils.Log;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.text.InputFilter;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import java.io.File;
import org.pjsip.pjsua2.pjsip_transport_type_e;
public class AccountApplyActivity extends SwipeBackActivity implements ak.im.ui.view.m4.a {
private ImageView j;
private TextView n;
private TextView o;
private TextView p;
private TextView q;
private TextView r;
private TextView s;
private TextView t;
private TextView u;
private ImageView v;
private ImageView w;
private ImageView x;
private ak.g.a y;
private long z;
private final String a = "AccountApplyActivity";
private Button f1377b = null;
private EditText f1378c = null;
private EditText f1379d = null;
private EditText f1380e = null;
private EditText f = null;
private EditText g = null;
private TextView h = null;
private EditText i = null;
private final String k = "male";
private final String l = "female";
private String m = null;
private final short A = 1;
private final short B = 2;
private final short C = 3;
private final short D = 4;
private final short E = 5;
private final short F = 6;
private final short G = 7;
public void B(View view) {
checkHttpImage("http://7fvawr.com1.z0.glb.clouddn.com/jct/png/certify_example.png");
}
public void E(View view) {
getIBaseActivity().dismissPopup();
}
public void J(View view) {
getIBaseActivity().dismissPopup();
this.y.setCurrentSetImageType((short) 1);
AkeyChatUtils.pickImage(this);
}
public void L(View view) {
getIBaseActivity().dismissPopup();
AkeyChatUtils.captureImage(this, this.y.getIDBackFile(), getIBaseActivity());
this.y.setCurrentSetImageType((short) 2);
}
public void N(View view) {
getIBaseActivity().dismissPopup();
this.y.setCurrentSetImageType((short) 2);
AkeyChatUtils.pickImage(this);
}
public void P(View view) {
getIBaseActivity().dismissPopup();
this.y.setCurrentSetImageType((short) 3);
AkeyChatUtils.captureImage(this, this.y.getOrgNameFile(), getIBaseActivity());
}
public void R(View view) {
getIBaseActivity().dismissPopup();
this.y.setCurrentSetImageType((short) 3);
AkeyChatUtils.pickImage(this);
}
public void T(int i, View view) {
getIBaseActivity().dismissPopup();
if (5 == i) {
W(2);
} else if (6 == i) {
W(3);
} else if (7 == i) {
W(4);
}
}
public void V(int i, View view) {
String orgNameFileName;
getIBaseActivity().dismissPopup();
if (5 == i) {
orgNameFileName = this.y.getIDFrontFileName();
} else if (6 == i) {
orgNameFileName = this.y.getIDBackFileName();
} else if (7 == i) {
orgNameFileName = this.y.getOrgNameFileName();
} else {
Log.w("AccountApplyActivity", "keep douing");
return;
}
checkLocalImage(orgNameFileName);
}
private void W(final int i) {
PopupWindow popupWindow = getIBaseActivity().getPopupWindow();
View popupView = getIBaseActivity().getPopupView();
if (popupWindow == null) {
popupView = getLayoutInflater().inflate(ak.im.x1.account_apply_popup_layout, (ViewGroup) null);
PopupWindow popupWindow2 = new PopupWindow(popupView, -1, ak.im.utils.p5.screenHeight() - ak.im.utils.p5.getStatusBarHeight(this), true);
getIBaseActivity().initPopup(popupView, popupWindow2);
popupWindow2.setTouchable(true);
popupWindow2.setOutsideTouchable(true);
popupWindow2.setBackgroundDrawable(new BitmapDrawable(getResources()));
((Button) popupView.findViewById(ak.im.w1.btn_cancel)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.C(view);
}
});
popupView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.E(view);
}
});
popupWindow = popupWindow2;
}
getIBaseActivity().closeInput();
Button button = (Button) popupView.findViewById(ak.im.w1.btn_1);
Button button2 = (Button) popupView.findViewById(ak.im.w1.btn_2);
if (i == 1) {
button.setText(getString(ak.im.b2.male));
button2.setText(getString(ak.im.b2.female));
button.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.F(view);
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.G(view);
}
});
} else if (i == 2) {
button.setText(getString(ak.im.b2.shooting));
button2.setText(getString(ak.im.b2.get_picture_from_album));
button.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.H(view);
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.J(view);
}
});
} else if (i == 3) {
button.setText(getString(ak.im.b2.shooting));
button2.setText(getString(ak.im.b2.get_picture_from_album));
button.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.L(view);
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.N(view);
}
});
} else if (i == 4) {
button.setText(getString(ak.im.b2.shooting));
button2.setText(getString(ak.im.b2.get_picture_from_album));
button.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.P(view);
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.R(view);
}
});
} else {
button.setText(getString(ak.im.b2.repeat_choose));
button2.setText(getString(ak.im.b2.check_current_img));
button.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.T(i, view);
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.V(i, view);
}
});
}
popupWindow.setAnimationStyle(ak.im.c2.popwindow_anim_style);
View findViewById = findViewById(ak.im.w1.tv_title_back);
popupWindow.showAsDropDown(findViewById, 0, -findViewById.getHeight());
}
public void d(View view) {
finish();
}
public void f(View view) {
W(1);
}
public void h(View view) {
if (ak.im.utils.l4.checkPathValid(this.y.getIDFrontFileName())) {
W(5);
} else {
W(2);
}
}
public void j(View view) {
if (ak.im.utils.l4.checkPathValid(this.y.getIDBackFileName())) {
W(6);
} else {
W(3);
}
}
public void l(View view) {
if (ak.im.utils.l4.checkPathValid(this.y.getOrgNameFileName())) {
W(7);
} else {
W(4);
}
}
public void C(View view) {
getIBaseActivity().dismissPopup();
}
public void F(View view) {
getIBaseActivity().dismissPopup();
this.m = "male";
((TextView) findViewById(ak.im.w1.tv_gander)).setText(getString(ak.im.b2.male));
this.p.setText("");
}
public void G(View view) {
getIBaseActivity().dismissPopup();
this.m = "female";
((TextView) findViewById(ak.im.w1.tv_gander)).setText(getString(ak.im.b2.female));
this.p.setText("");
}
public void H(View view) {
getIBaseActivity().dismissPopup();
this.y.setCurrentSetImageType((short) 1);
AkeyChatUtils.captureImage(this, this.y.getIDFrontFile(), getIBaseActivity());
}
public void n(View view) {
W(1);
}
public void p(View view) {
if (System.currentTimeMillis() - this.z < 2000) {
Log.w("AccountApplyActivity", "sorry,i think you find thing,ignore you");
return;
}
this.f1379d.requestFocus();
this.z = System.currentTimeMillis();
this.y.getSmsVerifyCode(getPhoneNumber());
}
public void r(View view) {
String password = getPassword();
if (this.i.getInputType() == 129) {
this.i.setInputType(145);
this.j.setImageResource(ak.im.v1.ic_account_apply_display_pwd);
} else {
this.j.setImageResource(ak.im.v1.ic_account_apply_hide_pwd);
this.i.setInputType(pjsip_transport_type_e.PJSIP_TRANSPORT_UDP6);
}
if (!TextUtils.isEmpty(password)) {
this.i.setSelection(password.length());
} else {
Log.w("AccountApplyActivity", "pwd is null");
}
}
public void t(View view) {
Intent intent = new Intent(this, InputContentActivity.class);
intent.putExtra("purpose", "input_remark");
intent.putExtra("input_content_key", getRemark());
startActivityForResult(intent, 7);
}
public void v(View view) {
this.y.startCommit();
}
public void x(View view) {
AkeyChatUtils.startSelectCountry(this);
}
public void z(View view) {
intentToQueryActivity(getPhoneNumber(), getIDNO());
}
public void checkHttpImage(String str) {
AkeyChatUtils.startImageActivityOpenHttp(this, str);
}
public void checkLocalImage(String str) {
AkeyChatUtils.startImageActivityOpenFile(this, str);
}
@Override
public void disableSMSCodeView() {
}
@Override
public void dismissCommitDialog() {
getIBaseActivity().dismissPGDialog();
}
@Override
public void enableSMSCodeView() {
}
@Override
public void finishActivity() {
finish();
}
@Override
public String getCountryCode() {
return ak.im.sdk.manager.ye.getInstance().getCountryCode();
}
@Override
public String getGender() {
return this.m;
}
@Override
public String getIDNO() {
return this.f.getText().toString().trim();
}
@Override
public String getName() {
return this.f1380e.getText().toString().trim();
}
@Override
public String getOrgName() {
return this.g.getText().toString().trim();
}
@Override
public String getPassword() {
return this.i.getText().toString().trim();
}
@Override
public String getPhoneNumber() {
String countryCode = getCountryCode();
if ("86".equals(countryCode)) {
return this.f1378c.getText().toString().trim();
}
return RSAKey.COMMON_KEY_PADDING + countryCode + this.f1378c.getText().toString().trim();
}
@Override
public String getRemark() {
return this.h.getText().toString().trim();
}
@Override
public String getSmsVerifyCode() {
return !ak.im.sdk.manager.ye.isSupportSmsService() ? "1024" : this.f1379d.getText().toString().trim();
}
protected void init() {
findViewById(ak.im.w1.tv_title_back).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.d(view);
}
});
this.n = (TextView) findViewById(ak.im.w1.country_name_txt);
this.f1378c = (EditText) findViewById(ak.im.w1.account_txt);
this.f1379d = (EditText) findViewById(ak.im.w1.verify_code_edit_text);
this.o = (TextView) findViewById(ak.im.w1.get_sms_code_txt);
TextView textView = (TextView) findViewById(ak.im.w1.tv_gander_choose);
this.p = textView;
textView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.f(view);
}
});
findViewById(ak.im.w1.tv_gander).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.n(view);
}
});
this.o.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.p(view);
}
});
EditText editText = (EditText) findViewById(ak.im.w1.nickname_edit_txt);
this.f1380e = editText;
editText.setFilters(new InputFilter[]{AKTextInputFilter.Companion.chineseWordFilter(), new InputFilter.LengthFilter(5)});
this.f = (EditText) findViewById(ak.im.w1.et_id_no);
this.g = (EditText) findViewById(ak.im.w1.et_org_name);
this.i = (EditText) findViewById(ak.im.w1.pwd_txt);
this.i.setFilters(new InputFilter[]{new PasswordInputFilter(), new InputFilter.LengthFilter(15)});
ImageView imageView = (ImageView) findViewById(ak.im.w1.display_hide_switch);
this.j = imageView;
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.r(view);
}
});
this.f.setFilters(new InputFilter[]{new IDNOInputFilter(), new InputFilter.LengthFilter(18)});
TextView textView2 = (TextView) findViewById(ak.im.w1.et_remark);
this.h = textView2;
textView2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.t(view);
}
});
Button button = (Button) findViewById(ak.im.w1.btn_commit_apply);
this.f1377b = button;
button.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.v(view);
}
});
this.n.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.x(view);
}
});
TextView textView3 = (TextView) findViewById(ak.im.w1.tv_apply_info_query);
this.q = textView3;
textView3.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.z(view);
}
});
this.r = (TextView) findViewById(ak.im.w1.tv_add_id_front);
this.s = (TextView) findViewById(ak.im.w1.tv_add_id_back);
this.t = (TextView) findViewById(ak.im.w1.tv_add_org_certify);
TextView textView4 = (TextView) findViewById(ak.im.w1.tv_check_example);
this.u = textView4;
textView4.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.B(view);
}
});
this.v = (ImageView) findViewById(ak.im.w1.iv_id_front);
this.w = (ImageView) findViewById(ak.im.w1.iv_id_back);
this.x = (ImageView) findViewById(ak.im.w1.iv_org_certify);
this.v.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.h(view);
}
});
this.w.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.j(view);
}
});
this.x.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AccountApplyActivity.this.l(view);
}
});
this.y = new ak.presenter.impl.l6(this);
}
@Override
public void intentToQueryActivity(String str, String str2) {
Intent intent = new Intent(this, QueryApplyActivity.class);
intent.putExtra("phone_key", str);
intent.putExtra("id_key", str2);
startActivity(intent);
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
if (i2 == -1) {
if (i == 3) {
if (intent != null) {
this.y.handleSomethingAfterChooseImage(intent.getData());
Log.w("AccountApplyActivity", "we get file path");
}
} else if (i == 4) {
File currentSetImageFile = this.y.getCurrentSetImageFile();
if (currentSetImageFile != null) {
this.y.handleSomethingAfterChooseImage(currentSetImageFile.getAbsolutePath());
}
} else if (i == 7) {
if (intent != null) {
this.h.setText(intent.getStringExtra("input_content_key"));
}
} else if (i != 25) {
} else {
if (intent == null) {
Log.w("AccountApplyActivity", "null data-country-select");
return;
}
this.y.handleSelectCountry(intent.getStringExtra("countryName"), intent.getStringExtra("countryNumber"));
}
}
}
@Override
public void onCreate(Bundle bundle) {
requestWindowFeature(1);
super.onCreate(bundle);
setContentView(ak.im.x1.activity_account_apply);
init();
}
@Override
public void onDestroy() {
this.y.destroy();
super.onDestroy();
}
@Override
public void refreshViewAfterFailed() {
dismissCommitDialog();
}
@Override
public void refreshViewAfterSuccess() {
showCommitDialog();
showToastView(getString(ak.im.b2.apply_success));
finish();
}
@Override
public void setCountryTxt(String str) {
this.n.setText(str);
}
@Override
public void setIDBackImage(Bitmap bitmap) {
this.w.setImageBitmap(bitmap);
this.s.setVisibility(8);
}
@Override
public void setIDFrontImage(Bitmap bitmap) {
this.v.setImageBitmap(bitmap);
this.r.setVisibility(8);
}
@Override
public void setOrgCertifyImage(Bitmap bitmap) {
this.x.setImageBitmap(bitmap);
this.t.setVisibility(8);
}
@Override
public void showCommitDialog() {
getIBaseActivity().showPGDialog(getString(ak.im.b2.committing));
}
@Override
public void showToastView(String str) {
getIBaseActivity().showToast(str);
}
@Override
public void updateGetSmsCodeText(int i) {
if (i > 0) {
this.o.setText(String.format(getString(ak.im.b2.x_s_resend), Integer.valueOf(i)));
this.o.setEnabled(false);
this.o.setAlpha(0.6f);
return;
}
this.o.setText(getString(ak.im.b2.get_verify_code));
this.o.setEnabled(true);
this.o.setAlpha(1.0f);
}
}