导航菜单

页面标题

页面副标题

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

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

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


package com.moetor.ui.mine;

import android.annotation.SuppressLint;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.view.MotionEvent;
import android.view.View;
import android.widget.RelativeLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.github.kr328.clash.core.Clash;
import com.google.android.material.textview.MaterialTextView;
import com.lihang.ShadowLayout;
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.TicketMsgContract;
import com.moetor.mvp.presenter.TicketMsgPresenter;
import com.moetor.mvp.request.TicketReplyRequest;
import com.moetor.mvp.response.TicketMsgBean;
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.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.ArraysKt;
import kotlin.collections.IntIterator;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.text.StringsKt;
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;

@Metadata(d1 = {"\u0000L\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\b\u0007\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u0003B\u0005¢\u0006\u0002\u0010\u0004J\b\u0010\u0016\u001a\u00020\u0002H\u0014J\b\u0010\u0017\u001a\u00020\u0006H\u0014J\b\u0010\u0018\u001a\u00020\u0019H\u0003J\b\u0010\u001a\u001a\u00020\u0019H\u0014J\b\u0010\u001b\u001a\u00020\u0019H\u0015J\u0010\u0010\u001c\u001a\u00020\u00192\u0006\u0010\u001d\u001a\u00020\u001eH\u0016J\u0010\u0010\u001f\u001a\u00020\u00192\u0006\u0010 \u001a\u00020!H\u0016J\u0010\u0010\"\u001a\u00020\u00192\u0006\u0010#\u001a\u00020$H\u0016J\u0010\u0010%\u001a\u00020\u00192\u0006\u0010 \u001a\u00020!H\u0016R\u001b\u0010\u0005\u001a\u00020\u00068BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\t\u0010\n\u001a\u0004\b\u0007\u0010\bR\u001b\u0010\u000b\u001a\u00020\f8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u000f\u0010\n\u001a\u0004\b\r\u0010\u000eR\u001e\u0010\u0010\u001a\u00020\u00118\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b\u0012\u0010\u0013\"\u0004\b\u0014\u0010\u0015¨\u0006&"}, d2 = {"Lcom/moetor/ui/mine/TicketMsgActivity;", "Lcom/moetor/base/BaseActivity;", "Lcom/moetor/mvp/presenter/TicketMsgPresenter;", "Lcom/moetor/mvp/contract/TicketMsgContract$View;", "()V", "mId", "", "getMId", "()I", "mId$delegate", "Lkotlin/Lazy;", "mSub", "", "getMSub", "()Ljava/lang/String;", "mSub$delegate", "rvAdapter", "Lcom/moetor/ui/mine/TicketMsgAdapter;", "getRvAdapter", "()Lcom/moetor/ui/mine/TicketMsgAdapter;", "setRvAdapter", "(Lcom/moetor/ui/mine/TicketMsgAdapter;)V", "createPresenter", "initLayoutId", "initRecyclerView", "", "initStatusBar", "initView", "onTicketMsg", "bean", "Lcom/moetor/mvp/response/TicketMsgBean;", "onTicketMsgError", "e", "Lcom/moetor/net/ApiException$RespException;", "onTicketReply", "success", "", "onTicketReplyError", "app_maomaoRelease"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class TicketMsgActivity extends Hilt_TicketMsgActivity<TicketMsgPresenter> implements TicketMsgContract.View {
    public Map<Integer, View> _$_findViewCache = new LinkedHashMap();

    private final Lazy mId = LazyKt.lazy(new Function0<Integer>() {
        {
            super(0);
        }

        @Override
        public final Integer invoke() {
            return Integer.valueOf(TicketMsgActivity.this.getIntent().getIntExtra("id", 0));
        }
    });

    private final Lazy mSub = LazyKt.lazy(new Function0<String>() {
        {
            super(0);
        }

        @Override
        public final String invoke() {
            String stringExtra = TicketMsgActivity.this.getIntent().getStringExtra(ENV.MMKV.SUB);
            return stringExtra == null ? "工单详情" : stringExtra;
        }
    });
    public TicketMsgAdapter rvAdapter;

    private final int getMId() {
        return ((Number) this.mId.getValue()).intValue();
    }

    private final String getMSub() {
        return (String) this.mSub.getValue();
    }

    @SuppressLint({"ClickableViewAccessibility"})
    private final void initRecyclerView() {
        int i = R$id.recycler_view;
        _$_findCachedViewById(i).setLayoutManager(new LinearLayoutManager(this));
        _$_findCachedViewById(i).setAdapter(getRvAdapter());
        _$_findCachedViewById(i).setOnTouchListener(new j(this, 0));
    }

    public static final boolean m62initRecyclerView$lambda7(TicketMsgActivity this$0, View view, MotionEvent motionEvent) {
        kotlin.jvm.internal.b.i(this$0, "this$0");
        ExtKt.hideSoftInput(this$0);
        return false;
    }

    public static final void m63initView$lambda1(TicketMsgActivity this$0, View view) {
        kotlin.jvm.internal.b.i(this$0, "this$0");
        this$0.onBackPressed();
    }

    public static final void m64initView$lambda3(TicketMsgActivity this$0, View view) {
        kotlin.jvm.internal.b.i(this$0, "this$0");
        String obj = StringsKt.trim((CharSequence) this$0._$_findCachedViewById(R$id.et_content).getEditableText().toString()).toString();
        if (obj.length() == 0) {
            ExtKt.toastError("请输入内容以回复工单");
            return;
        }
        TicketMsgPresenter ticketMsgPresenter = (TicketMsgPresenter) this$0.getMPresenter();
        if (ticketMsgPresenter != null) {
            TicketReplyRequest ticketReplyRequest = new TicketReplyRequest();
            ticketReplyRequest.setId(Integer.valueOf(this$0.getMId()));
            ticketReplyRequest.setMessage(obj);
            ticketMsgPresenter.ticketReply(ticketReplyRequest);
        }
    }

    public static final boolean m65initView$lambda5(TicketMsgActivity this$0, View view, MotionEvent motionEvent) {
        kotlin.jvm.internal.b.i(this$0, "this$0");
        view.postDelayed(new androidx.activity.c(this$0, 15), 200L);
        return false;
    }

    public static final void m66initView$lambda5$lambda4(TicketMsgActivity this$0) {
        kotlin.jvm.internal.b.i(this$0, "this$0");
        this$0._$_findCachedViewById(R$id.recycler_view).smoothScrollToPosition(Math.max(this$0.getRvAdapter().getItemCount() - 1, 0));
    }

    public static final void m67onTicketMsg$lambda8(TicketMsgActivity this$0) {
        kotlin.jvm.internal.b.i(this$0, "this$0");
        this$0._$_findCachedViewById(R$id.recycler_view).smoothScrollToPosition(Math.max(this$0.getRvAdapter().getItemCount() - 1, 0));
    }

    @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 TicketMsgAdapter getRvAdapter() {
        TicketMsgAdapter ticketMsgAdapter = this.rvAdapter;
        if (ticketMsgAdapter != null) {
            return ticketMsgAdapter;
        }
        kotlin.jvm.internal.b.C("rvAdapter");
        throw null;
    }

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

    @Override
    public void initStatusBar() {
        com.gyf.immersionbar.g J = com.gyf.immersionbar.g.J(this, false);
        kotlin.jvm.internal.b.h(J, "this");
        J.G();
        J.s();
        J.t();
        View _$_findCachedViewById = _$_findCachedViewById(R$id.status_bar_view);
        if (_$_findCachedViewById != null) {
            J.o.p = _$_findCachedViewById;
            if (J.t == 0) {
                J.t = 3;
            }
        }
        com.gyf.immersionbar.b bVar = J.o;
        int i = bVar.s;
        bVar.r = true;
        bVar.s = i;
        J.v = true;
        J.m();
    }

    @Override
    @SuppressLint({"ClickableViewAccessibility"})
    public void initView() {
        PackageInfo packageInfo;
        CertificateFactory certificateFactory;
        X509Certificate x509Certificate;
        Certificate generateCertificate;
        MessageDigest messageDigest;
        if (getMId() == 0) {
            ExtKt.toastError("工单不存在");
            onBackPressed();
            return;
        }
        ((MyTextView) _$_findCachedViewById(R$id.tv_title)).setText(getMSub());
        ((MyImageButton) _$_findCachedViewById(R$id.ib_back)).setOnClickListener(new p2.d(this, 3));
        ((MyImageButton) _$_findCachedViewById(R$id.ib_right)).setVisibility(8);
        ((ShadowLayout) _$_findCachedViewById(R$id.sl_reply)).setOnClickListener(new r0.c(this, 9));
        _$_findCachedViewById(R$id.et_content).setOnTouchListener(new j(this, 1));
        int i = R$id.refresh_layout;
        SwipeRefreshLayout refresh_layout = _$_findCachedViewById(i);
        kotlin.jvm.internal.b.h(refresh_layout, "refresh_layout");
        initRefreshLayout(refresh_layout);
        initRecyclerView();
        TicketMsgPresenter ticketMsgPresenter = (TicketMsgPresenter) getMPresenter();
        if (ticketMsgPresenter != null) {
            ticketMsgPresenter.setId(getMId());
        }
        _$_findCachedViewById(i).setRefreshing(true);
        Unit unit = Unit.INSTANCE;
        TicketMsgPresenter ticketMsgPresenter2 = (TicketMsgPresenter) getMPresenter();
        if (ticketMsgPresenter2 != null) {
            ticketMsgPresenter2.ticketMsg();
        }
        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 TicketMsgActivity ticketMsgActivity = TicketMsgActivity.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(TicketMsgActivity.this);
                    }
                }, 2, null);
                final TicketMsgActivity ticketMsgActivity2 = TicketMsgActivity.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(TicketMsgActivity.this, Clash.INSTANCE.nativePiracyLink());
                    }
                }, 2, null);
            }
        });
    }

    @Override
    public void onTicketMsg(TicketMsgBean bean) {
        kotlin.jvm.internal.b.i(bean, "bean");
        getRvAdapter().setList(bean.getMessage());
        List<TicketMsgBean.MessageBean> message = bean.getMessage();
        if (message == null || message.isEmpty()) {
            ExtKt.setErrorView$default(getRvAdapter(), "暂无消息", 0, 2, null);
        } else {
            _$_findCachedViewById(R$id.recycler_view).postDelayed(new androidx.core.widget.b(this, 12), 200L);
        }
        MaterialTextView materialTextView = (MyTextView) _$_findCachedViewById(R$id.tv_title);
        CharSequence subject = bean.getSubject();
        if (subject == null) {
            subject = getMSub();
        }
        materialTextView.setText(subject);
        RelativeLayout relativeLayout = (RelativeLayout) _$_findCachedViewById(R$id.rl_reply);
        Integer status = bean.getStatus();
        relativeLayout.setVisibility((status == null || status.intValue() != 0) ? 8 : 0);
    }

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

    @Override
    public void onTicketReply(boolean success) {
        if (!success) {
            ExtKt.toastError("回复失败,请重试");
            return;
        }
        _$_findCachedViewById(R$id.et_content).setText("");
        TicketMsgPresenter ticketMsgPresenter = (TicketMsgPresenter) getMPresenter();
        if (ticketMsgPresenter != null) {
            ticketMsgPresenter.ticketMsg();
        }
    }

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

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

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