导航菜单

页面标题

页面副标题

大众借. v4.1.2 - IdCardActivity.java 源代码

正在查看: 大众借. v4.1.2 应用的 IdCardActivity.java JAVA 源代码文件

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


package com.shiliuj.ui.activitys;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
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.control.IPermissionResultListener;
import com.base.commonlibrary.utils.MD5Utils;
import com.base.commonlibrary.utils.RSAUtils;
import com.base.commonlibrary.utils.ToastUtil;
import com.base.commonlibrary.views.TitleLayout;
import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.shiliuj.gzd.IDCard;
import com.shiliuj.mjyp.app.api.Api;
import com.shiliuj.mjyp.app.api.ApiService;
import com.shiliuj.mjyp.app.base.BaseBindActivity;
import com.shiliuj.mjyp.app.base.RxSubscriber;
import com.shiliuj.ui.bean.AliBean;
import com.shiliuj.ui.bean.AliResult;
import com.shiliuj.ui.bean.NewAliBean;
import com.wildma.pictureselector.FileUtils;
import com.wildma.pictureselector.PictureBean;
import com.wildma.pictureselector.PictureSelector;
import java.io.File;
import java.util.HashMap;
import java.util.UUID;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.schedulers.Schedulers;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000p\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0007\u0018\u0000 O2\u00020\u0001:\u0001OB\u0005¢\u0006\u0002\u0010\u0002J\b\u00105\u001a\u000206H\u0002J\b\u00107\u001a\u000206H\u0002J\b\u00108\u001a\u000209H\u0014J\b\u0010:\u001a\u00020;H\u0016J\b\u0010<\u001a\u000206H\u0002J\u0010\u0010=\u001a\u0002062\u0006\u0010>\u001a\u00020?H\u0002J\b\u0010@\u001a\u000206H\u0016J\u0012\u0010A\u001a\u0002062\b\u0010B\u001a\u0004\u0018\u00010CH\u0016J\b\u0010D\u001a\u000206H\u0014J\"\u0010E\u001a\u0002062\u0006\u0010F\u001a\u00020;2\u0006\u0010G\u001a\u00020;2\b\u0010H\u001a\u0004\u0018\u00010IH\u0014J\b\u0010J\u001a\u000206H\u0014J\b\u0010K\u001a\u000206H\u0002J\u0018\u0010L\u001a\u0002062\u0006\u0010M\u001a\u00020\r2\u0006\u0010N\u001a\u00020;H\u0002R\u001c\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0005\u0010\u0006\"\u0004\b\u0007\u0010\bR\u001c\u0010\t\u001a\u0004\u0018\u00010\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\n\u0010\u0006\"\u0004\b\u000b\u0010\bR\u001c\u0010\f\u001a\u0004\u0018\u00010\rX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000e\u0010\u000f\"\u0004\b\u0010\u0010\u0011R\u001c\u0010\u0012\u001a\u0004\u0018\u00010\u0013X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0014\u0010\u0015\"\u0004\b\u0016\u0010\u0017R\u001c\u0010\u0018\u001a\u0004\u0018\u00010\u0013X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0019\u0010\u0015\"\u0004\b\u001a\u0010\u0017R\u001c\u0010\u001b\u001a\u0004\u0018\u00010\u001cX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001d\u0010\u001e\"\u0004\b\u001f\u0010 R\u001c\u0010!\u001a\u0004\u0018\u00010\u001cX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\"\u0010\u001e\"\u0004\b#\u0010 R\u0010\u0010$\u001a\u0004\u0018\u00010%X\u0082\u000e¢\u0006\u0002\n\u0000R\u001c\u0010&\u001a\u0004\u0018\u00010'X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b(\u0010)\"\u0004\b*\u0010+R\u001c\u0010,\u001a\u0004\u0018\u00010-X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b.\u0010/\"\u0004\b0\u00101R\u001c\u00102\u001a\u0004\u0018\u00010\rX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b3\u0010\u000f\"\u0004\b4\u0010\u0011¨\u0006P"}, d2 = {"Lcom/shiliuj/ui/activitys/IdCardActivity;", "Lcom/shiliuj/mjyp/app/base/BaseBindActivity;", "()V", "etCard", "Landroid/widget/EditText;", "getEtCard", "()Landroid/widget/EditText;", "setEtCard", "(Landroid/widget/EditText;)V", "etName", "getEtName", "setEtName", "fanIdUrl", "", "getFanIdUrl", "()Ljava/lang/String;", "setFanIdUrl", "(Ljava/lang/String;)V", "ivFan", "Landroid/widget/ImageView;", "getIvFan", "()Landroid/widget/ImageView;", "setIvFan", "(Landroid/widget/ImageView;)V", "ivZheng", "getIvZheng", "setIvZheng", "llFan", "Landroid/widget/LinearLayout;", "getLlFan", "()Landroid/widget/LinearLayout;", "setLlFan", "(Landroid/widget/LinearLayout;)V", "llZheng", "getLlZheng", "setLlZheng", "pictureZhengBean", "Lcom/wildma/pictureselector/PictureBean;", "title", "Lcom/base/commonlibrary/views/TitleLayout;", "getTitle", "()Lcom/base/commonlibrary/views/TitleLayout;", "setTitle", "(Lcom/base/commonlibrary/views/TitleLayout;)V", "tvCommit", "Landroid/widget/TextView;", "getTvCommit", "()Landroid/widget/TextView;", "setTvCommit", "(Landroid/widget/TextView;)V", "zhengIdUrl", "getZhengIdUrl", "setZhengIdUrl", "aliRealBean", "", "aliYunOcr", "canLoadMore", "", "getLayoutId", "", "getRealNameType", "hideKeyboard", "activity", "Landroid/app/Activity;", "initPresenter", "initView", "savedInstanceState", "Landroid/os/Bundle;", "loadMore", "onActivityResult", "requestCode", "resultCode", "data", "Landroid/content/Intent;", "refresh", "startNewAliYunOcr", "uploadImage", "filePath", "category", "Companion", "app_shiliujieRelease"}, k = 1, mv = {1, 4, 0})
public final class IdCardActivity extends BaseBindActivity {
    public static final int REQUEST_CODE_FAN = 1;
    public static final int REQUEST_CODE_ZHENG = 0;
    private HashMap _$_findViewCache;
    private EditText etCard;
    private EditText etName;
    private String fanIdUrl;
    private ImageView ivFan;
    private ImageView ivZheng;
    private LinearLayout llFan;
    private LinearLayout llZheng;
    private PictureBean pictureZhengBean;
    private TitleLayout title;
    private TextView tvCommit;
    private String zhengIdUrl;

