导航菜单

页面标题

页面副标题

CreditNow v1.0.2 - CatMainActivity.java 源代码

正在查看: CreditNow v1.0.2 应用的 CatMainActivity.java JAVA 源代码文件

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


package com.cat.app.activity;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import com.aa.commonuilibrary.base.activity.BaseActivity;
import com.aa.commonuilibrary.base.activity.BaseVmActivity;
import com.aa.commonuilibrary.model.GetCheckAppUpdateDetailResp;
import com.cat.app.model.CatCustomerServiceBean;
import com.cat.app.viewmodel.CatMainViewModel;
import com.cat.themelibrary.R$color;
import com.credit.now.online.R$drawable;
import com.credit.now.online.databinding.ActivityMainBinding;
import com.orhanobut.logger.Logger;
import defpackage.az;
import defpackage.g10;
import defpackage.h10;
import defpackage.h40;
import defpackage.j40;
import defpackage.j41;
import defpackage.jp;
import defpackage.m40;
import defpackage.ph0;
import defpackage.td;
import defpackage.tp;
import defpackage.u20;
import defpackage.v10;
import defpackage.v20;
import defpackage.yq;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;

@Metadata
@yq
public final class CatMainActivity extends BaseActivity<CatMainViewModel, ActivityMainBinding> {

    @Metadata
    public final class a {
        public a() {
        }

        public final void a() {
            CatMainActivity.this.t1();
        }

        public final void b() {
            CatMainActivity.this.u1();
        }
    }

    @Metadata
    public static final class b extends jp<tp<GetCheckAppUpdateDetailResp>> {
        public b() {
        }

        @Override
        public void b(Throwable th) {
            StringBuilder sb = new StringBuilder();
            sb.append("AA02:");
            sb.append(th != null ? th.getMessage() : null);
            Logger.d(sb.toString(), new Object[0]);
            j40.a.b(j40.a, CatMainActivity.this, "Error  AppUpdate", 0, 4, null);
        }

        @Override
        public void a(@NotNull tp<GetCheckAppUpdateDetailResp> tpVar) {
            Intrinsics.checkNotNullParameter(tpVar, "resp");
            td.a.a(CatMainActivity.this.Q0(), tpVar);
        }

        @Override
        public void c(@NotNull tp<GetCheckAppUpdateDetailResp> tpVar) {
            Intrinsics.checkNotNullParameter(tpVar, "resp");
            Integer lanyards = tpVar.data.getLanyards();
            if (lanyards != null && lanyards.intValue() == 2) {
                CatMainActivity catMainActivity = CatMainActivity.this;
                GetCheckAppUpdateDetailResp getCheckAppUpdateDetailResp = tpVar.data;
                Intrinsics.checkNotNullExpressionValue(getCheckAppUpdateDetailResp, "data");
                catMainActivity.v1(getCheckAppUpdateDetailResp);
                return;
            }
            Integer lanyards2 = tpVar.data.getLanyards();
            if (lanyards2 != null && lanyards2.intValue() == 1) {
                String abiston = tpVar.data.getAbiston();
                h10 h10Var = h10.a;
                if (Intrinsics.a(abiston, h10Var.b("haveShowVersionCode", ""))) {
                    return;
                }
                CatMainActivity catMainActivity2 = CatMainActivity.this;
                GetCheckAppUpdateDetailResp getCheckAppUpdateDetailResp2 = tpVar.data;
                Intrinsics.checkNotNullExpressionValue(getCheckAppUpdateDetailResp2, "data");
                catMainActivity2.v1(getCheckAppUpdateDetailResp2);
                h10Var.d("haveShowVersionCode", tpVar.data.getAbiston());
            }
        }
    }

    @Metadata
    public static final class c extends jp<tp<List<? extends CatCustomerServiceBean>>> {
        @Override
        public void b(Throwable th) {
            StringBuilder sb = new StringBuilder();
            sb.append("AA02:");
            sb.append(th != null ? th.getMessage() : null);
            Logger.d(sb.toString(), new Object[0]);
        }

