导航菜单

页面标题

页面副标题

⁡⁡⁡⁡⁡⁡⁡鲸⁡⁡⁡⁡⁡⁡⁡⁡鱼⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡借⁡条⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡ v4.1.2 - S0ACT.java 源代码

正在查看: ⁡⁡⁡⁡⁡⁡⁡鲸⁡⁡⁡⁡⁡⁡⁡⁡鱼⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡借⁡条⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡ v4.1.2 应用的 S0ACT.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.yuxianghua.ui.activitys;

import android.app.ProgressDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.OnClick;
import butterknife.OnTextChanged;
import com.alipay.alipaysecuritysdk.common.config.Constant;
import com.alipay.face.api.ZIMFacade;
import com.base.commonlibrary.base.BaseResult;
import com.base.commonlibrary.base.baserx.RxHelper;
import com.base.commonlibrary.base.baserx.RxManager;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.utils.ApplicationUtil;
import com.base.commonlibrary.utils.MD5Utils;
import com.base.commonlibrary.utils.RSAUtils;
import com.base.commonlibrary.utils.RegexUtil;
import com.base.commonlibrary.utils.SPUtils;
import com.base.commonlibrary.views.ClearEditText;
import com.base.commonlibrary.views.TitleLayout;
import com.google.gson.Gson;
import com.yuxianghua.mjyp.app.api.Api;
import com.yuxianghua.mjyp.app.api.AppConfig;
import com.yuxianghua.mjyp.app.api.OssUtil;
import com.yuxianghua.mjyp.app.base.BaseVerCodeActivity;
import com.yuxianghua.mjyp.app.base.RxSubscriber;
import com.yuxianghua.ui.bean.CheckIpBean;
import com.yuxianghua.ui.bean.ConfigBean;
import com.yuxianghua.ui.bean.EncForm;
import com.yuxianghua.ui.bean.MessageEvent;
import com.yuxianghua.ui.bean.RegBean;
import com.yuxianghua.ui.bean.RegisterForm;
import com.yuxianghua.ui.views.EditTextChangeListener;
import java.util.UUID;
import org.greenrobot.eventbus.EventBus;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.schedulers.Schedulers;
import yhgjgdf.ijnhjfyd.ikbujfjfnjkif.R;

public class S0ACT extends BaseVerCodeActivity {

    @BindView(R.id.btn_get)
    Button btnGet;

    @BindView(R.id.ck_xy)
    CheckBox ckXy;

    @BindView(R.id.code)
    EditText code;

    @BindView(R.id.get_code)
    Button getCode;

    @BindView(R.id.kef)
    TextView kef;

    @BindView(R.id.kef_qq)
    TextView kef_qq;

    @BindView(R.id.kef_wx)
    TextView kef_wx;

    @BindView(R.id.phone)
    ClearEditText phone;
    private ProgressDialog progressDialog;
    private String regChannelCode = "09ce2f7bfb9243debf2c2efe05a1d047";

    @BindView(R.id.time)
    TextView time;

    @BindView(R.id.title)
    TitleLayout title;

    @BindView(R.id.xy)
    TextView xy;

    @Override
    protected boolean canLoadMore() {
        return false;
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_regist;
    }

    @Override
    public void initPresenter() {
    }

    @Override
    protected void loadMore() {
    }

    @Override
    protected void refresh() {
    }

    @Override
    protected Button returnButton() {
        return this.getCode;
    }

    @Override
    public void initView() {
        ZIMFacade.install(this);
        this.progressDialog = new ProgressDialog(this);
        OssUtil.INSTANCE.getUrl(this, new OssUtil.IpCallBack() {
            @Override
            public void getIpSuccess() {
                S0ACT.this.config();
                S0ACT.this.checkIp();
            }
        });
        new EditTextChangeListener(this.btnGet, R.drawable.xbl_btn_bg_select).setEditText(this.phone, this.code);
        SPUtils.putData(AppConfig.latitude, "0.00");
        SPUtils.putData(AppConfig.longitude, "0.00");
        SPUtils.putData(AppConfig.address, "0.00");
        this.xy.setText("《" + getResources().getString(R.string.user) + getResources().getString(R.string.register_agreement) + "》");
        config();
    }

    @OnTextChanged(callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED, value = {R.id.phone})
    public void editTextDetailChange(Editable editable) {
        if (editable != null) {
            if (RegexUtil.isPhoneNumber(editable.toString()) && this.isCountDownFinish) {
                this.getCode.setEnabled(true);
                return;
            } else {
                this.getCode.setEnabled(false);
                return;
            }
        }
        this.getCode.setEnabled(false);
    }

