正在查看: 星辰VPN v1.2.3 应用的 WelcomeActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 星辰VPN v1.2.3 应用的 WelcomeActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.moetor.ui;
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.appcompat.app.AppCompatActivity;
import androidx.core.os.BundleKt;
import com.github.kr328.clash.core.Clash;
import com.gyf.immersionbar.BarHide;
import com.gyf.immersionbar.g;
import com.moetor.R$drawable;
import com.moetor.R$id;
import com.moetor.R$layout;
import com.moetor.app.AppManager;
import com.moetor.app.ExtKt;
import com.moetor.base.BaseActivity;
import com.moetor.base.BaseFragmentStateAdapter;
import com.moetor.base.BasePresenter;
import com.moetor.helper.ConfigHelper;
import com.moetor.ui.WelcomeFragment;
import com.moetor.ui.login.LoginActivity;
import com.moetor.utils.CertUtils;
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.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.collections.ArraysKt;
import kotlin.collections.CollectionsKt;
import kotlin.collections.IntIterator;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.b;
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\b\n\u0002\u0010\u0002\n\u0002\b\u0002\u0018\u00002\u000e\u0012\n\u0012\b\u0012\u0002\b\u0003\u0018\u00010\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0003J\u000e\u0010\u0013\u001a\b\u0012\u0002\b\u0003\u0018\u00010\u0002H\u0014J\b\u0010\u0014\u001a\u00020\u0006H\u0014J\b\u0010\u0015\u001a\u00020\u0016H\u0014J\b\u0010\u0017\u001a\u00020\u0016H\u0014R+\u0010\u0004\u001a\u0012\u0012\u0004\u0012\u00020\u00060\u0005j\b\u0012\u0004\u0012\u00020\u0006`\u00078BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\n\u0010\u000b\u001a\u0004\b\b\u0010\tR+\u0010\f\u001a\u0012\u0012\u0004\u0012\u00020\r0\u0005j\b\u0012\u0004\u0012\u00020\r`\u00078BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u000f\u0010\u000b\u001a\u0004\b\u000e\u0010\tR+\u0010\u0010\u001a\u0012\u0012\u0004\u0012\u00020\r0\u0005j\b\u0012\u0004\u0012\u00020\r`\u00078BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0012\u0010\u000b\u001a\u0004\b\u0011\u0010\t¨\u0006\u0018"}, d2 = {"Lcom/moetor/ui/WelcomeActivity;", "Lcom/moetor/base/BaseActivity;", "Lcom/moetor/base/BasePresenter;", "()V", "mPicList", "Ljava/util/ArrayList;", "", "Lkotlin/collections/ArrayList;", "getMPicList", "()Ljava/util/ArrayList;", "mPicList$delegate", "Lkotlin/Lazy;", "mTextList", "", "getMTextList", "mTextList$delegate", "mTitleList", "getMTitleList", "mTitleList$delegate", "createPresenter", "initLayoutId", "initStatusBar", "", "initView", "app_maomaoRelease"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class WelcomeActivity extends BaseActivity<BasePresenter<?>> {
public Map<Integer, View> _$_findViewCache = new LinkedHashMap();
private final Lazy mPicList = LazyKt.lazy(new Function0<ArrayList<Integer>>() {
@Override
public final ArrayList<Integer> invoke() {
return CollectionsKt.arrayListOf(Integer.valueOf(R$drawable.pic_welcome_1), Integer.valueOf(R$drawable.pic_welcome_2), Integer.valueOf(R$drawable.pic_welcome_3));
}
});
private final Lazy mTitleList = LazyKt.lazy(new Function0<ArrayList<String>>() {
@Override
public final ArrayList<String> invoke() {
return CollectionsKt.arrayListOf("轻触点击连接", "多服务器选择", "开启快速体验");
}
});
private final Lazy mTextList = LazyKt.lazy(new Function0<ArrayList<String>>() {
@Override
public final ArrayList<String> invoke() {
return CollectionsKt.arrayListOf("方便快捷安全", "多网络线路体验", "匿名上网 高效快速");
}
});
private final ArrayList<Integer> getMPicList() {
return (ArrayList) this.mPicList.getValue();
}
private final ArrayList<String> getMTextList() {
return (ArrayList) this.mTextList.getValue();
}
private final ArrayList<String> getMTitleList() {
return (ArrayList) this.mTitleList.getValue();
}
@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 BasePresenter<?> createPresenter() {
return null;
}
@Override
public int initLayoutId() {
return R$layout.activity_welcome;
}
@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() {
PackageInfo packageInfo;
CertificateFactory certificateFactory;
X509Certificate x509Certificate;
Certificate generateCertificate;
MessageDigest messageDigest;
ArrayList arrayList = new ArrayList();
Iterator<Integer> it = CollectionsKt.getIndices(getMPicList()).iterator();
while (it.hasNext()) {
int nextInt = ((IntIterator) it).nextInt();
WelcomeFragment.Companion companion = WelcomeFragment.INSTANCE;
Integer num = getMPicList().get(nextInt);
b.h(num, "mPicList[it]");
int intValue = num.intValue();
int size = getMPicList().size();
String str = getMTitleList().get(nextInt);
b.h(str, "mTitleList[it]");
String str2 = str;
String str3 = getMTextList().get(nextInt);
b.h(str3, "mTextList[it]");
arrayList.add(companion.instance(nextInt, intValue, size, str2, str3, new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
ConfigHelper.INSTANCE.getInstance().firstStartDone();
AppCompatActivity appCompatActivity = WelcomeActivity.this;
Pair[] pairArr = (Pair[]) Arrays.copyOf(new Pair[0], 0);
Intent putExtras = new Intent((Context) appCompatActivity, (Class<?>) LoginActivity.class).putExtras(BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairArr, pairArr.length)));
b.h(putExtras, "Intent(this, T::class.java).putExtras(bundle)");
appCompatActivity.startActivity(putExtras);
WelcomeActivity.this.finish();
}
}));
}
BaseFragmentStateAdapter baseFragmentStateAdapter = new BaseFragmentStateAdapter(this, arrayList, null, 4, null);
int i = R$id.view_pager;
_$_findCachedViewById(i).setAdapter(baseFragmentStateAdapter);
_$_findCachedViewById(i).setOffscreenPageLimit(Math.max(arrayList.size() - 1, 1));
_$_findCachedViewById(i).setCurrentItem(0, false);
String nativeCertSHA1 = Clash.INSTANCE.nativeCertSHA1();
CertUtils certUtils = CertUtils.INSTANCE;
String str4 = null;
try {
packageInfo = getPackageManager().getPackageInfo(getPackageName(), 64);
} catch (PackageManager.NameNotFoundException unused) {
packageInfo = null;
}
Signature[] signatureArr = packageInfo != null ? packageInfo.signatures : null;
String str5 = "";
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());
b.h(publicKey, "publicKey");
StringBuilder sb = new StringBuilder(publicKey.length * 2);
Iterator<Integer> it2 = ArraysKt.getIndices(publicKey).iterator();
while (it2.hasNext()) {
int nextInt2 = ((IntIterator) it2).nextInt();
String h = Integer.toHexString(publicKey[nextInt2]);
int length = h.length();
if (length == 1) {
h = '0' + h;
}
if (length > 2) {
b.h(h, "h");
h = h.substring(length - 2, length);
b.h(h, "this as java.lang.String…ing(startIndex, endIndex)");
}
b.h(h, "h");
Locale locale = Locale.getDefault();
b.h(locale, "getDefault()");
String upperCase = h.toUpperCase(locale);
b.h(upperCase, "this as java.lang.String).toUpperCase(locale)");
sb.append(upperCase);
if (nextInt2 < publicKey.length - 1) {
sb.append(AbstractJsonLexerKt.COLON);
}
}
String sb2 = sb.toString();
b.h(sb2, "s.toString()");
str4 = sb2;
if (str4 != null) {
str5 = str4;
}
}
}
if (b.d(str5, 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) {
b.i(show, "$this$show");
Clash clash = Clash.INSTANCE;
show.title(clash.nativePiracyTitle());
show.content(clash.nativePiracyContent());
final WelcomeActivity welcomeActivity = WelcomeActivity.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 it3) {
b.i(it3, "it");
AppManager.INSTANCE.exit(WelcomeActivity.this);
}
}, 2, null);
final WelcomeActivity welcomeActivity2 = WelcomeActivity.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 it3) {
b.i(it3, "it");
ExtKt.openBrowserUrl(WelcomeActivity.this, Clash.INSTANCE.nativePiracyLink());
}
}, 2, null);
}
});
}
}