        @Override
        public void a(tp<List<CatCustomerServiceBean>> tpVar) {
            Logger.d("AA02: onApiError", new Object[0]);
        }

        @Override
        public void c(@NotNull tp<List<CatCustomerServiceBean>> tpVar) {
            Object obj;
            Object obj2;
            Object obj3;
            Intrinsics.checkNotNullParameter(tpVar, "resp");
            List<CatCustomerServiceBean> list = tpVar.data;
            if (list == null || list.isEmpty()) {
                return;
            }
            List<CatCustomerServiceBean> list2 = tpVar.data;
            Intrinsics.checkNotNullExpressionValue(list2, "data");
            Iterator<T> it = list2.iterator();
            while (true) {
                if (!it.hasNext()) {
                    obj = null;
                    break;
                }
                obj = it.next();
                Integer intersects = ((CatCustomerServiceBean) obj).getIntersects();
                if (intersects != null && intersects.intValue() == 3) {
                    break;
                }
            }
            CatCustomerServiceBean catCustomerServiceBean = (CatCustomerServiceBean) obj;
            h10.a.d("customerServiceCs", catCustomerServiceBean != null ? catCustomerServiceBean.getHalper() : null);
            List<CatCustomerServiceBean> list3 = tpVar.data;
            Intrinsics.checkNotNullExpressionValue(list3, "data");
            Iterator<T> it2 = list3.iterator();
            while (true) {
                if (!it2.hasNext()) {
                    obj2 = null;
                    break;
                }
                obj2 = it2.next();
                Integer intersects2 = ((CatCustomerServiceBean) obj2).getIntersects();
                if (intersects2 != null && intersects2.intValue() == 1) {
                    break;
                }
            }
            CatCustomerServiceBean catCustomerServiceBean2 = (CatCustomerServiceBean) obj2;
            h10.a.d("customerServiceEmail", catCustomerServiceBean2 != null ? catCustomerServiceBean2.getHalper() : null);
            List<CatCustomerServiceBean> list4 = tpVar.data;
            Intrinsics.checkNotNullExpressionValue(list4, "data");
            Iterator<T> it3 = list4.iterator();
            while (true) {
                if (!it3.hasNext()) {
                    obj3 = null;
                    break;
                }
                obj3 = it3.next();
                Integer intersects3 = ((CatCustomerServiceBean) obj3).getIntersects();
                if (intersects3 != null && intersects3.intValue() == 4) {
                    break;
                }
            }
            CatCustomerServiceBean catCustomerServiceBean3 = (CatCustomerServiceBean) obj3;
            String halper = catCustomerServiceBean3 != null ? catCustomerServiceBean3.getHalper() : null;
            if (halper == null) {
                h10.a.d("customerServiceWhatsApp", "");
            } else {
                h10.a.d("customerServiceWhatsApp", halper);
            }
        }
    }

    @Metadata
    public static final class d implements BaseVmActivity.b {
        @Override
        public void a(boolean z) {
            j41.a.c(new v10(v10.g, Boolean.valueOf(z)));
        }
    }

    @Metadata
    public static final class e extends o02 implements Function1<String, Unit> {
        public e() {
            super(1);
        }

        public final void b(@NotNull String str) {
            Intrinsics.checkNotNullParameter(str, "it");
            CatMainActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
        }

        public Object invoke(Object obj) {
            b((String) obj);
            return Unit.a;
        }
    }

    private final void q1() {
        ((CatMainViewModel) O0()).dealWithCheckAppUpdate(new b());
    }

    private final void r1() {
        ((CatMainViewModel) O0()).getCustomerService(new c());
    }

    public final void v1(GetCheckAppUpdateDetailResp getCheckAppUpdateDetailResp) {
        m40 m40Var = new m40(getCheckAppUpdateDetailResp);
        m40 d2 = m40Var.d(this);
        if (d2 != null) {
            d2.j();
        }
        m40Var.h(new e());
    }