    @OnClick({R.id.btn_get, R.id.get_code, R.id.kef, R.id.xy})
    protected void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_get:
                if (this.ckXy.isChecked()) {
                    login(new RegisterForm(this.phone.getText().toString(), this.code.getText().toString(), Constant.SDK_OS, ApplicationUtil.getChannelName(this.mContext), "", (String) SPUtils.getData(AppConfig.longitude, "0.0"), (String) SPUtils.getData(AppConfig.latitude, "0.0"), this.regChannelCode, (String) SPUtils.getData(AppConfig.address, "中国"), ""));
                    break;
                } else {
                    showShortToast(getResources().getString(R.string.agreee_user));
                    break;
                }
            case R.id.get_code:
                sendVerCode(this.phone.getText().toString(), null);
                break;
            case R.id.kef:
                startActivity(new Intent("android.intent.action.DIAL", Uri.parse("tel:" + ((String) SPUtils.getData(AppConfig.CACHE.TEL, "")))));
                break;
            case R.id.xy:
                Bundle bundle = new Bundle();
                bundle.putString("title", "");
                bundle.putString("url", ((String) SPUtils.getData("baseH5", "")) + AppConfig.niceAgreement);
                startActivity(MT10ACT.class, bundle);
                break;
        }
    }

    protected void login(RegisterForm registerForm) {
        this.btnGet.setEnabled(false);
        String json = new Gson().toJson(registerForm);
        long currentTimeMillis = System.currentTimeMillis();
        String uuid = UUID.randomUUID().toString();
        String str = json + "@" + uuid + "@" + currentTimeMillis;
        String encrypt = RSAUtils.getInstance().encrypt(str + "@" + MD5Utils.md5(str, AppConfig.md5key));
        StringBuilder sb = new StringBuilder();
        sb.append(currentTimeMillis);
        sb.append("");
        this.mRxManager.add(Api.getDefault().logins(new EncForm(encrypt, uuid, sb.toString())).compose(RxHelper.handleResult()).subscribe((Subscriber<? super R>) new RxSubscriber<RegBean>(this.mContext, true) {
            @Override
            public void _onNext(RegBean regBean) {
                SPUtils.putData(AppConfig.CACHE.Token, regBean.getToken());
                String userCode = regBean.getUserCode();
                SPUtils.putData(AppConfig.CACHE.PHONE, S0ACT.this.phone.getText().toString());
                SPUtils.putData(AppConfig.CACHE.USERCOED, userCode);
                S0ACT.this.mRxManager.post(AppConfig.Status, "登录");
                EventBus.getDefault().post(new MessageEvent("login_ok"));
                S0ACT.this.finish();
            }

            @Override
            protected void _onError(String str2) {
                S0ACT.this.btnGet.setEnabled(true);
                if (!TextUtils.isEmpty(str2) && str2.contains("JsonReader.setLenient")) {
                    S0ACT.this.showShortToast("数据解析异常,建议杀掉app后重新启动");
                } else {
                    S0ACT.this.showShortToast(str2);
                }
            }
        }));
    }

    protected void config() {
        this.mRxManager.add(Api.getDefault().getServiceConfig().compose(RxHelper.handleResult()).subscribe((Subscriber<? super R>) new RxSubscriber<ConfigBean>(this.mContext, false) {
            @Override
            protected void _onError(String str) {
            }

            @Override
            public void _onNext(ConfigBean configBean) {
                String tel = configBean.getTel();
                String time = configBean.getTime();
                String qq = configBean.getQq();
                String wx = configBean.getWx();
                SPUtils.putData(AppConfig.CACHE.TEL, tel);
                if (!RegexUtil.isEmpty(tel)) {
                    S0ACT.this.kef.setText(S0ACT.this.getResources().getString(R.string.custom_service_tel) + tel);
                }
                if (!RegexUtil.isEmpty(wx)) {
                    S0ACT.this.kef_wx.setText(S0ACT.this.getResources().getString(R.string.custom_wx) + wx);
                }
                if (!RegexUtil.isEmpty(qq)) {
                    S0ACT.this.kef_qq.setText(S0ACT.this.getResources().getString(R.string.customm_service_qq) + qq);
                }
                if (RegexUtil.isEmpty(time)) {
                    return;
                }
                S0ACT.this.time.setText(S0ACT.this.getResources().getString(R.string.service_time) + time);
            }
        }));
    }

    protected void sendMsg() {
        this.mRxManager.add(Api.getDefault().sendMsg().compose(RxSchedulers.io_main()).subscribe((Subscriber<? super R>) new RxSubscriber<BaseResult>(this.mContext, true) {
            @Override
            public void _onNext(BaseResult baseResult) {
            }

            @Override
            protected void _onError(String str) {
                S0ACT.this.showShortToast(str);
            }
        }));
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    public void checkIp() {
        new RxManager().add(Api.getDefault().checkIp().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<BaseResult<CheckIpBean>>() {
            @Override
            public void call(BaseResult<CheckIpBean> baseResult) {
                if (baseResult.getCode() != 200) {
                    S0ACT.this.progressDialog.setTitle("hm/check不通,可能IP被特殊地区(江苏福建等)屏蔽");
                    S0ACT.this.progressDialog.show();
                }
            }
        }, new Action1<Throwable>() {
            @Override
            public void call(Throwable th) {
                S0ACT.this.progressDialog.setTitle("hm/check不通,可能IP被特殊地区(江苏福建等)屏蔽");
                S0ACT.this.progressDialog.show();
            }
        }));
    }
}