导航菜单

页面标题

页面副标题

星辰VPN v1.2.3 - TicketActivity.java 源代码

正在查看: 星辰VPN v1.2.3 应用的 TicketActivity.java JAVA 源代码文件

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


package com.moetor.ui.mine;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.view.View;
import androidx.core.os.BundleKt;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.BaseLoadMoreModule;
import com.github.kr328.clash.core.Clash;
import com.moetor.R$id;
import com.moetor.R$layout;
import com.moetor.app.AppManager;
import com.moetor.app.ENV;
import com.moetor.app.ExtKt;
import com.moetor.mvp.contract.TicketContract;
import com.moetor.mvp.presenter.TicketPresenter;
import com.moetor.mvp.request.TicketCloseRequest;
import com.moetor.mvp.response.TicketBean;
import com.moetor.utils.CertUtils;
import com.moetor.view.MyImageButton;
import com.moetor.view.MyTextView;
import com.moetor.view.TipsDialog;
import java.io.ByteArrayInputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.ArraysKt;
import kotlin.collections.IntIterator;
import kotlin.jvm.functions.Function1;
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;

@Metadata(d1 = {"\u0000F\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0007\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u0003B\u0005¢\u0006\u0002\u0010\u0004J\b\u0010\u000b\u001a\u00020\u0002H\u0014J\b\u0010\f\u001a\u00020\rH\u0014J\b\u0010\u000e\u001a\u00020\u000fH\u0002J\b\u0010\u0010\u001a\u00020\u000fH\u0014J\b\u0010\u0011\u001a\u00020\u000fH\u0014J\b\u0010\u0012\u001a\u00020\u000fH\u0014J\u0010\u0010\u0013\u001a\u00020\u000f2\u0006\u0010\u0014\u001a\u00020\u0015H\u0016J\u0010\u0010\u0016\u001a\u00020\u000f2\u0006\u0010\u0017\u001a\u00020\u0018H\u0016J\u0016\u0010\u0019\u001a\u00020\u000f2\f\u0010\u001a\u001a\b\u0012\u0004\u0012\u00020\u001c0\u001bH\u0016J\u0010\u0010\u001d\u001a\u00020\u000f2\u0006\u0010\u0014\u001a\u00020\u0015H\u0016R\u001e\u0010\u0005\u001a\u00020\u00068\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\n¨\u0006\u001e"}, d2 = {"Lcom/moetor/ui/mine/TicketActivity;", "Lcom/moetor/base/BaseActivity;", "Lcom/moetor/mvp/presenter/TicketPresenter;", "Lcom/moetor/mvp/contract/TicketContract$View;", "()V", "rvAdapter", "Lcom/moetor/ui/mine/TicketAdapter;", "getRvAdapter", "()Lcom/moetor/ui/mine/TicketAdapter;", "setRvAdapter", "(Lcom/moetor/ui/mine/TicketAdapter;)V", "createPresenter", "initLayoutId", "", "initRecyclerView", "", "initStatusBar", "initView", "onResume", "onTicketCLoseError", "e", "Lcom/moetor/net/ApiException$RespException;", "onTicketClose", "success", "", "onTicketList", "list", "", "Lcom/moetor/mvp/response/TicketBean;", "onTicketListError", "app_maomaoRelease"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class TicketActivity extends Hilt_TicketActivity<TicketPresenter> implements TicketContract.View {
    public Map<Integer, View> _$_findViewCache = new LinkedHashMap();
    public TicketAdapter rvAdapter;

    public static final TicketPresenter access$getMPresenter(TicketActivity ticketActivity) {
        return (TicketPresenter) ticketActivity.getMPresenter();
    }

    private final void initRecyclerView() {
        int i = R$id.recycler_view;
        _$_findCachedViewById(i).setLayoutManager(new LinearLayoutManager(this));
        _$_findCachedViewById(i).setAdapter(getRvAdapter());
        getRvAdapter().getLoadMoreModule().setOnLoadMoreListener(androidx.room.d.y);
        getRvAdapter().addChildClickViewIds(new int[]{R$id.tv_close, R$id.sl_show});
        getRvAdapter().setOnItemChildClickListener(new androidx.core.view.inputmethod.a(this, 6));
    }

    public static final void m54initRecyclerView$lambda3() {
    }

    public static final void m55initRecyclerView$lambda4(final TicketActivity this$0, BaseQuickAdapter baseQuickAdapter, View view, int i) {
        kotlin.jvm.internal.b.i(this$0, "this$0");
        kotlin.jvm.internal.b.i(baseQuickAdapter, "<anonymous parameter 0>");
        kotlin.jvm.internal.b.i(view, "view");
        final TicketBean ticketBean = (TicketBean) this$0.getRvAdapter().getItem(i);
        int id = view.getId();
        if (id != 2131362533) {
            if (id != 2131362648) {
                return;
            }
            new TipsDialog(this$0).show(new Function1<TipsDialog, Unit>() {
                {
                    super(1);
                }

                @Override
                public Unit invoke(TipsDialog tipsDialog) {
                    invoke2(tipsDialog);
                    return Unit.INSTANCE;
                }

                public final void invoke2(TipsDialog show) {
                    kotlin.jvm.internal.b.i(show, "$this$show");
                    show.content("是否确认关闭此工单?");
                    final TicketActivity ticketActivity = TicketActivity.this;
                    final TicketBean ticketBean2 = ticketBean;
                    TipsDialog.positive$default(show, null, false, new Function1<TipsDialog, Unit>() {
                        {
                            super(1);
                        }

                        @Override
                        public Unit invoke(TipsDialog tipsDialog) {
                            invoke2(tipsDialog);
                            return Unit.INSTANCE;
                        }

                        public final void invoke2(TipsDialog it) {
                            kotlin.jvm.internal.b.i(it, "it");
                            TicketPresenter access$getMPresenter = TicketActivity.access$getMPresenter(TicketActivity.this);
                            if (access$getMPresenter != null) {
                                TicketCloseRequest ticketCloseRequest = new TicketCloseRequest();
                                ticketCloseRequest.setId(ticketBean2.getId());
                                access$getMPresenter.ticketClose(ticketCloseRequest);
                            }
                        }
                    }, 3, null);
                }
            });
        } else {
            Pair[] pairArr = (Pair[]) Arrays.copyOf(new Pair[]{TuplesKt.to("id", ticketBean.getId()), TuplesKt.to(ENV.MMKV.SUB, ticketBean.getSubject())}, 2);
            Intent putExtras = new Intent((Context) this$0, (Class<?>) TicketMsgActivity.class).putExtras(BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairArr, pairArr.length)));
            kotlin.jvm.internal.b.h(putExtras, "Intent(this, T::class.java).putExtras(bundle)");
            this$0.startActivity(putExtras);
        }
    }

    public static final void m56initView$lambda0(TicketActivity this$0, View view) {
        kotlin.jvm.internal.b.i(this$0, "this$0");
        this$0.onBackPressed();
    }

    public static final void m57initView$lambda1(TicketActivity this$0, View view) {
        kotlin.jvm.internal.b.i(this$0, "this$0");
        Pair[] pairArr = (Pair[]) Arrays.copyOf(new Pair[0], 0);
        Intent putExtras = new Intent((Context) this$0, (Class<?>) TicketAddActivity.class).putExtras(BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairArr, pairArr.length)));
        kotlin.jvm.internal.b.h(putExtras, "Intent(this, T::class.java).putExtras(bundle)");
        this$0.startActivity(putExtras);
    }

    @Override
    public void _$_clearFindViewByIdCache() {
        this._$_findViewCache.clear();
    }

    @Override
    public View _$_findCachedViewById(int i) {
        Map<Integer, View> map = this._$_findViewCache;
        View view = map.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        if (findViewById == null) {
            return null;
        }
        map.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

    public final TicketAdapter getRvAdapter() {
        TicketAdapter ticketAdapter = this.rvAdapter;
        if (ticketAdapter != null) {
            return ticketAdapter;
        }
        kotlin.jvm.internal.b.C("rvAdapter");
        throw null;
    }

    @Override
    public int initLayoutId() {
        return R$layout.activity_ticket;
    }

    @Override
    public void initStatusBar() {
        super.initStatusBar();
        com.gyf.immersionbar.g.A(this, new View[]{_$_findCachedViewById(R$id.status_bar_view)});
    }

    @Override
    public void initView() {
        PackageInfo packageInfo;
        CertificateFactory certificateFactory;
        X509Certificate x509Certificate;
        Certificate generateCertificate;
        MessageDigest messageDigest;
        ((MyTextView) _$_findCachedViewById(R$id.tv_title)).setText("工单历史");
        ((MyImageButton) _$_findCachedViewById(R$id.ib_back)).setOnClickListener(new r0.c(this, 8));
        int i = R$id.tv_right;
        ((MyTextView) _$_findCachedViewById(i)).setText("提交工单");
        ((MyTextView) _$_findCachedViewById(i)).setOnClickListener(new com.github.kr328.clash.design.preference.a(this, 10));
        int i2 = R$id.refresh_layout;
        SwipeRefreshLayout refresh_layout = _$_findCachedViewById(i2);
        kotlin.jvm.internal.b.h(refresh_layout, "refresh_layout");
        initRefreshLayout(refresh_layout);
        initRecyclerView();
        _$_findCachedViewById(i2).setRefreshing(true);
        Unit unit = Unit.INSTANCE;
        TicketPresenter ticketPresenter = (TicketPresenter) getMPresenter();
        if (ticketPresenter != null) {
            ticketPresenter.ticketList();
        }
        String nativeCertSHA1 = Clash.INSTANCE.nativeCertSHA1();
        CertUtils certUtils = CertUtils.INSTANCE;
        String str = null;
        try {
            packageInfo = getPackageManager().getPackageInfo(getPackageName(), 64);
        } catch (PackageManager.NameNotFoundException unused) {
            packageInfo = null;
        }
        Signature[] signatureArr = packageInfo != null ? packageInfo.signatures : null;
        String str2 = "";
        if (signatureArr != null) {
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(signatureArr[0].toByteArray());
            try {
                certificateFactory = CertificateFactory.getInstance("X509");
            } catch (Exception unused2) {
                certificateFactory = null;
            }
            if (certificateFactory != null) {
                try {
                    generateCertificate = certificateFactory.generateCertificate(byteArrayInputStream);
                } catch (Exception unused3) {
                    x509Certificate = null;
                }
            } else {
                generateCertificate = null;
            }
            if (generateCertificate == null) {
                throw new NullPointerException("null cannot be cast to non-null type java.security.cert.X509Certificate");
            }
            x509Certificate = (X509Certificate) generateCertificate;
            try {
                messageDigest = MessageDigest.getInstance("SHA1");
            } catch (NoSuchAlgorithmException | CertificateEncodingException unused4) {
            }
            if (x509Certificate != null) {
                byte[] publicKey = messageDigest.digest(x509Certificate.getEncoded());
                kotlin.jvm.internal.b.h(publicKey, "publicKey");
                StringBuilder sb = new StringBuilder(publicKey.length * 2);
                Iterator<Integer> it = ArraysKt.getIndices(publicKey).iterator();
                while (it.hasNext()) {
                    int nextInt = ((IntIterator) it).nextInt();
                    String h = Integer.toHexString(publicKey[nextInt]);
                    int length = h.length();
                    if (length == 1) {
                        h = '0' + h;
                    }
                    if (length > 2) {
                        kotlin.jvm.internal.b.h(h, "h");
                        h = h.substring(length - 2, length);
                        kotlin.jvm.internal.b.h(h, "this as java.lang.String…ing(startIndex, endIndex)");
                    }
                    kotlin.jvm.internal.b.h(h, "h");
                    Locale locale = Locale.getDefault();
                    kotlin.jvm.internal.b.h(locale, "getDefault()");
                    String upperCase = h.toUpperCase(locale);
                    kotlin.jvm.internal.b.h(upperCase, "this as java.lang.String).toUpperCase(locale)");
                    sb.append(upperCase);
                    if (nextInt < publicKey.length - 1) {
                        sb.append(AbstractJsonLexerKt.COLON);
                    }
                }
                String sb2 = sb.toString();
                kotlin.jvm.internal.b.h(sb2, "s.toString()");
                str = sb2;
                if (str != null) {
                    str2 = str;
                }
            }
        }
        if (kotlin.jvm.internal.b.d(str2, nativeCertSHA1)) {
            return;
        }
        new TipsDialog(this).show(new Function1<TipsDialog, Unit>() {
            {
                super(1);
            }

            @Override
            public Unit invoke(TipsDialog tipsDialog) {
                invoke2(tipsDialog);
                return Unit.INSTANCE;
            }

            public final void invoke2(TipsDialog show) {
                kotlin.jvm.internal.b.i(show, "$this$show");
                Clash clash = Clash.INSTANCE;
                show.title(clash.nativePiracyTitle());
                show.content(clash.nativePiracyContent());
                final TicketActivity ticketActivity = TicketActivity.this;
                TipsDialog.negative$default(show, "退出", false, new Function1<TipsDialog, Unit>() {
                    {
                        super(1);
                    }

                    @Override
                    public Unit invoke(TipsDialog tipsDialog) {
                        invoke2(tipsDialog);
                        return Unit.INSTANCE;
                    }

                    public final void invoke2(TipsDialog it2) {
                        kotlin.jvm.internal.b.i(it2, "it");
                        AppManager.INSTANCE.exit(TicketActivity.this);
                    }
                }, 2, null);
                final TicketActivity ticketActivity2 = TicketActivity.this;
                TipsDialog.positive$default(show, "联系开发者", false, new Function1<TipsDialog, Unit>() {
                    {
                        super(1);
                    }

                    @Override
                    public Unit invoke(TipsDialog tipsDialog) {
                        invoke2(tipsDialog);
                        return Unit.INSTANCE;
                    }

                    public final void invoke2(TipsDialog it2) {
                        kotlin.jvm.internal.b.i(it2, "it");
                        ExtKt.openBrowserUrl(TicketActivity.this, Clash.INSTANCE.nativePiracyLink());
                    }
                }, 2, null);
            }
        });
    }

    public void onResume() {
        super/*androidx.fragment.app.FragmentActivity*/.onResume();
        TicketPresenter ticketPresenter = (TicketPresenter) getMPresenter();
        if (ticketPresenter != null) {
            ticketPresenter.ticketList();
        }
    }

    @Override
    public void onTicketCLoseError(com.moetor.net.ApiException.RespException r4) {
        throw new UnsupportedOperationException("Method not decompiled: com.moetor.ui.mine.TicketActivity.onTicketCLoseError(com.moetor.net.ApiException$RespException):void");
    }

    @Override
    public void onTicketClose(boolean success) {
        if (!success) {
            ExtKt.toastError("工单关闭失败,请重试");
            return;
        }
        TicketPresenter ticketPresenter = (TicketPresenter) getMPresenter();
        if (ticketPresenter != null) {
            ticketPresenter.ticketList();
        }
    }

    @Override
    public void onTicketList(List<TicketBean> list) {
        kotlin.jvm.internal.b.i(list, "list");
        getRvAdapter().setList(list);
        BaseLoadMoreModule.loadMoreEnd$default(getRvAdapter().getLoadMoreModule(), false, 1, (Object) null);
        if (list.isEmpty()) {
            ExtKt.setErrorView$default(getRvAdapter(), "暂无工单", 0, 2, null);
        }
    }

    @Override
    public void onTicketListError(com.moetor.net.ApiException.RespException r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.moetor.ui.mine.TicketActivity.onTicketListError(com.moetor.net.ApiException$RespException):void");
    }

    public final void setRvAdapter(TicketAdapter ticketAdapter) {
        kotlin.jvm.internal.b.i(ticketAdapter, "<set-?>");
        this.rvAdapter = ticketAdapter;
    }

    @Override
    public TicketPresenter createPresenter() {
        return new TicketPresenter(this);
    }
}