    @Override
    public void V0(Bundle bundle) {
        h40.a.e(this);
        ((ActivityMainBinding) n1()).setClick(new a());
        az.b.a().c(P0());
        f0();
        s1();
    }

    public final void f0() {
        q1();
        r1();
        t1();
        e1(new d());
    }

    @Override
    @SuppressLint({"MissingSuperCall"})
    public void onBackPressed() {
        if (((CatMainViewModel) O0()).isDoubleClick()) {
            super.onBackPressed();
        }
    }

    @f94(threadMode = ThreadMode.MAIN)
    public final void onMessageEvent(v10<String> v10Var) {
        if (v10Var == null) {
            return;
        }
        int a2 = v10Var.a();
        if (a2 == v10.e) {
            t1();
        } else if (a2 == v10.f) {
            u1();
        }
    }

    @Override
    public void onNewIntent(@NotNull Intent intent) {
        String str;
        Intrinsics.checkNotNullParameter(intent, "intent");
        super.onNewIntent(intent);
        Bundle extras = intent.getExtras();
        if (extras == null || (str = extras.getString("tab")) == null) {
            str = "";
        }
        if (TextUtils.equals(str, "home")) {
            t1();
        } else if (TextUtils.equals(str, "my")) {
            u1();
        }
    }

    public final void s1() {
        ((ActivityMainBinding) n1()).viewPageMain.setAdapter(new u20(this));
        ((ActivityMainBinding) n1()).viewPageMain.setUserInputEnabled(false);
    }

    public final void t1() {
        v20 mCurrentTab = ((CatMainViewModel) O0()).getMCurrentTab();
        v20.a aVar = v20.a.a;
        if (Intrinsics.a(mCurrentTab, aVar)) {
            return;
        }
        Logger.d("jumpToHome", new Object[0]);
        ((CatMainViewModel) O0()).setMCurrentTab(aVar);
        ((ActivityMainBinding) n1()).viewPageMain.setCurrentItem(0);
        w1();
    }

    public final void u1() {
        v20 mCurrentTab = ((CatMainViewModel) O0()).getMCurrentTab();
        v20.b bVar = v20.b.a;
        if (Intrinsics.a(mCurrentTab, bVar)) {
            return;
        }
        Logger.d("jumpToMy", new Object[0]);
        if (TextUtils.isEmpty(g10.a.h())) {
            ((CatMainViewModel) O0()).jumpToLogin(this);
            return;
        }
        ((CatMainViewModel) O0()).setMCurrentTab(bVar);
        ((ActivityMainBinding) n1()).viewPageMain.setCurrentItem(1);
        w1();
    }

    public final void w1() {
        v20 mCurrentTab = ((CatMainViewModel) O0()).getMCurrentTab();
        if (Intrinsics.a(mCurrentTab, v20.a.a)) {
            ((ActivityMainBinding) n1()).tvHome.setTextColor(ph0.c(this, R$color.color_12B298));
            ((ActivityMainBinding) n1()).ivHome.setImageResource(R$drawable.cat_icon_home_green);
            ((ActivityMainBinding) n1()).tvMy.setTextColor(ph0.c(this, R$color.color_8A9996));
            ((ActivityMainBinding) n1()).ivMy.setImageResource(R$drawable.cat_icon_my_gray);
            return;
        }
        if (Intrinsics.a(mCurrentTab, v20.b.a)) {
            ((ActivityMainBinding) n1()).tvHome.setTextColor(ph0.c(this, R$color.color_8A9996));
            ((ActivityMainBinding) n1()).ivHome.setImageResource(R$drawable.cat_icon_home_gray);
            ((ActivityMainBinding) n1()).tvMy.setTextColor(ph0.c(this, R$color.color_12B298));
            ((ActivityMainBinding) n1()).ivMy.setImageResource(R$drawable.cat_icon_my_green);
        }
    }
}