正在查看: 大众借. v4.1.2 应用的 MTT0Act.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 大众借. v4.1.2 应用的 MTT0Act.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.shiliuj.ui.activitys;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.core.app.NotificationCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import com.base.commonlibrary.BaseApplication;
import com.base.commonlibrary.base.BaseResult;
import com.base.commonlibrary.base.baseapp.AppActivityManager;
import com.base.commonlibrary.base.baserx.RxHelper;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.baseview.BaseDialogFragment;
import com.base.commonlibrary.baseview.recyclerview.MultiItemTypeAdapter;
import com.base.commonlibrary.netstate.ComNetWorkUtil;
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.utils.ToastUtil;
import com.base.commonlibrary.views.TitleLayout;
import com.google.gson.Gson;
import com.shiliuj.mjyp.BMAG01ACT;
import com.shiliuj.mjyp.adapters.ChoosePayAdapter;
import com.shiliuj.mjyp.app.api.Api;
import com.shiliuj.mjyp.app.base.BaseBindActivity;
import com.shiliuj.mjyp.app.base.RxSubscriber;
import com.shiliuj.mjyp.app.fragment.LoginPwdDialog;
import com.shiliuj.ui.activitys.MTT0Act;
import com.shiliuj.ui.bean.EncForm;
import com.shiliuj.ui.bean.MyBorrowBean;
import com.shiliuj.ui.bean.OrederPayBean;
import com.shiliuj.ui.bean.PostponeBean;
import com.shiliuj.ui.bean.Result;
import com.shiliuj.ui.bean.VerifyCodeBean;
import com.shiliuj.ui.views.SureAndCancelDialog;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class MTT0Act extends BaseBindActivity {
private int TYPE;
ChoosePayAdapter choosePayAdapter;
private List<OrederPayBean.ResultBean> datas = new ArrayList();
int id;
private MyBorrowBean myBorrow;
private String orderNo;
private PostponeBean postponeBean;
@BindView(2131296802)
RecyclerView recycleView;
@BindView(2131296966)
TextView tip;
@BindView(2131296998)
TitleLayout title;
protected boolean canLoadMore() {
return false;
}
public int getLayoutId() {
return 2131492899;
}
public void initPresenter() {
}
protected void loadMore() {
}
protected void refresh() {
}
public void initView(Bundle bundle) {
Bundle extras = getIntent().getExtras();
if (extras != null) {
this.TYPE = extras.getInt("TYPE", 1);
this.id = extras.getInt("id", 1);
if (this.TYPE == 1) {
MyBorrowBean serializable = extras.getSerializable("myBorrow");
this.myBorrow = serializable;
this.orderNo = serializable.getOrderNo();
} else {
PostponeBean serializable2 = extras.getSerializable("myBorrow");
this.postponeBean = serializable2;
this.orderNo = serializable2.getOrderNo();
}
}
this.choosePayAdapter = new ChoosePayAdapter(this.mContext, 2131492975, this.datas);
this.recycleView.setLayoutManager(new LinearLayoutManager(this.mContext));
this.recycleView.setAdapter(this.choosePayAdapter);
this.choosePayAdapter.setOnItemClickListener(new MultiItemTypeAdapter.OnItemClickListener() {
public boolean onItemLongClick(View view, RecyclerView.ViewHolder viewHolder, int i) {
return false;
}
public void onItemClick(View view, RecyclerView.ViewHolder viewHolder, int i) {
if (i < 0 || i >= MTT0Act.this.datas.size()) {
return;
}
MTT0Act.this.onClick((OrederPayBean.ResultBean) MTT0Act.this.datas.get(i));
}
});
loadData(this.id, true);
}
private void loadData(int i, boolean z) {
this.mRxManager.add(Api.getDefault().payTypeList(i).compose(RxHelper.handleResult()).subscribe(new RxSubscriber<List<OrederPayBean.ResultBean>>(this.mContext, z) {
public void _onNext(List<OrederPayBean.ResultBean> list) {
if (list != null) {
MTT0Act.this.datas.clear();
MTT0Act.this.choosePayAdapter.addAll(list);
MTT0Act.this.choosePayAdapter.notifyDataSetChanged();
MTT0Act.this.stopLoading();
}
}
protected void _onError(String str) {
MTT0Act.this.showShortToast(str);
}
}));
}
protected void onClick(OrederPayBean.ResultBean resultBean) {
resultBean.getId();
if (this.TYPE == 1) {
repaymentOrder(resultBean);
} else {
xQData(resultBean);
}
}
protected void repaymentOrder(final OrederPayBean.ResultBean resultBean) {
if (ComNetWorkUtil.isNetworkAvailable(this.mContext)) {
MyBorrowBean myBorrowBean = this.myBorrow;
if (myBorrowBean != null) {
myBorrowBean.setPayType(resultBean.getId());
String json = new Gson().toJson(this.myBorrow);
long currentTimeMillis = System.currentTimeMillis();
String uuid = UUID.randomUUID().toString();
String str = json + "@" + uuid + "@" + currentTimeMillis;
String encrypt = RSAUtils.getInstance().encrypt(str + "@" + MD5Utils.md5(str, "f4qgkb85q4pMRMChLeC7uSn2wwTWGXrs"));
StringBuilder sb = new StringBuilder();
sb.append(currentTimeMillis);
sb.append("");
this.mRxManager.add(Api.getDefault().repaymentOrderEnc(new EncForm(encrypt, uuid, sb.toString())).compose(RxSchedulers.io_main()).subscribe(new RxSubscriber<BaseResult<Result>>(this.mContext, true) {
public void _onNext(BaseResult<Result> baseResult) {
if (baseResult.getCode() == 3039) {
MTT0Act.this.showShortToast(baseResult.getMessage());
MTT0Act.this.startActivity(MTG0ACT.class);
return;
}
if (baseResult.getCode() == 200) {
String message = baseResult.getMessage();
String payUrl = ((Result) baseResult.getResult()).getPayUrl();
Bundle bundle = new Bundle();
bundle.putString("title", MTT0Act.this.getResources().getString(2131689909));
bundle.putString("url", payUrl);
bundle.putSerializable("myBorrow", MTT0Act.this.myBorrow);
Intent intent = new Intent("android.intent.action.VIEW");
if (resultBean.getJumpBorr() == 0 && intent.resolveActivity(BaseApplication.getContext().getPackageManager()) != null) {
intent.setData(Uri.parse(payUrl));
MTT0Act.this.startActivity(intent);
return;
} else {
MTT0Act.this.showShortToast(message);
MTT0Act.this.startActivity(MT7ACT.class, bundle);
MTT0Act.this.finish();
return;
}
}
if (baseResult.getCode() == 2022) {
Bundle bundle2 = new Bundle();
bundle2.putInt(NotificationCompat.CATEGORY_STATUS, 2);
bundle2.putString(NotificationCompat.CATEGORY_MESSAGE, MTT0Act.this.myBorrow.getRepaymentAmount() + "");
bundle2.putSerializable("myBorrow", MTT0Act.this.myBorrow);
MTT0Act.this.startActivity(MT1ACT.class, bundle2);
return;
}
if (baseResult.getCode() == 202) {
MTT0Act.this.showSmsDialog();
return;
}
Bundle bundle3 = new Bundle();
bundle3.putInt(NotificationCompat.CATEGORY_STATUS, 0);
bundle3.putSerializable("myBorrow", MTT0Act.this.myBorrow);
bundle3.putString(NotificationCompat.CATEGORY_MESSAGE, baseResult.getMessage());
MTT0Act.this.startActivity(MT1ACT.class, bundle3);
}
protected void _onError(String str2) {
Bundle bundle = new Bundle();
bundle.putInt(NotificationCompat.CATEGORY_STATUS, 0);
bundle.putString(NotificationCompat.CATEGORY_MESSAGE, str2);
MTT0Act.this.startActivity(MT1ACT.class, bundle);
}
}));
return;
}
showShortToast(getResources().getString(2131689868));
}
}
public void showSmsDialog() {
final LoginPwdDialog newInstance = LoginPwdDialog.newInstance((String) SPUtils.getData("PHONE", ""));
newInstance.setOnButtonOkClickListener(new BaseDialogFragment.OnButtonOkClickListener() {
public void onClick(View view, String str) {
if (RegexUtil.isEmpty(str)) {
return;
}
MTT0Act.this.deductVerifyCode(str);
newInstance.dismiss();
}
});
getSupportFragmentManager().beginTransaction().add((Fragment) newInstance, "LoginPwdDialog").commitAllowingStateLoss();
}
private void xQData(final OrederPayBean.ResultBean resultBean) {
PostponeBean postponeBean = this.postponeBean;
if (postponeBean != null) {
postponeBean.setPayType(resultBean.getId());
String json = new Gson().toJson(this.postponeBean);
long currentTimeMillis = System.currentTimeMillis();
String uuid = UUID.randomUUID().toString();
String str = json + "@" + uuid + "@" + currentTimeMillis;
String encrypt = RSAUtils.getInstance().encrypt(str + "@" + MD5Utils.md5(str, "f4qgkb85q4pMRMChLeC7uSn2wwTWGXrs"));
StringBuilder sb = new StringBuilder();
sb.append(currentTimeMillis);
sb.append("");
this.mRxManager.add(Api.getDefault().postponeCreateEnc(new EncForm(encrypt, uuid, sb.toString())).compose(RxSchedulers.io_main()).subscribe(new RxSubscriber<BaseResult<PostponeBean>>(this.mContext, true) {
public void _onNext(BaseResult<PostponeBean> baseResult) {
if (baseResult.getCode() == 202) {
MTT0Act.this.showSmsDialog();
return;
}
Serializable serializable = (PostponeBean) baseResult.getResult();
String payUrl = serializable.getPayUrl();
Bundle bundle = new Bundle();
bundle.putString("title", MTT0Act.this.getResources().getString(2131689966));
bundle.putString("url", payUrl);
bundle.putSerializable("myBorrow", serializable);
Intent intent = new Intent("android.intent.action.VIEW");
if (resultBean.getJumpBorr() == 0 && intent.resolveActivity(BaseApplication.getContext().getPackageManager()) != null) {
intent.setData(Uri.parse(payUrl));
MTT0Act.this.startActivity(intent);
} else {
MTT0Act.this.startActivity(MT7ACT.class, bundle);
MTT0Act.this.finish();
}
}
protected void _onError(String str2) {
MTT0Act.this.showShortToast(str2);
Bundle bundle = new Bundle();
bundle.putInt(NotificationCompat.CATEGORY_STATUS, 0);
bundle.putString(NotificationCompat.CATEGORY_MESSAGE, str2);
bundle.putString("ORDERID", MTT0Act.this.orderNo);
MTT0Act.this.startActivity(MT2ACT.class, bundle);
}
}));
}
}
protected void deductVerifyCode(String str) {
VerifyCodeBean verifyCodeBean = new VerifyCodeBean();
verifyCodeBean.verifyCode = str;
Api.getDefault().deductVerifyCode(verifyCodeBean).compose(RxSchedulers.io_main()).subscribe(new AnonymousClass6(this, false));
}
class AnonymousClass6 extends RxSubscriber<BaseResult> {
AnonymousClass6(Context context, boolean z) {
super(context, z);
}
public void _onNext(final BaseResult baseResult) {
final SureAndCancelDialog sureAndCancelDialog = new SureAndCancelDialog(MTT0Act.this.mContext, 2131492961);
((TextView) sureAndCancelDialog.getView(2131296444)).setText(baseResult.getMessage());
sureAndCancelDialog.setOnClickCancel(new SureAndCancelDialog.onClickCancel() {
public final void onClickCancel() {
sureAndCancelDialog.dismiss();
}
});
sureAndCancelDialog.setOnClickSure(new SureAndCancelDialog.onClickSure() {
public final void onClickSure() {
MTT0Act.AnonymousClass6.lambda$_onNext$1(sureAndCancelDialog, baseResult);
}
});
sureAndCancelDialog.show();
}
static void lambda$_onNext$1(SureAndCancelDialog sureAndCancelDialog, BaseResult baseResult) {
sureAndCancelDialog.dismiss();
if (baseResult.getCode() == 200) {
AppActivityManager.getAppManager().getActivity(BMAG01ACT.class).onCheckPosition(0);
AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
} else {
AppActivityManager.getAppManager().getActivity(BMAG01ACT.class).onCheckPosition(1);
AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
}
}
protected void _onError(String str) {
new ToastUtil().showShort(MTT0Act.this, str);
}
}
}