导航菜单

页面标题

页面副标题

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

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

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


package com.moetor.ui;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.core.os.BundleKt;
import coil.Coil;
import coil.ImageLoader;
import coil.request.ImageRequest;
import com.gyf.immersionbar.BarHide;
import com.gyf.immersionbar.g;
import com.moetor.R$id;
import com.moetor.R$layout;
import com.moetor.R$mipmap;
import com.moetor.R$style;
import com.moetor.app.AppManager;
import com.moetor.base.BaseActivity;
import com.moetor.helper.ConfigHelper;
import com.moetor.helper.UserHelper;
import com.moetor.mvp.contract.BootContract;
import com.moetor.mvp.presenter.BootPresenter;
import com.moetor.mvp.response.ControlBean;
import com.moetor.net.ApiException;
import com.moetor.ui.login.LoginActivity;
import com.moetor.utils.Des3Utils;
import com.moetor.view.MyImageView;
import com.moetor.view.MyTextView;
import com.moetor.view.TipsDialog;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.b;

@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u0003B\u0005¢\u0006\u0002\u0010\u0004J\b\u0010\u0005\u001a\u00020\u0002H\u0014J\b\u0010\u0006\u001a\u00020\u0007H\u0014J\b\u0010\b\u001a\u00020\tH\u0014J\b\u0010\n\u001a\u00020\tH\u0014J\u0010\u0010\u000b\u001a\u00020\t2\u0006\u0010\f\u001a\u00020\rH\u0016J\u0010\u0010\u000e\u001a\u00020\t2\u0006\u0010\u000f\u001a\u00020\u0010H\u0016J\u0012\u0010\u0011\u001a\u00020\t2\b\u0010\u0012\u001a\u0004\u0018\u00010\u0013H\u0016J\u0010\u0010\u0014\u001a\u00020\t2\u0006\u0010\u000f\u001a\u00020\u0010H\u0016J\b\u0010\u0015\u001a\u00020\tH\u0014¨\u0006\u0016"}, d2 = {"Lcom/moetor/ui/BootActivity;", "Lcom/moetor/base/BaseActivity;", "Lcom/moetor/mvp/presenter/BootPresenter;", "Lcom/moetor/mvp/contract/BootContract$View;", "()V", "createPresenter", "initLayoutId", "", "initStatusBar", "", "initView", "onCheckLogin", "isLogin", "", "onCheckLoginError", "e", "Lcom/moetor/net/ApiException$RespException;", "onControlData", "yml", "", "onControlDataError", "onDestroy", "app_maomaoRelease"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class BootActivity extends BaseActivity<BootPresenter> implements BootContract.View {
    public Map<Integer, View> _$_findViewCache = new LinkedHashMap();

    @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;
    }

    @Override
    public int initLayoutId() {
        setTheme(R$style.Theme_Moetor);
        return R$layout.activity_boot;
    }

    @Override
    public void initStatusBar() {
        g J = g.J(this, false);
        b.h(J, "this");
        J.G();
        J.k(BarHide.FLAG_HIDE_NAVIGATION_BAR);
        J.m();
    }

    @Override
    public void initView() {
        AppCompatImageView iv = (MyImageView) _$_findCachedViewById(R$id.iv);
        b.h(iv, "iv");
        Integer valueOf = Integer.valueOf(R$mipmap.ic_launcher_round);
        ImageLoader imageLoader = Coil.imageLoader(iv.getContext());
        ImageRequest.Builder target = new ImageRequest.Builder(iv.getContext()).data(valueOf).target(iv);
        target.crossfade(true);
        target.crossfade(ApiException.Error.UNKNOWN);
        imageLoader.enqueue(target.build());
        _$_findCachedViewById(R$id.shimmer).e();
        BootPresenter mPresenter = getMPresenter();
        if (mPresenter != null) {
            mPresenter.controlData();
        }
    }

    @Override
    public void onCheckLogin(boolean isLogin) {
        _$_findCachedViewById(R$id.shimmer).a();
        if (isLogin) {
            Pair[] pairArr = (Pair[]) Arrays.copyOf(new Pair[0], 0);
            Intent putExtras = new Intent((Context) this, (Class<?>) MainActivity.class).putExtras(BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairArr, pairArr.length)));
            b.h(putExtras, "Intent(this, T::class.java).putExtras(bundle)");
            startActivity(putExtras);
        } else {
            Pair[] pairArr2 = (Pair[]) Arrays.copyOf(new Pair[0], 0);
            Intent putExtras2 = new Intent((Context) this, (Class<?>) LoginActivity.class).putExtras(BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairArr2, pairArr2.length)));
            b.h(putExtras2, "Intent(this, T::class.java).putExtras(bundle)");
            startActivity(putExtras2);
        }
        finish();
    }

    @Override
    public void onCheckLoginError(final ApiException.RespException e) {
        b.i(e, "e");
        _$_findCachedViewById(R$id.shimmer).a();
        UserHelper.Companion companion = UserHelper.INSTANCE;
        String auth = companion.getInstance().getAuth();
        String token = companion.getInstance().getToken();
        if (auth.length() > 0) {
            if (token.length() > 0) {
                Pair[] pairArr = (Pair[]) Arrays.copyOf(new Pair[0], 0);
                Intent putExtras = new Intent((Context) this, (Class<?>) MainActivity.class).putExtras(BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairArr, pairArr.length)));
                b.h(putExtras, "Intent(this, T::class.java).putExtras(bundle)");
                startActivity(putExtras);
                finish();
                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) {
                b.i(show, "$this$show");
                show.content(ApiException.RespException.this.getMessage());
                final BootActivity bootActivity = 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 it) {
                        b.i(it, "it");
                        AppManager.INSTANCE.exit(BootActivity.this);
                    }
                }, 2, null);
                final BootActivity bootActivity2 = 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 it) {
                        BootPresenter mPresenter;
                        b.i(it, "it");
                        BootActivity.this._$_findCachedViewById(R$id.shimmer).d();
                        mPresenter = BootActivity.this.getMPresenter();
                        if (mPresenter != null) {
                            mPresenter.checkLogin();
                        }
                    }
                }, 2, null);
            }
        });
    }

    @Override
    public void onControlData(java.lang.String r15) {
        throw new UnsupportedOperationException("Method not decompiled: com.moetor.ui.BootActivity.onControlData(java.lang.String):void");
    }

    @Override
    public void onControlDataError(ApiException.RespException e) {
        b.i(e, "e");
        ConfigHelper.Companion companion = ConfigHelper.INSTANCE;
        if (companion.getInstance().getBaseUrl().length() == 0) {
            _$_findCachedViewById(R$id.shimmer).a();
            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) {
                    b.i(show, "$this$show");
                    ((MyTextView) show.findViewById(R$id.tv_content)).setText("获取云端配置失败,请重试");
                    final BootActivity bootActivity = BootActivity.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 it) {
                            b.i(it, "it");
                            AppManager.INSTANCE.exit(BootActivity.this);
                        }
                    }, 2, null);
                    final BootActivity bootActivity2 = BootActivity.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 it) {
                            BootPresenter mPresenter;
                            b.i(it, "it");
                            BootActivity.this._$_findCachedViewById(R$id.shimmer).d();
                            mPresenter = BootActivity.this.getMPresenter();
                            if (mPresenter != null) {
                                mPresenter.controlData();
                            }
                        }
                    }, 2, null);
                }
            });
            return;
        }
        Des3Utils des3Utils = Des3Utils.INSTANCE;
        ControlBean controlData = companion.getInstance().getControlData();
        String decrypt$default = Des3Utils.decrypt$default(des3Utils, controlData != null ? controlData.getLicense() : null, null, null, 6, null);
        if (decrypt$default.length() == 0) {
            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) {
                    b.i(show, "$this$show");
                    show.content("当前客户端未授权,请联系客服");
                    show.hideNegative();
                    final BootActivity bootActivity = BootActivity.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 it) {
                            b.i(it, "it");
                            AppManager.INSTANCE.exit(BootActivity.this);
                        }
                    }, 2, null);
                }
            });
            return;
        }
        if (!b.d(decrypt$default, "https://m.goudan.site/mt.json")) {
            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) {
                    b.i(show, "$this$show");
                    show.content("客户端授权无效,请联系客服");
                    show.hideNegative();
                    final BootActivity bootActivity = BootActivity.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 it) {
                            b.i(it, "it");
                            AppManager.INSTANCE.exit(BootActivity.this);
                        }
                    }, 2, null);
                }
            });
            return;
        }
        if (!(UserHelper.INSTANCE.getInstance().getAuth().length() == 0)) {
            BootPresenter bootPresenter = (BootPresenter) getMPresenter();
            if (bootPresenter != null) {
                bootPresenter.checkLogin();
                return;
            }
            return;
        }
        _$_findCachedViewById(R$id.shimmer).a();
        Pair[] pairArr = (Pair[]) Arrays.copyOf(new Pair[0], 0);
        Intent putExtras = new Intent((Context) this, (Class<?>) LoginActivity.class).putExtras(BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairArr, pairArr.length)));
        b.h(putExtras, "Intent(this, T::class.java).putExtras(bundle)");
        startActivity(putExtras);
        finish();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        _$_findCachedViewById(R$id.shimmer).a();
    }

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