    public void _$_clearFindViewByIdCache() {
        HashMap hashMap = this._$_findViewCache;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    public View _$_findCachedViewById(int i) {
        if (this._$_findViewCache == null) {
            this._$_findViewCache = new HashMap();
        }
        View view = (View) this._$_findViewCache.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this._$_findViewCache.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

    protected boolean canLoadMore() {
        return false;
    }

    public int getLayoutId() {
        return 2131492895;
    }

    public void initPresenter() {
    }

    protected void loadMore() {
    }

    protected void refresh() {
    }

    public final ImageView getIvZheng() {
        return this.ivZheng;
    }

    public final void setIvZheng(ImageView imageView) {
        this.ivZheng = imageView;
    }

    public final ImageView getIvFan() {
        return this.ivFan;
    }

    public final void setIvFan(ImageView imageView) {
        this.ivFan = imageView;
    }

    public final TitleLayout getTitle() {
        return this.title;
    }

    public final void setTitle(TitleLayout titleLayout) {
        this.title = titleLayout;
    }

    public final LinearLayout getLlZheng() {
        return this.llZheng;
    }

    public final void setLlZheng(LinearLayout linearLayout) {
        this.llZheng = linearLayout;
    }

    public final LinearLayout getLlFan() {
        return this.llFan;
    }

    public final void setLlFan(LinearLayout linearLayout) {
        this.llFan = linearLayout;
    }

    public final TextView getTvCommit() {
        return this.tvCommit;
    }

    public final void setTvCommit(TextView textView) {
        this.tvCommit = textView;
    }

    public final EditText getEtName() {
        return this.etName;
    }

    public final void setEtName(EditText editText) {
        this.etName = editText;
    }

    public final EditText getEtCard() {
        return this.etCard;
    }

    public final void setEtCard(EditText editText) {
        this.etCard = editText;
    }

    public final String getZhengIdUrl() {
        return this.zhengIdUrl;
    }

    public final void setZhengIdUrl(String str) {
        this.zhengIdUrl = str;
    }

    public final String getFanIdUrl() {
        return this.fanIdUrl;
    }

    public final void setFanIdUrl(String str) {
        this.fanIdUrl = str;
    }

    public void initView(Bundle savedInstanceState) {
        ZIMFacade.install((Context) this);
        View findViewById = findViewById(2131296591);
        if (findViewById == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.widget.ImageView");
        }
        this.ivZheng = (ImageView) findViewById;
        View findViewById2 = findViewById(2131296590);
        if (findViewById2 == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.widget.ImageView");
        }
        this.ivFan = (ImageView) findViewById2;
        TitleLayout findViewById3 = findViewById(2131296998);
        if (findViewById3 == null) {
            throw new NullPointerException("null cannot be cast to non-null type com.base.commonlibrary.views.TitleLayout");
        }
        this.title = findViewById3;
        View findViewById4 = findViewById(2131296666);
        if (findViewById4 == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.widget.LinearLayout");
        }
        this.llZheng = (LinearLayout) findViewById4;
        View findViewById5 = findViewById(2131296644);
        if (findViewById5 == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.widget.LinearLayout");
        }
        this.llFan = (LinearLayout) findViewById5;
        View findViewById6 = findViewById(2131297034);
        if (findViewById6 == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.widget.TextView");
        }
        this.tvCommit = (TextView) findViewById6;
        View findViewById7 = findViewById(2131296500);
        if (findViewById7 == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.widget.EditText");
        }
        this.etName = (EditText) findViewById7;
        View findViewById8 = findViewById(2131296499);
        if (findViewById8 == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.widget.EditText");
        }
        this.etCard = (EditText) findViewById8;
        TitleLayout titleLayout = this.title;
        if (titleLayout != null) {
            titleLayout.setOnBackButtonClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    IdCardActivity.this.finish();
                }
            });
        }
        LinearLayout linearLayout = this.llZheng;
        if (linearLayout != null) {
            linearLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    PictureSelector.create((Activity) IdCardActivity.this, 0).selectPicture(false);
                }
            });
        }
        LinearLayout linearLayout2 = this.llFan;
        if (linearLayout2 != null) {
            linearLayout2.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    PictureSelector.create((Activity) IdCardActivity.this, 1).selectPicture(false);
                }
            });
        }
        TextView textView = this.tvCommit;
        if (textView != null) {
            textView.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    IdCardActivity idCardActivity = IdCardActivity.this;
                    idCardActivity.hideKeyboard((Activity) idCardActivity);
                    IdCardActivity.this.getRealNameType();
                }
            });
        }
    }

    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == 0) {
            if (data != null) {
                PictureBean parcelableExtra = data.getParcelableExtra("picture_result");
                this.pictureZhengBean = parcelableExtra;
                if (parcelableExtra != null) {
                    Intrinsics.checkNotNull(parcelableExtra);
                    String path = parcelableExtra.getPath();
                    Intrinsics.checkNotNullExpressionValue(path, "pictureZhengBean!!.path");
                    uploadImage(path, 0);
                    FileUtils.deleteAllCacheImage((Context) this);
                    return;
                }
                return;
            }
            return;
        }
        if (requestCode != 1 || data == null) {
            return;
        }
        PictureBean parcelableExtra2 = data.getParcelableExtra("picture_result");
        PictureBean pictureBean = this.pictureZhengBean;
        if (TextUtils.isEmpty(pictureBean != null ? pictureBean.getPath() : null)) {
            new ToastUtil().showShort(this.mContext, "请先上传身份证正面");
            return;
        }
        String path2 = parcelableExtra2 != null ? parcelableExtra2.getPath() : null;
        PictureBean pictureBean2 = this.pictureZhengBean;
        if (StringsKt.equals$default(path2, pictureBean2 != null ? pictureBean2.getPath() : null, false, 2, (Object) null)) {
            new ToastUtil().showShort(this.mContext, "请不要选择同一张照片");
        } else if (parcelableExtra2 != null) {
            String path3 = parcelableExtra2.getPath();
            Intrinsics.checkNotNullExpressionValue(path3, "pictureBean.path");
            uploadImage(path3, 1);
            FileUtils.deleteAllCacheImage((Context) this);
        }
    }

    private final void uploadImage(String filePath, final int category) {
        File file = new File(filePath);
        String json = new Gson().toJson(file.getName());
        long currentTimeMillis = System.currentTimeMillis();
        String uuid = UUID.randomUUID().toString();
        Intrinsics.checkNotNullExpressionValue(uuid, "UUID.randomUUID().toString()");
        String str = json + '@' + uuid + '@' + currentTimeMillis;
        String md5 = MD5Utils.md5(str, "f4qgkb85q4pMRMChLeC7uSn2wwTWGXrs");
        Intrinsics.checkNotNullExpressionValue(md5, "MD5Utils.md5(param, AppConfig.md5key)");
        String encrypt = RSAUtils.getInstance().encrypt(str + '@' + md5);
        RequestBody create = RequestBody.create(MediaType.parse("image/*"), file);
        Intrinsics.checkNotNullExpressionValue(create, "RequestBody.create(Media…e.parse(\"image/*\"), file)");
        RequestBody build = new MultipartBody.Builder().setType(MultipartBody.FORM).addFormDataPart("file", file.getName(), create).addFormDataPart("data", encrypt).addFormDataPart("nonceStr", uuid).addFormDataPart("timestamp", String.valueOf(currentTimeMillis)).build();
        Intrinsics.checkNotNullExpressionValue(build, "MultipartBody.Builder().…g())\n            .build()");
        final Context context = (Context) this;
        final boolean z = true;
        Api.getDefault().uploadImage(build).compose(RxSchedulers.io_main()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).compose(RxHelper.handleResult()).subscribe(new RxSubscriber<String>(context, z) {
            public void _onNext(String url) {
                if (TextUtils.isEmpty(url)) {
                    return;
                }
                int i = category;
                if (i == 0) {
                    IdCardActivity.this.setZhengIdUrl(url);
                    ImageView ivZheng = IdCardActivity.this.getIvZheng();
                    if (ivZheng != null) {
                        Glide.with(IdCardActivity.this.mContext).load(IdCardActivity.this.getZhengIdUrl()).into(ivZheng);
                    }
                    LinearLayout llZheng = IdCardActivity.this.getLlZheng();
                    if (llZheng != null) {
                        llZheng.setVisibility(8);
                        return;
                    }
                    return;
                }
                if (i != 1) {
                    return;
                }
                IdCardActivity.this.setFanIdUrl(url);
                ImageView ivFan = IdCardActivity.this.getIvFan();
                if (ivFan != null) {
                    Glide.with(IdCardActivity.this.mContext).load(IdCardActivity.this.getFanIdUrl()).into(ivFan);
                }
                LinearLayout llFan = IdCardActivity.this.getLlFan();
                if (llFan != null) {
                    llFan.setVisibility(8);
                }
            }

            protected void _onError(String message) {
                if (message != null) {
                    new ToastUtil().showLong(IdCardActivity.this.mContext, message);
                }
            }
        });
    }

    public final void getRealNameType() {
        RxManager rxManager = this.mRxManager;
        ApiService apiService = Api.getDefault();
        Intrinsics.checkNotNullExpressionValue(apiService, "Api.getDefault()");
        final Context context = (Context) this;
        final boolean z = true;
        rxManager.add(apiService.getRealNameType().compose(RxSchedulers.io_main()).subscribe(new RxSubscriber<BaseResult<?>>(context, z) {
            public void _onNext(BaseResult<?> baseResult) {
                if (baseResult != null) {
                    if (baseResult.getCode() == 200) {
                        Object result = baseResult.getResult();
                        if (result == null) {
                            throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
                        }
                        if (Intrinsics.areEqual((String) result, "1")) {
                            IdCardActivity.this.aliYunOcr();
                            return;
                        }
                        return;
                    }
                    String message = baseResult.getMessage();
                    if (TextUtils.isEmpty(message)) {
                        return;
                    }
                    new ToastUtil().showShort(IdCardActivity.this.mContext, message);
                }
            }

            protected void _onError(String rspmsg) {
                Intrinsics.checkNotNullParameter(rspmsg, "rspmsg");
                String str = rspmsg;
                if (TextUtils.isEmpty(str)) {
                    return;
                }
                new ToastUtil().showShort(IdCardActivity.this.mContext, str);
            }
        }));
    }

    public final void aliYunOcr() {
        permissionRequest(getResources().getString(2131689866), new String[]{"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.CAMERA"}, 18888, new IPermissionResultListener() {
            public void onPermissionFaild() {
            }

            public void onPermissionSuccess() {
                IdCardActivity.this.startNewAliYunOcr();
            }
        });
    }

    public final void startNewAliYunOcr() {
        try {
            String metaInfos = ZIMFacade.getMetaInfos((Context) this);
            EditText editText = this.etName;
            String valueOf = String.valueOf(editText != null ? editText.getText() : null);
            if (valueOf == null) {
                throw new NullPointerException("null cannot be cast to non-null type kotlin.CharSequence");
            }
            String obj = StringsKt.trim(valueOf).toString();
            EditText editText2 = this.etCard;
            String valueOf2 = String.valueOf(editText2 != null ? editText2.getText() : null);
            if (valueOf2 == null) {
                throw new NullPointerException("null cannot be cast to non-null type kotlin.CharSequence");
            }
            String obj2 = StringsKt.trim(valueOf2).toString();
            String str = this.zhengIdUrl;
            String str2 = this.fanIdUrl;
            if (TextUtils.isEmpty(obj)) {
                new ToastUtil().showShort(this.mContext, "请填写姓名");
                return;
            }
            if (TextUtils.isEmpty(obj2)) {
                new ToastUtil().showShort(this.mContext, "请填写身份证号");
                return;
            }
            if (!IDCard.IDCardValidate(obj2)) {
                new ToastUtil().showShort(this.mContext, "身份证号填写有误");
                return;
            }
            if (TextUtils.isEmpty(str)) {
                new ToastUtil().showShort(this.mContext, "请上传身份证正面");
            } else if (TextUtils.isEmpty(str2)) {
                new ToastUtil().showShort(this.mContext, "请上传身份证反面");
            } else {
                this.mRxManager.add(Api.getDefault().getAliCertifyId(new NewAliBean(metaInfos, obj, obj2, str, str2)).compose(RxSchedulers.io_main()).subscribe(new IdCardActivity$startNewAliYunOcr$1(this, this.mContext, true)));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public final void aliRealBean() {
        this.mRxManager.add(Api.getDefault().realAuthAli().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).compose(RxSchedulers.io_main()).subscribe(new Action1<BaseResult<String>>() {
            public final void call(BaseResult<String> baseResult) {
                String str;
                if (baseResult != null) {
                    if (baseResult.getCode() == 200) {
                        new ToastUtil().showShort(IdCardActivity.this.mContext, "认证通过");
                        IdCardActivity.this.finish();
                        return;
                    }
                    AliBean aliBean = (AliBean) new Gson().fromJson((String) baseResult.getResult(), AliBean.class);
                    if (aliBean != null) {
                        AliResult resultObject = aliBean.getResultObject();
                        Intrinsics.checkNotNullExpressionValue(resultObject, "aliBean.resultObject");
                        String subCode = resultObject.getSubCode();
                        if (subCode != null) {
                            switch (subCode.hashCode()) {
                                case 49587:
                                    if (subCode.equals("201")) {
                                        str = "姓名和身份证不一致";
                                        break;
                                    }
                                    break;
                                case 49588:
                                    if (subCode.equals("202")) {
                                        str = "查询不到身份信息";
                                        break;
                                    }
                                    break;
                                case 49589:
                                    if (subCode.equals("203")) {
                                        str = "查询不到照片或照片不可用";
                                        break;
                                    }
                                    break;
                                case 49590:
                                    if (subCode.equals("204")) {
                                        str = "人脸比对不一致";
                                        break;
                                    }
                                    break;
                                case 49591:
                                    if (subCode.equals("205")) {
                                        str = "活体检测存在风险";
                                        break;
                                    }
                                    break;
                                case 49592:
                                    if (subCode.equals("206")) {
                                        str = "业务策略限制";
                                        break;
                                    }
                                    break;
                                case 49595:
                                    if (subCode.equals("209")) {
                                        str = "权威比对源异常";
                                        break;
                                    }
                                    break;
                            }
                            new ToastUtil().showShort(IdCardActivity.this.mContext, str);
                            return;
                        }
                        str = "其他错误码";
                        new ToastUtil().showShort(IdCardActivity.this.mContext, str);
                        return;
                    }
                    new ToastUtil().showShort(IdCardActivity.this.mContext, baseResult.getMessage());
                    return;
                }
                new ToastUtil().showShort(IdCardActivity.this.mContext, "realAuthAli 接口数据返回为空");
            }
        }, new Action1<Throwable>() {
            public final void call(Throwable th) {
                th.printStackTrace();
                IdCardActivity.this.showShortToast("realAuthAli接口数据解析异常");
            }
        }));
    }

    public final void hideKeyboard(Activity activity) {
        Object systemService = activity.getSystemService("input_method");
        if (systemService == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
        }
        InputMethodManager inputMethodManager = (InputMethodManager) systemService;
        View currentFocus = activity.getCurrentFocus();
        if (currentFocus == null) {
            currentFocus = new View(activity);
        }
        inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
    }
}