正在查看: 星辰VPN v1.2.3 应用的 ExtKt.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 星辰VPN v1.2.3 应用的 ExtKt.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.moetor.app;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
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.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.IBinder;
import android.text.SpannableString;
import android.text.TextPaint;
import android.text.style.URLSpan;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.widget.PopupMenu;
import androidx.core.content.ContextCompat;
import androidx.core.os.BundleKt;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.github.kr328.clash.core.Clash;
import com.moetor.R$color;
import com.moetor.R$id;
import com.moetor.R$layout;
import com.moetor.R$raw;
import com.moetor.app.ENV;
import com.moetor.helper.ConfigHelper;
import com.moetor.mvp.response.ControlBean;
import com.moetor.utils.CertUtils;
import com.moetor.utils.DateUtils;
import com.moetor.utils.EncryptKt;
import com.moetor.utils.GsonUtils;
import com.moetor.view.MyTextView;
import java.io.ByteArrayInputStream;
import java.io.File;
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.text.NumberFormat;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import kotlin.Metadata;
import kotlin.Pair;
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 kotlin.text.StringsKt__StringsKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.Job;
import kotlinx.coroutines.flow.FlowKt;
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.internal.ws.RealWebSocket;
@Metadata(d1 = {"\u0000Ö\u0001\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0010\u0006\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\u001a\u0010\u0010(\u001a\u00020\u00052\b\u0010)\u001a\u0004\u0018\u00010\u001d\u001a\u0016\u0010*\u001a\u00020!2\u0006\u0010+\u001a\u00020\b2\u0006\u0010,\u001a\u00020\b\u001a\u0012\u0010-\u001a\u00020.*\u00020\u00172\u0006\u0010/\u001a\u00020\u001d\u001a\n\u00100\u001a\u00020\u001d*\u00020\u001d\u001a\f\u00101\u001a\u000202*\u0004\u0018\u00010\u001d\u001a\u001b\u00103\u001a\u00020\u001d*\u0004\u0018\u0001042\b\b\u0002\u00105\u001a\u00020\u001d¢\u0006\u0002\u00106\u001a\n\u00107\u001a\u00020\u001d*\u000208\u001a?\u00109\u001a\u00020\u001d*\u0002082\n\b\u0002\u0010:\u001a\u0004\u0018\u00010\b2\n\b\u0002\u0010;\u001a\u0004\u0018\u00010\b2\n\b\u0002\u0010<\u001a\u0004\u0018\u00010\b2\n\b\u0002\u0010=\u001a\u0004\u0018\u00010\b¢\u0006\u0002\u0010>\u001a\n\u0010?\u001a\u000202*\u00020@\u001a\u001d\u0010A\u001a\u00020B\"\u0006\b\u0000\u0010C\u0018\u0001*\u00020D2\u0006\u0010E\u001a\u00020FH\u0086\b\u001aB\u0010A\u001a\u00020B\"\u0006\b\u0000\u0010C\u0018\u0001*\u00020D2&\u0010G\u001a\u0014\u0012\u0010\b\u0001\u0012\f\u0012\u0004\u0012\u00020\u001d\u0012\u0002\b\u00030I0H\"\f\u0012\u0004\u0012\u00020\u001d\u0012\u0002\b\u00030IH\u0086\b¢\u0006\u0002\u0010J\u001a\n\u0010K\u001a\u00020\u0005*\u00020\u001d\u001a\u0011\u0010L\u001a\u00020\u001d*\u0004\u0018\u000104¢\u0006\u0002\u0010M\u001a\u0012\u0010N\u001a\u000202*\u00020D2\u0006\u0010O\u001a\u00020\u001d\u001a.\u0010P\u001a\u00020Q*\u00020@2\u0006\u0010R\u001a\u00020\b2\u0006\u0010S\u001a\u00020!2\u0006\u0010T\u001a\u00020\b2\n\b\u0002\u0010U\u001a\u0004\u0018\u00010V\u001a\n\u0010W\u001a\u000202*\u00020X\u001a-\u0010Y\u001a\u000202*\n\u0012\u0002\b\u0003\u0012\u0002\b\u00030Z2\b\b\u0002\u0010[\u001a\u00020\u001d2\n\b\u0002\u0010\\\u001a\u0004\u0018\u00010\b¢\u0006\u0002\u0010]\u001a\u001c\u0010^\u001a\u000202*\n\u0012\u0002\b\u0003\u0012\u0002\b\u00030Z2\b\b\u0002\u0010[\u001a\u00020\u001d\u001a&\u0010_\u001a\u000202*\n\u0012\u0002\b\u0003\u0012\u0002\b\u00030Z2\b\b\u0002\u0010[\u001a\u00020\u001d2\b\b\u0002\u0010\\\u001a\u00020\b\u001a*\u0010`\u001a\u000202*\u00020!2\u0006\u0010a\u001a\u00020\b2\u0006\u0010b\u001a\u00020\b2\u0006\u0010c\u001a\u00020\b2\u0006\u0010d\u001a\u00020\b\u001a/\u0010e\u001a\n g*\u0004\u0018\u00010f0f*\u00020!2\n\b\u0002\u0010h\u001a\u0004\u0018\u00010\b2\n\b\u0002\u0010i\u001a\u0004\u0018\u00010\b¢\u0006\u0002\u0010j\u001al\u0010k\u001a\u000202\"\n\b\u0000\u0010C\u0018\u0001*\u00020@*\u00020D2.\u0010G\u001a\u0018\u0012\u0014\b\u0001\u0012\u0010\u0012\u0004\u0012\u00020\u001d\u0012\u0006\u0012\u0004\u0018\u00010\u00130I0H\"\u0010\u0012\u0004\u0012\u00020\u001d\u0012\u0006\u0012\u0004\u0018\u00010\u00130I2\u0019\b\u0006\u0010l\u001a\u0013\u0012\u0004\u0012\u00020B\u0012\u0004\u0012\u0002020m¢\u0006\u0002\bnH\u0086\bø\u0001\u0000¢\u0006\u0002\u0010o\u001aJ\u0010p\u001a\u00020q*\u00020\b2\b\b\u0002\u0010r\u001a\u00020s2\u0014\b\u0002\u0010t\u001a\u000e\u0012\u0004\u0012\u00020\b\u0012\u0004\u0012\u0002020m2\u000e\b\u0002\u0010u\u001a\b\u0012\u0004\u0012\u0002020v2\u000e\b\u0002\u0010w\u001a\b\u0012\u0004\u0012\u0002020v\u001a\n\u0010x\u001a\u000202*\u00020y\u001a\u0011\u0010z\u001a\u00020\u001d*\u0004\u0018\u00010\b¢\u0006\u0002\u0010{\u001a\n\u0010|\u001a\u000202*\u00020\u001d\u001a\n\u0010}\u001a\u000202*\u00020\u001d\u001a\n\u0010~\u001a\u000202*\u00020\u001d\u001a\u0018\u0010\u007f\u001a\u00020\u0005*\u00020D2\t\b\u0002\u0010\u0080\u0001\u001a\u00020\u001dH\u0086\b\"\u0011\u0010\u0000\u001a\u00020\u00018F¢\u0006\u0006\u001a\u0004\b\u0002\u0010\u0003\"\u0011\u0010\u0004\u001a\u00020\u00058F¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0006\"\u0015\u0010\u0007\u001a\u00020\b*\u00020\b8F¢\u0006\u0006\u001a\u0004\b\t\u0010\n\"\u0015\u0010\u000b\u001a\u00020\b*\u00020\b8F¢\u0006\u0006\u001a\u0004\b\f\u0010\n\"\u0017\u0010\r\u001a\u0004\u0018\u00010\u000e*\u00020\b8F¢\u0006\u0006\u001a\u0004\b\u000f\u0010\u0010\"\u0015\u0010\u0011\u001a\u00020\u0012*\u00020\u00138F¢\u0006\u0006\u001a\u0004\b\u0014\u0010\u0015\"\u0015\u0010\u0016\u001a\u00020\u0012*\u00020\u00178F¢\u0006\u0006\u001a\u0004\b\u0018\u0010\u0019\"\u0015\u0010\u001a\u001a\u00020\u0012*\u00020\u00178F¢\u0006\u0006\u001a\u0004\b\u001b\u0010\u0019\"\u0015\u0010\u001c\u001a\u00020\u001d*\u00020\b8F¢\u0006\u0006\u001a\u0004\b\u001e\u0010\u001f\"\u0015\u0010 \u001a\u00020!*\u00020\b8F¢\u0006\u0006\u001a\u0004\b\"\u0010#\"\u0015\u0010$\u001a\u00020\b*\u00020\b8F¢\u0006\u0006\u001a\u0004\b%\u0010\n\"\u0015\u0010&\u001a\u00020\b*\u00020\b8F¢\u0006\u0006\u001a\u0004\b'\u0010\n\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u0081\u0001"}, d2 = {"displayMetrics", "Landroid/util/DisplayMetrics;", "getDisplayMetrics", "()Landroid/util/DisplayMetrics;", "isConnected", "", "()Z", "asColor", "", "getAsColor", "(I)I", "asDimenPx", "getAsDimenPx", "asDrawable", "Landroid/graphics/drawable/Drawable;", "getAsDrawable", "(I)Landroid/graphics/drawable/Drawable;", "asRequestBody", "Lokhttp3/RequestBody;", "", "getAsRequestBody", "(Ljava/lang/Object;)Lokhttp3/RequestBody;", "asRequestBodyImageJpeg", "Ljava/io/File;", "getAsRequestBodyImageJpeg", "(Ljava/io/File;)Lokhttp3/RequestBody;", "asRequestBodyMultipart", "getAsRequestBodyMultipart", "asString", "", "getAsString", "(I)Ljava/lang/String;", "asView", "Landroid/view/View;", "getAsView", "(I)Landroid/view/View;", "dp", "getDp", "sp", "getSp", "compareVersion", "lastVersionName", "spaceView", "width", "height", "asMultipartBodyPart", "Lokhttp3/MultipartBody$Part;", "name", "avatarUrl", "copyToClipboard", "", "dateFormat", "", "type", "(Ljava/lang/Long;Ljava/lang/String;)Ljava/lang/String;", "flowAutoShow", "", "format", "intMin", "intMax", "decMin", "decMax", "(DLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)Ljava/lang/String;", "hideSoftInput", "Landroid/app/Activity;", "intentOf", "Landroid/content/Intent;", "T", "Landroid/content/Context;", "bundle", "Landroid/os/Bundle;", "pairs", "", "Lkotlin/Pair;", "(Landroid/content/Context;[Lkotlin/Pair;)Landroid/content/Intent;", "isEmail", "matchTrafficUnlimited", "(Ljava/lang/Long;)Ljava/lang/String;", "openBrowserUrl", "url", "popupMenu", "Landroidx/appcompat/widget/PopupMenu;", "menuRes", "view", "gravity", "click", "Landroidx/appcompat/widget/PopupMenu$OnMenuItemClickListener;", "removeLinksUnderline", "Landroid/widget/TextView;", "setEmptyView", "Lcom/chad/library/adapter/base/BaseQuickAdapter;", "msg", "icon", "(Lcom/chad/library/adapter/base/BaseQuickAdapter;Ljava/lang/String;Ljava/lang/Integer;)V", "setErrorText", "setErrorView", "setMargin", "l", "t", "r", "b", "setParams", "Landroid/view/ViewGroup$LayoutParams;", "kotlin.jvm.PlatformType", "w", "h", "(Landroid/view/View;Ljava/lang/Integer;Ljava/lang/Integer;)Landroid/view/ViewGroup$LayoutParams;", "startActivity", "block", "Lkotlin/Function1;", "Lkotlin/ExtensionFunctionType;", "(Landroid/content/Context;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)V", "startCountdownCoroutines", "Lkotlinx/coroutines/Job;", "scope", "Lkotlinx/coroutines/CoroutineScope;", "onTick", "onStart", "Lkotlin/Function0;", "onFinish", "textFocusEnd", "Landroid/widget/EditText;", "toPriceShow", "(Ljava/lang/Integer;)Ljava/lang/String;", "toastError", "toastSuccess", "toastWarning", "verify", "realCert", "app_maomaoRelease"}, k = 2, mv = {1, 6, 0}, xi = 48)
public final class ExtKt {
public static final MultipartBody.Part asMultipartBodyPart(File file, String name) {
kotlin.jvm.internal.b.i(file, "<this>");
kotlin.jvm.internal.b.i(name, "name");
MultipartBody.Part.Companion companion = MultipartBody.Part.INSTANCE;
StringBuilder n = android.support.v4.media.b.n("filename=\"");
n.append(file.getName());
return companion.createFormData(name, n.toString(), RequestBody.INSTANCE.create(file, MediaType.INSTANCE.parse("multipart/form-data")));
}
public static final String avatarUrl(String str) {
String substringAfterLast$default;
kotlin.jvm.internal.b.i(str, "<this>");
if (StringsKt.g(str, "qq.com")) {
StringBuilder n = android.support.v4.media.b.n("https://q4.qlogo.cn/g?b=qq&nk=");
substringAfterLast$default = StringsKt__StringsKt.substringAfterLast$default(str, "@", (String) null, 2, (Object) null);
n.append(substringAfterLast$default);
return n.toString();
}
StringBuilder n2 = android.support.v4.media.b.n("https://fdn.geekzu.org/avatar/");
String lowerCase = StringsKt.trim((CharSequence) str).toString().toLowerCase(Locale.ROOT);
kotlin.jvm.internal.b.h(lowerCase, "this as java.lang.String).toLowerCase(Locale.ROOT)");
n2.append(EncryptKt.encryptMD5(lowerCase));
return n2.toString();
}
public static final boolean compareVersion(String str) {
List split$default;
List split$default2;
Integer intOrNull;
Integer intOrNull2;
if (str == null || str.length() == 0) {
return false;
}
split$default = StringsKt__StringsKt.split$default(ENV.APP.VERSION_NAME, new String[]{"."}, false, 0, 6, (Object) null);
split$default2 = StringsKt__StringsKt.split$default(str, new String[]{"."}, false, 0, 6, (Object) null);
int max = Math.max(split$default.size(), split$default2.size());
int i = 0;
while (i < max) {
int intValue = (i >= split$default.size() || (intOrNull2 = StringsKt.toIntOrNull((String) split$default.get(i))) == null) ? 0 : intOrNull2.intValue();
int intValue2 = (i >= split$default2.size() || (intOrNull = StringsKt.toIntOrNull((String) split$default2.get(i))) == null) ? 0 : intOrNull.intValue();
if (intValue < intValue2) {
return true;
}
if (intValue > intValue2) {
return false;
}
i++;
}
return false;
}
public static final void copyToClipboard(String str) {
if (str == null || str.length() == 0) {
toastError("复制失败");
return;
}
try {
Object systemService = MyApp.INSTANCE.getContext().getSystemService("clipboard");
if (systemService == null) {
throw new NullPointerException("null cannot be cast to non-null type android.content.ClipboardManager");
}
((ClipboardManager) systemService).setPrimaryClip(ClipData.newPlainText(str, str));
toastSuccess("已复制");
} catch (Exception unused) {
toastError("复制失败");
}
}
public static final String dateFormat(Long l, String type) {
kotlin.jvm.internal.b.i(type, "type");
return DateUtils.INSTANCE.format(l != null ? l.longValue() : 0L, type);
}
public static String dateFormat$default(Long l, String str, int i, Object obj) {
if ((i & 1) != 0) {
str = DateUtils.FORMAT_TYPE_1;
}
return dateFormat(l, str);
}
public static final String flowAutoShow(double d) {
long j = 1024;
long j2 = j * RealWebSocket.DEFAULT_MINIMUM_DEFLATE_SIZE;
long j5 = j2 * j;
long j6 = j5 * j;
double d2 = j * j6;
if (Math.abs(d) >= d2) {
return android.support.v4.media.a.r(new StringBuilder(), format$default(d / d2, null, null, null, 2, 7, null), "PB");
}
double d5 = j6;
if (Math.abs(d) >= d5) {
return android.support.v4.media.a.r(new StringBuilder(), format$default(d / d5, null, null, null, 2, 7, null), "TB");
}
double d6 = j5;
if (Math.abs(d) >= d6) {
return android.support.v4.media.a.r(new StringBuilder(), format$default(d / d6, null, null, null, 2, 7, null), "GB");
}
double d7 = j2;
if (Math.abs(d) >= d7) {
return android.support.v4.media.a.r(new StringBuilder(), format$default(d / d7, null, null, null, 2, 7, null), "MB");
}
double abs = Math.abs(d);
double d8 = RealWebSocket.DEFAULT_MINIMUM_DEFLATE_SIZE;
return abs >= d8 ? android.support.v4.media.a.r(new StringBuilder(), format$default(d / d8, null, null, null, 2, 7, null), "KB") : android.support.v4.media.a.q(new StringBuilder(), format$default(d, null, null, null, 2, 7, null), 'B');
}
public static final String format(double d, Integer num, Integer num2, Integer num3, Integer num4) {
NumberFormat numberInstance = NumberFormat.getNumberInstance();
if (num != null) {
numberInstance.setMinimumIntegerDigits(num.intValue());
}
if (num2 != null) {
numberInstance.setMaximumIntegerDigits(num2.intValue());
}
if (num3 != null) {
numberInstance.setMinimumFractionDigits(num3.intValue());
}
if (num4 != null) {
numberInstance.setMaximumFractionDigits(num4.intValue());
}
numberInstance.setGroupingUsed(false);
String format = numberInstance.format(d);
kotlin.jvm.internal.b.h(format, "getNumberInstance().appl…ed = false\n}.format(this)");
return format;
}
public static String format$default(double d, Integer num, Integer num2, Integer num3, Integer num4, int i, Object obj) {
if ((i & 1) != 0) {
num = null;
}
if ((i & 2) != 0) {
num2 = null;
}
if ((i & 4) != 0) {
num3 = null;
}
if ((i & 8) != 0) {
num4 = null;
}
return format(d, num, num2, num3, num4);
}
public static final int getAsColor(int i) {
return ContextCompat.getColor(MyApp.INSTANCE.getContext(), i);
}
public static final int getAsDimenPx(int i) {
return MyApp.INSTANCE.getContext().getResources().getDimensionPixelSize(i);
}
public static final Drawable getAsDrawable(int i) {
return ContextCompat.getDrawable(MyApp.INSTANCE.getContext(), i);
}
public static final RequestBody getAsRequestBody(Object obj) {
kotlin.jvm.internal.b.i(obj, "<this>");
return RequestBody.INSTANCE.create(GsonUtils.INSTANCE.getInstance().bean2Json(obj), MediaType.INSTANCE.parse("application/json; charset=utf-8"));
}
public static final RequestBody getAsRequestBodyImageJpeg(File file) {
kotlin.jvm.internal.b.i(file, "<this>");
return RequestBody.INSTANCE.create(file, MediaType.INSTANCE.parse("image/jpeg"));
}
public static final RequestBody getAsRequestBodyMultipart(File file) {
kotlin.jvm.internal.b.i(file, "<this>");
return RequestBody.INSTANCE.create(file, MediaType.INSTANCE.parse("multipart/form-data"));
}
public static final String getAsString(int i) {
String string = MyApp.INSTANCE.getContext().getResources().getString(i);
kotlin.jvm.internal.b.h(string, "MyApp.context.resources.getString(this)");
return string;
}
public static final View getAsView(int i) {
View inflate = LayoutInflater.from(MyApp.INSTANCE.getContext()).inflate(i, (ViewGroup) null);
kotlin.jvm.internal.b.h(inflate, "from(MyApp.context).inflate(this, null)");
return inflate;
}
public static final DisplayMetrics getDisplayMetrics() {
DisplayMetrics displayMetrics = MyApp.INSTANCE.getContext().getResources().getDisplayMetrics();
kotlin.jvm.internal.b.h(displayMetrics, "MyApp.context.resources.displayMetrics");
return displayMetrics;
}
public static final int getDp(int i) {
return (int) ((i * getDisplayMetrics().density) + 0.5f);
}
public static final int getSp(int i) {
return (int) ((i * getDisplayMetrics().scaledDensity) + 0.5f);
}
public static final void hideSoftInput(Activity activity) {
IBinder windowToken;
kotlin.jvm.internal.b.i(activity, "<this>");
Object systemService = activity.getSystemService("input_method");
Objects.requireNonNull(systemService, "null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
InputMethodManager inputMethodManager = (InputMethodManager) systemService;
View currentFocus = activity.getCurrentFocus();
if (currentFocus == null || !inputMethodManager.isActive() || (windowToken = currentFocus.getWindowToken()) == null) {
return;
}
inputMethodManager.hideSoftInputFromWindow(windowToken, 2);
}
public static final <T> Intent intentOf(Context context, Pair<String, ?>... pairs) {
kotlin.jvm.internal.b.i(context, "<this>");
kotlin.jvm.internal.b.i(pairs, "pairs");
BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairs, pairs.length));
kotlin.jvm.internal.b.y();
throw null;
}
public static final boolean isConnected() {
throw new UnsupportedOperationException("Method not decompiled: com.moetor.app.ExtKt.isConnected():boolean");
}
public static final boolean isEmail(String str) {
kotlin.jvm.internal.b.i(str, "<this>");
return StringsKt.c(str, "@") && StringsKt.c(str, ".");
}
public static final String matchTrafficUnlimited(Long l) {
String text;
ControlBean controlData = ConfigHelper.INSTANCE.getInstance().getControlData();
ControlBean.TrafficUnlimited trafficUnlimited = controlData != null ? controlData.getTrafficUnlimited() : null;
if (kotlin.jvm.internal.b.d(l, trafficUnlimited != null ? trafficUnlimited.getValue() : null)) {
return (trafficUnlimited == null || (text = trafficUnlimited.getText()) == null) ? "无限制" : text;
}
return l + " GB";
}
public static final void openBrowserUrl(Context context, String url) {
kotlin.jvm.internal.b.i(context, "<this>");
kotlin.jvm.internal.b.i(url, "url");
context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(url)));
}
public static final PopupMenu popupMenu(Activity activity, int i, View view, int i2, PopupMenu.OnMenuItemClickListener onMenuItemClickListener) {
kotlin.jvm.internal.b.i(activity, "<this>");
kotlin.jvm.internal.b.i(view, "view");
PopupMenu popupMenu = new PopupMenu(activity, view, i2);
popupMenu.getMenuInflater().inflate(i, popupMenu.getMenu());
if (onMenuItemClickListener != null) {
popupMenu.setOnMenuItemClickListener(onMenuItemClickListener);
}
return popupMenu;
}
public static PopupMenu popupMenu$default(Activity activity, int i, View view, int i2, PopupMenu.OnMenuItemClickListener onMenuItemClickListener, int i5, Object obj) {
if ((i5 & 8) != 0) {
onMenuItemClickListener = null;
}
return popupMenu(activity, i, view, i2, onMenuItemClickListener);
}
public static final void removeLinksUnderline(TextView textView) {
kotlin.jvm.internal.b.i(textView, "<this>");
SpannableString spannableString = new SpannableString(textView.getText());
Object[] spans = spannableString.getSpans(0, spannableString.length(), URLSpan.class);
kotlin.jvm.internal.b.h(spans, "spannable.getSpans(0, sp…gth, URLSpan::class.java)");
for (URLSpan uRLSpan : (URLSpan[]) spans) {
final String url = uRLSpan.getURL();
spannableString.setSpan(new URLSpan(url) {
@Override
public void updateDrawState(TextPaint ds) {
kotlin.jvm.internal.b.i(ds, "ds");
super.updateDrawState(ds);
ds.setUnderlineText(false);
ds.setColor(ExtKt.getAsColor(R$color.blue_677));
}
}, spannableString.getSpanStart(uRLSpan), spannableString.getSpanEnd(uRLSpan), 0);
}
textView.setText(spannableString);
}
public static final void setEmptyView(BaseQuickAdapter<?, ?> baseQuickAdapter, String msg, Integer num) {
kotlin.jvm.internal.b.i(baseQuickAdapter, "<this>");
kotlin.jvm.internal.b.i(msg, "msg");
View asView = getAsView(R$layout.view_empty_msg);
((MyTextView) asView.findViewById(R$id.tv_msg)).setText(msg);
if (num != null) {
asView.findViewById(R$id.lav).setAnimation(num.intValue());
} else {
asView.findViewById(R$id.lav).setVisibility(8);
}
baseQuickAdapter.setEmptyView(asView);
}
public static void setEmptyView$default(BaseQuickAdapter baseQuickAdapter, String str, Integer num, int i, Object obj) {
if ((i & 1) != 0) {
str = "请稍候...";
}
if ((i & 2) != 0) {
num = null;
}
setEmptyView(baseQuickAdapter, str, num);
}
public static final void setErrorText(BaseQuickAdapter<?, ?> baseQuickAdapter, String msg) {
kotlin.jvm.internal.b.i(baseQuickAdapter, "<this>");
kotlin.jvm.internal.b.i(msg, "msg");
View asView = getAsView(R$layout.view_empty_text);
((MyTextView) asView.findViewById(R$id.tv)).setText(msg);
baseQuickAdapter.setEmptyView(asView);
}
public static void setErrorText$default(BaseQuickAdapter baseQuickAdapter, String str, int i, Object obj) {
if ((i & 1) != 0) {
str = "无";
}
setErrorText(baseQuickAdapter, str);
}
public static final void setErrorView(BaseQuickAdapter<?, ?> baseQuickAdapter, String msg, int i) {
kotlin.jvm.internal.b.i(baseQuickAdapter, "<this>");
kotlin.jvm.internal.b.i(msg, "msg");
View asView = getAsView(R$layout.view_empty_msg);
((MyTextView) asView.findViewById(R$id.tv_msg)).setText(msg);
asView.findViewById(R$id.lav).setAnimation(i);
baseQuickAdapter.setEmptyView(asView);
}
public static void setErrorView$default(BaseQuickAdapter baseQuickAdapter, String str, int i, int i2, Object obj) {
if ((i2 & 1) != 0) {
str = "未知错误";
}
if ((i2 & 2) != 0) {
i = R$raw.lottie_error;
}
setErrorView(baseQuickAdapter, str, i);
}
public static final void setMargin(View view, int i, int i2, int i5, int i6) {
kotlin.jvm.internal.b.i(view, "<this>");
if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
Objects.requireNonNull(layoutParams, "null cannot be cast to non-null type android.view.ViewGroup.MarginLayoutParams");
((ViewGroup.MarginLayoutParams) layoutParams).setMargins(i, i2, i5, i6);
view.requestLayout();
}
}
public static final ViewGroup.LayoutParams setParams(View view, Integer num, Integer num2) {
kotlin.jvm.internal.b.i(view, "<this>");
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
if (num != null) {
layoutParams.width = num.intValue();
}
if (num2 != null) {
layoutParams.height = num2.intValue();
}
return layoutParams;
}
public static ViewGroup.LayoutParams setParams$default(View view, Integer num, Integer num2, int i, Object obj) {
if ((i & 1) != 0) {
num = null;
}
if ((i & 2) != 0) {
num2 = null;
}
return setParams(view, num, num2);
}
public static final View spaceView(int i, int i2) {
View asView = getAsView(R$layout.view_space);
int i5 = R$id.view;
View findViewById = asView.findViewById(i5);
ViewGroup.LayoutParams layoutParams = asView.findViewById(i5).getLayoutParams();
layoutParams.width = i;
layoutParams.height = i2;
findViewById.setLayoutParams(layoutParams);
return asView;
}
public static final <T extends Activity> void startActivity(Context context, Pair<String, ? extends Object>[] pairs, Function1<? super Intent, Unit> block) {
kotlin.jvm.internal.b.i(context, "<this>");
kotlin.jvm.internal.b.i(pairs, "pairs");
kotlin.jvm.internal.b.i(block, "block");
Pair[] pairArr = (Pair[]) Arrays.copyOf(pairs, pairs.length);
BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairArr, pairArr.length));
kotlin.jvm.internal.b.y();
throw null;
}
public static void startActivity$default(Context context, Pair[] pairs, Function1 block, int i, Object obj) {
if ((i & 2) != 0) {
block = new Function1<Intent, Unit>() {
@Override
public Unit invoke(Intent intent) {
invoke2(intent);
return Unit.INSTANCE;
}
public final void invoke2(Intent intent) {
kotlin.jvm.internal.b.i(intent, "$this$null");
}
};
}
kotlin.jvm.internal.b.i(context, "<this>");
kotlin.jvm.internal.b.i(pairs, "pairs");
kotlin.jvm.internal.b.i(block, "block");
Pair[] pairArr = (Pair[]) Arrays.copyOf(pairs, pairs.length);
BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairArr, pairArr.length));
kotlin.jvm.internal.b.y();
throw null;
}
public static final Job startCountdownCoroutines(int i, CoroutineScope scope, Function1<? super Integer, Unit> onTick, Function0<Unit> onStart, Function0<Unit> onFinish) {
kotlin.jvm.internal.b.i(scope, "scope");
kotlin.jvm.internal.b.i(onTick, "onTick");
kotlin.jvm.internal.b.i(onStart, "onStart");
kotlin.jvm.internal.b.i(onFinish, "onFinish");
return FlowKt.launchIn(FlowKt.onEach(FlowKt.onStart(FlowKt.flowOn(FlowKt.flow(new ExtKt$startCountdownCoroutines$4(i, null)), Dispatchers.getMain()), new ExtKt$startCountdownCoroutines$5(onStart, null)), new ExtKt$startCountdownCoroutines$6(onTick, onFinish, null)), scope);
}
public static Job startCountdownCoroutines$default(int i, CoroutineScope coroutineScope, Function1 function1, Function0 function0, Function0 function02, int i2, Object obj) {
if ((i2 & 1) != 0) {
coroutineScope = CoroutineScopeKt.CoroutineScope(Dispatchers.getMain());
}
if ((i2 & 2) != 0) {
function1 = new Function1<Integer, Unit>() {
@Override
public Unit invoke(Integer num) {
invoke(num.intValue());
return Unit.INSTANCE;
}
public final void invoke(int i5) {
}
};
}
if ((i2 & 4) != 0) {
function0 = new Function0<Unit>() {
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
}
};
}
if ((i2 & 8) != 0) {
function02 = new Function0<Unit>() {
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
}
};
}
return startCountdownCoroutines(i, coroutineScope, function1, function0, function02);
}
public static final void textFocusEnd(EditText editText) {
kotlin.jvm.internal.b.i(editText, "<this>");
editText.setSelection(editText.getEditableText().toString().length());
}
public static final String toPriceShow(Integer num) {
return num == null ? "0.00" : format$default(num.intValue() / 100, null, null, 2, 2, 3, null);
}
public static final void toastError(String str) {
kotlin.jvm.internal.b.i(str, "<this>");
x2.m.b(R$layout.toast_error);
x2.m.a(getDp(100));
x2.m.c(str);
}
public static final void toastSuccess(String str) {
kotlin.jvm.internal.b.i(str, "<this>");
x2.m.b(R$layout.toast_success);
x2.m.a(getDp(100));
x2.m.c(str);
}
public static final void toastWarning(String str) {
kotlin.jvm.internal.b.i(str, "<this>");
x2.m.b(R$layout.toast_warning);
x2.m.a(getDp(100));
x2.m.c(str);
}
public static final boolean verify(Context context, String realCert) {
PackageInfo packageInfo;
CertificateFactory certificateFactory;
X509Certificate x509Certificate;
Certificate generateCertificate;
MessageDigest messageDigest;
kotlin.jvm.internal.b.i(context, "<this>");
kotlin.jvm.internal.b.i(realCert, "realCert");
CertUtils certUtils = CertUtils.INSTANCE;
String str = null;
try {
packageInfo = context.getPackageManager().getPackageInfo(context.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;
}
}
}
return kotlin.jvm.internal.b.d(str2, realCert);
}
public static boolean verify$default(Context context, String realCert, int i, Object obj) {
PackageInfo packageInfo;
CertificateFactory certificateFactory;
X509Certificate x509Certificate;
Certificate generateCertificate;
MessageDigest messageDigest;
if ((i & 1) != 0) {
realCert = Clash.INSTANCE.nativeCertSHA1();
}
kotlin.jvm.internal.b.i(context, "<this>");
kotlin.jvm.internal.b.i(realCert, "realCert");
CertUtils certUtils = CertUtils.INSTANCE;
String str = null;
try {
packageInfo = context.getPackageManager().getPackageInfo(context.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;
}
}
}
return kotlin.jvm.internal.b.d(str2, realCert);
}
public static final <T> Intent intentOf(Context context, Bundle bundle) {
kotlin.jvm.internal.b.i(context, "<this>");
kotlin.jvm.internal.b.i(bundle, "bundle");
kotlin.jvm.internal.b.y();
throw null;
}
}