正在查看: 品质商城 v1.0 应用的 AbstractC0318b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 品质商城 v1.0 应用的 AbstractC0318b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package m0;
import A0.c;
import M0.j;
import android.app.Activity;
import android.app.Application;
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.Typeface;
import android.net.Uri;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Base64;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import g.C0179a;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.net.URL;
import java.net.URLDecoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.security.interfaces.RSAPublicKey;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import k0.AbstractC0309b;
import q0.AbstractC0346a;
import s0.C0355a;
import s0.d;
import u0.AbstractC0366a;
import w0.e;
import w0.f;
public abstract class AbstractC0318b {
public static String f4264a = "";
public static String f4265b = "";
public static String f4266c = "";
public static final String[] f4267d = {"10.1.5.1013151", "10.1.5.1013148"};
public static final char[] f4268e = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '+', '/'};
public static String a(int i2) {
Random random = new Random();
StringBuilder sb = new StringBuilder();
for (int i3 = 0; i3 < i2; i3++) {
int nextInt = random.nextInt(3);
if (nextInt == 0) {
sb.append(String.valueOf((char) Math.round((Math.random() * 25.0d) + 65.0d)));
} else if (nextInt == 1) {
sb.append(String.valueOf((char) Math.round((Math.random() * 25.0d) + 97.0d)));
} else if (nextInt == 2) {
sb.append(String.valueOf(new Random().nextInt(10)));
}
}
return sb.toString();
}
public static String b(K0.b bVar, byte[] bArr) {
BigInteger modulus;
try {
PublicKey publicKey = ((X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(new ByteArrayInputStream(bArr))).getPublicKey();
if (!(publicKey instanceof RSAPublicKey) || (modulus = ((RSAPublicKey) publicKey).getModulus()) == null) {
return null;
}
return modulus.toString(16);
} catch (Exception e2) {
f.f(bVar, "auth", "GetPublicKeyFromSignEx", e2);
return null;
}
}
public static String c(Context context, K0.b bVar) {
try {
String h2 = j.h(context, bVar, "alipay_cashier_ap_fi", "");
if (!TextUtils.isEmpty(h2)) {
return h2;
}
try {
byte[] bArr = (byte[]) C0355a.c("FU", System.currentTimeMillis(), new d(), (short) 0, new M0.b()).f136a;
SecureRandom secureRandom = AbstractC0346a.f4741a;
j.l(context, bVar, "alipay_cashier_ap_fi", Base64.encodeToString(bArr, 3));
String h3 = j.h(context, bVar, "alipay_cashier_ap_fi", "");
if (!TextUtils.isEmpty(h3)) {
return h3;
}
f.o(bVar, "biz", "e_regen_empty", "");
return "";
} catch (Exception e2) {
f.o(bVar, "biz", "e_gen", e2.getClass().getSimpleName());
return "";
}
} catch (Exception e3) {
f.f(bVar, "biz", "e_gen_err", e3);
return "";
}
}
public static String d(String str, String str2, String str3) {
try {
int indexOf = str3.indexOf(str) + str.length();
if (indexOf <= str.length()) {
return "";
}
int indexOf2 = !TextUtils.isEmpty(str2) ? str3.indexOf(str2, indexOf) : 0;
return indexOf2 < 1 ? str3.substring(indexOf) : str3.substring(indexOf, indexOf2);
} catch (Throwable unused) {
return "";
}
}
public static String e(byte[] bArr) {
StringBuilder sb = new StringBuilder(bArr.length * 2);
for (byte b2 : bArr) {
sb.append(Character.forDigit((b2 & 240) >> 4, 16));
sb.append(Character.forDigit(b2 & 15, 16));
}
return sb.toString();
}
public static y.d f(K0.b bVar, Context context, List list) {
PackageInfo packageInfo;
String str;
if (list == null) {
return null;
}
Iterator it = list.iterator();
while (it.hasNext()) {
A0.b bVar2 = (A0.b) it.next();
if (bVar2 != null) {
boolean m2 = AbstractC0309b.m();
String str2 = bVar2.f5a;
if (m2 && "com.eg.android.AlipayGphone".equals(str2)) {
str2 = "com.eg.android.AlipayGphoneRC";
}
try {
packageInfo = context.getPackageManager().getPackageInfo(str2, 192);
} catch (Throwable th) {
f.o(bVar, "auth", "GetPackageInfoEx", th.getMessage());
packageInfo = null;
}
boolean z2 = false;
if (packageInfo == null) {
str = "info == null";
} else {
Signature[] signatureArr = packageInfo.signatures;
if (signatureArr == null) {
str = "info.signatures == null";
} else if (signatureArr.length <= 0) {
str = "info.signatures.length <= 0";
} else {
str = "";
z2 = true;
}
}
if (!z2) {
f.o(bVar, "auth", "NotIncludeSignatures", str);
}
y.d dVar = (z2 && packageInfo != null) ? new y.d(packageInfo, bVar2.f6b, bVar2.f7c) : null;
if (dVar != null && !dVar.e(bVar) && !dVar.d()) {
return dVar;
}
}
}
return null;
}
public static void g(Activity activity, K0.b bVar, String str) {
if (activity == null || TextUtils.isEmpty("alipaySdk") || TextUtils.isEmpty(str)) {
return;
}
if (bVar != null) {
String str2 = bVar.f348g;
if (!TextUtils.isEmpty(str2) && str2.toLowerCase().contains("auth")) {
return;
}
}
if (c.a().f36y) {
try {
Intent intent = new Intent("android.app.intent.action.APP_EXCEPTION_OCCUR");
intent.putExtra("bizType", "alipaySdk");
intent.putExtra("exName", str);
intent.setPackage(activity.getPackageName());
activity.sendBroadcast(intent);
f.e(bVar, "biz", "AppNotify", "alipaySdk|".concat(str));
} catch (Exception unused) {
}
}
}
public static synchronized void h(Throwable th) {
String str;
synchronized (AbstractC0318b.class) {
try {
ArrayList arrayList = new ArrayList();
if (th != null) {
StringWriter stringWriter = new StringWriter();
th.printStackTrace(new PrintWriter(stringWriter));
str = stringWriter.toString();
} else {
str = "";
}
arrayList.add(str);
i(arrayList);
} catch (Throwable th2) {
throw th2;
}
}
}
public static synchronized void i(ArrayList arrayList) {
synchronized (AbstractC0318b.class) {
try {
if (!e.e(f4265b) && !e.e(f4266c)) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(f4266c);
Iterator it = arrayList.iterator();
while (it.hasNext()) {
stringBuffer.append(", " + ((String) it.next()));
}
stringBuffer.append("\n");
try {
File file = new File(f4264a);
if (!file.exists()) {
file.mkdirs();
}
File file2 = new File(f4264a, f4265b);
if (!file2.exists()) {
file2.createNewFile();
}
FileWriter fileWriter = ((long) stringBuffer.length()) + file2.length() <= 51200 ? new FileWriter(file2, true) : new FileWriter(file2);
fileWriter.write(stringBuffer.toString());
fileWriter.flush();
fileWriter.close();
} catch (Exception unused) {
}
}
} catch (Throwable th) {
throw th;
}
}
}
public static boolean j(K0.b bVar, Context context, List list, boolean z2) {
try {
Iterator it = list.iterator();
while (it.hasNext()) {
A0.b bVar2 = (A0.b) it.next();
if (bVar2 != null) {
String str = bVar2.f5a;
if (AbstractC0309b.m() && "com.eg.android.AlipayGphone".equals(str)) {
str = "com.eg.android.AlipayGphoneRC";
}
try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(str, 128);
if (packageInfo != null) {
if (!z2) {
return true;
}
f.e(bVar, "biz", "PgWltVer", packageInfo.packageName + "|" + packageInfo.versionName);
return true;
}
continue;
} catch (PackageManager.NameNotFoundException unused) {
continue;
}
}
}
return false;
} catch (Throwable th) {
f.f(bVar, "biz", "CheckLaunchAppExistEx", th);
return false;
}
}
public static boolean k(K0.b bVar, String str) {
try {
String host = new URL(str).getHost();
if (host.endsWith("alipay.com")) {
return true;
}
return host.endsWith("alipay.net");
} catch (Throwable th) {
f.f(bVar, "biz", "ckUrlErr", th);
return false;
}
}
public static boolean l(Activity activity, K0.b bVar, String str) {
int parseInt;
String substring;
if (TextUtils.isEmpty(str)) {
return true;
}
if (str.toLowerCase().startsWith("alipays://platformapi/startApp?".toLowerCase()) || str.toLowerCase().startsWith("intent://platformapi/startapp?".toLowerCase())) {
try {
y.d f2 = f(bVar, activity, AbstractC0366a.f5055d);
if (f2 != null && !f2.d() && !f2.e(bVar)) {
if (str.startsWith("intent://platformapi/startapp")) {
str = str.replaceFirst("intent://platformapi/startapp\\?", "alipays://platformapi/startApp?");
}
activity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
}
} catch (Throwable unused) {
}
return true;
}
if (TextUtils.equals(str, "sdklite://h5quit") || TextUtils.equals(str, "http://m.alipay.com/?action=h5quit")) {
w0.c.f5357e = w0.c.a();
activity.finish();
return true;
}
if (!str.startsWith("sdklite://h5quit?result=")) {
return false;
}
try {
String substring2 = str.substring(str.indexOf("sdklite://h5quit?result=") + 24);
parseInt = Integer.parseInt(substring2.substring(substring2.lastIndexOf("&end_code=") + 10));
} catch (Exception unused2) {
int b2 = I0.a.b(4001);
w0.c.f5357e = w0.c.b(I0.a.g(b2), I0.a.i(b2), "");
}
if (parseInt != 9000 && parseInt != 8000) {
int b3 = I0.a.b(4000);
w0.c.f5357e = w0.c.b(I0.a.g(b3), I0.a.i(b3), "");
activity.runOnUiThread(new g0.b(activity, 1));
return true;
}
if (w0.d.f5360c) {
StringBuilder sb = new StringBuilder();
String decode = URLDecoder.decode(str);
String decode2 = URLDecoder.decode(decode);
String str2 = decode2.substring(decode2.indexOf("sdklite://h5quit?result=") + 24, decode2.lastIndexOf("&end_code=")).split("&return_url=")[0];
int indexOf = decode.indexOf("&return_url=") + 12;
sb.append(str2);
sb.append("&return_url=");
sb.append(decode.substring(indexOf, decode.indexOf("&", indexOf)));
sb.append(decode.substring(decode.indexOf("&", indexOf)));
substring = sb.toString();
} else {
String decode3 = URLDecoder.decode(str);
substring = decode3.substring(decode3.indexOf("sdklite://h5quit?result=") + 24, decode3.lastIndexOf("&end_code="));
}
int b4 = I0.a.b(parseInt);
w0.c.f5357e = w0.c.b(I0.a.g(b4), I0.a.i(b4), substring);
activity.runOnUiThread(new g0.b(activity, 1));
return true;
}
public static String m() {
if (AbstractC0309b.m()) {
return "com.eg.android.AlipayGphoneRC";
}
try {
return ((A0.b) AbstractC0366a.f5055d.get(0)).f5a;
} catch (Throwable unused) {
return "com.eg.android.AlipayGphone";
}
}
public static HashMap n(K0.b bVar, String str) {
HashMap hashMap = new HashMap(4);
int indexOf = str.indexOf(63);
if (indexOf != -1 && indexOf < str.length() - 1) {
for (String str2 : str.substring(indexOf + 1).split("&")) {
int indexOf2 = str2.indexOf(61, 1);
if (indexOf2 != -1 && indexOf2 < str2.length() - 1) {
hashMap.put(str2.substring(0, indexOf2), r(bVar, str2.substring(indexOf2 + 1)));
}
}
}
return hashMap;
}
public static HashMap o(String str) {
HashMap hashMap = new HashMap();
for (String str2 : str.split("&")) {
int indexOf = str2.indexOf("=", 1);
if (-1 != indexOf) {
hashMap.put(str2.substring(0, indexOf), URLDecoder.decode(str2.substring(indexOf + 1)));
}
}
return hashMap;
}
public static int p(String str) {
try {
String str2 = c.a().f28q;
if (TextUtils.isEmpty(str2)) {
return 0;
}
String string = Settings.Secure.getString(((Application) C0179a.c().f3332a).getContentResolver(), str2);
return ((string != null ? string : "").contains(str) ? 2 : 0) | 1;
} catch (Throwable unused) {
return 61440;
}
}
public static String q() {
String str = "Unavailable";
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader("/proc/version"), 256);
try {
String readLine = bufferedReader.readLine();
bufferedReader.close();
Matcher matcher = Pattern.compile("\\w+\\s+\\w+\\s+([^\\s]+)\\s+\\(([^\\s@]+(?:@[^\\s.]+)?)[^)]*\\)\\s+\\((?:[^(]*\\([^)]*\\))?[^)]*\\)\\s+([^\\s]+)\\s+(?:PREEMPT\\s+)?(.+)").matcher(readLine);
if (matcher.matches() && matcher.groupCount() >= 4) {
str = matcher.group(1) + "\n" + matcher.group(2) + " " + matcher.group(3) + "\n" + matcher.group(4);
}
} catch (Throwable th) {
bufferedReader.close();
throw th;
}
} catch (IOException unused) {
}
int indexOf = str.indexOf("-");
if (indexOf != -1) {
str = str.substring(0, indexOf);
}
int indexOf2 = str.indexOf("\n");
if (indexOf2 != -1) {
str = str.substring(0, indexOf2);
}
return "Linux " + str;
}
public static String r(K0.b bVar, String str) {
try {
return URLDecoder.decode(str, "utf-8");
} catch (UnsupportedEncodingException e2) {
f.f(bVar, "biz", "H5PayDataAnalysisError", e2);
return "";
}
}
public static String s(Context context) {
DisplayMetrics displayMetrics = new DisplayMetrics();
((WindowManager) context.getApplicationContext().getSystemService("window")).getDefaultDisplay().getMetrics(displayMetrics);
return displayMetrics.widthPixels + "*" + displayMetrics.heightPixels;
}
public static String t(String str) {
String e2;
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(str.getBytes());
byte[] digest = messageDigest.digest();
if (digest.length > 16) {
byte[] bArr = new byte[16];
System.arraycopy(digest, 0, bArr, 0, 16);
e2 = e(bArr);
} else {
e2 = e(digest);
}
return e2;
} catch (NoSuchAlgorithmException unused) {
return "";
}
}
public static String u(String str) {
try {
Uri parse = Uri.parse(str);
return parse.getAuthority() + parse.getPath();
} catch (Throwable th) {
e.d(th);
return "-";
}
}
public abstract void v(int i2);
public abstract void w(Typeface typeface, boolean z2);
}