涩里番 v4.2版本的 MD5 值为:b7af51031b798a68c7a3a9ba5a0dff66
以下内容为反编译后的 g.java 源代码,内容仅作参考
package v2;
import af.j;
import android.app.Activity;
import android.app.ActivityManager;
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.net.Uri;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import com.alibaba.fastjson.asm.Opcodes;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.net.URLDecoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.security.interfaces.RSAPublicKey;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import n2.a;
import org.conscrypt.EvpMdRef;
import org.json.JSONObject;
public final class g {
public static final String[] f15846a = {"10.1.5.1013151", "10.1.5.1013148"};
public static class a implements Runnable {
public final Activity f15847i;
public a(Activity activity) {
this.f15847i = activity;
}
@Override
public final void run() {
this.f15847i.finish();
}
}
public static final class b {
public final PackageInfo f15848a;
public final int f15849b;
public final String f15850c;
public b(PackageInfo packageInfo, int i2, String str) {
this.f15848a = packageInfo;
this.f15849b = i2;
this.f15850c = str;
}
public final boolean a() {
return this.f15848a.versionCode < this.f15849b;
}
public final boolean b(t2.a aVar) {
Signature[] signatureArr = this.f15848a.signatures;
if (signatureArr == null || signatureArr.length == 0) {
return false;
}
for (Signature signature : signatureArr) {
String d10 = g.d(aVar, signature.toByteArray());
if (d10 != null && !TextUtils.equals(d10, this.f15850c)) {
l2.a.c(aVar, "biz", "PublicKeyUnmatch", String.format("Got %s, expected %s", d10, this.f15850c));
return true;
}
}
return false;
}
}
public static String a(int i2) {
Random random = new Random();
StringBuilder sb2 = new StringBuilder();
for (int i10 = 0; i10 < i2; i10++) {
int nextInt = random.nextInt(3);
if (nextInt == 0) {
sb2.append(String.valueOf((char) Math.round((Math.random() * 25.0d) + 65.0d)));
} else if (nextInt == 1) {
sb2.append(String.valueOf((char) Math.round((Math.random() * 25.0d) + 97.0d)));
} else if (nextInt == 2) {
sb2.append(String.valueOf(new Random().nextInt(10)));
}
}
return sb2.toString();
}
public static String b(Context context, String str) {
String str2 = "";
try {
String str3 = "";
for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : ((ActivityManager) context.getApplicationContext().getSystemService("activity")).getRunningAppProcesses()) {
if (runningAppProcessInfo.processName.equals(str)) {
str3 = str3 + "#M";
} else {
if (runningAppProcessInfo.processName.startsWith(str + ":")) {
StringBuilder sb2 = new StringBuilder();
sb2.append(str3);
sb2.append("#");
sb2.append(runningAppProcessInfo.processName.replace(str + ":", ""));
str3 = sb2.toString();
}
}
}
str2 = str3;
} catch (Throwable unused) {
}
if (str2.length() > 0) {
str2 = str2.substring(1);
}
return str2.length() == 0 ? "N" : str2;
}
public static String c(String str, String str2, String str3) {
try {
int indexOf = str3.indexOf(str) + str.length();
if (indexOf <= str.length()) {
return "";
}
int indexOf2 = TextUtils.isEmpty(str2) ? 0 : str3.indexOf(str2, indexOf);
if (indexOf2 < 1) {
return str3.substring(indexOf);
}
return str3.substring(indexOf, indexOf2);
} catch (Throwable unused) {
return "";
}
}
public static String d(t2.a aVar, 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 e10) {
l2.a.d(aVar, "auth", "GetPublicKeyFromSignEx", e10);
return null;
}
}
public static Map<String, String> e(t2.a aVar, String str) {
String[] split;
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), h(aVar, str2.substring(indexOf2 + 1)));
}
}
}
return hashMap;
}
public static b f(t2.a aVar, Context context, List<a.b> list) {
PackageInfo packageInfo;
String str;
if (list == null) {
return null;
}
for (a.b bVar : list) {
if (bVar != null) {
String str2 = bVar.f11846a;
int i2 = bVar.f11847b;
String str3 = bVar.f11848c;
try {
packageInfo = context.getPackageManager().getPackageInfo(str2, Opcodes.CHECKCAST);
} catch (Throwable th) {
l2.a.c(aVar, "auth", "GetPackageInfoEx", th.getMessage());
packageInfo = null;
}
boolean z10 = 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 {
z10 = true;
str = "";
}
}
if (!z10) {
l2.a.c(aVar, "auth", "NotIncludeSignatures", str);
}
b bVar2 = (z10 && packageInfo != null) ? new b(packageInfo, i2, str3) : null;
if (bVar2 != null && !bVar2.b(aVar) && !bVar2.a()) {
return bVar2;
}
}
}
return null;
}
public static boolean g(t2.a aVar, String str, Activity activity) {
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())) {
if (!TextUtils.equals(str, "sdklite://h5quit") && !TextUtils.equals(str, "http://m.alipay.com/?action=h5quit")) {
if (str.startsWith("sdklite://h5quit?result=")) {
try {
String substring2 = str.substring(str.indexOf("sdklite://h5quit?result=") + 24);
parseInt = Integer.parseInt(substring2.substring(substring2.lastIndexOf("&end_code=") + 10));
} catch (Exception unused) {
int t10 = g.c.t(4001);
o.d.f12758n = o.d.h(g.c.w(t10), g.c.x(t10), "");
}
if (parseInt != 9000 && parseInt != 8000) {
int t11 = g.c.t(4000);
o.d.f12758n = o.d.h(g.c.w(t11), g.c.x(t11), "");
activity.runOnUiThread(new a(activity));
return true;
}
if (z2.b.f18306k) {
StringBuilder sb2 = 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;
sb2.append(str2);
sb2.append("&return_url=");
sb2.append(decode.substring(indexOf, decode.indexOf("&", indexOf)));
sb2.append(decode.substring(decode.indexOf("&", indexOf)));
substring = sb2.toString();
} else {
String decode3 = URLDecoder.decode(str);
substring = decode3.substring(decode3.indexOf("sdklite://h5quit?result=") + 24, decode3.lastIndexOf("&end_code="));
}
int t12 = g.c.t(parseInt);
o.d.f12758n = o.d.h(g.c.w(t12), g.c.x(t12), substring);
activity.runOnUiThread(new a(activity));
return true;
}
return false;
}
o.d.f12758n = o.d.o();
activity.finish();
return true;
}
try {
b f10 = f(aVar, activity, k2.e.f10192d);
if (f10 != null && !f10.a() && !f10.b(aVar)) {
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 unused2) {
}
return true;
}
public static String h(t2.a aVar, String str) {
try {
return URLDecoder.decode(str, "utf-8");
} catch (UnsupportedEncodingException e10) {
l2.a.d(aVar, "biz", "H5PayDataAnalysisError", e10);
return "";
}
}
public static Map<String, String> i(String str) {
String[] split;
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 boolean j(Context context) {
String str;
try {
PackageManager packageManager = context.getPackageManager();
try {
str = k2.e.f10192d.get(0).f11846a;
} catch (Throwable unused) {
str = "com.eg.android.AlipayGphone";
}
PackageInfo packageInfo = packageManager.getPackageInfo(str, 128);
if (packageInfo == null) {
return false;
}
return packageInfo.versionCode < 99;
} catch (Throwable th) {
n.b.e(th);
return false;
}
}
public static boolean k(t2.a aVar, Context context, List<a.b> list) {
try {
for (a.b bVar : list) {
if (bVar != null) {
try {
if (context.getPackageManager().getPackageInfo(bVar.f11846a, 128) != null) {
return true;
}
} catch (PackageManager.NameNotFoundException unused) {
continue;
}
}
}
return false;
} catch (Throwable th) {
l2.a.d(aVar, "biz", "CheckLaunchAppExistEx", th);
return false;
}
}
public static String l() {
String str = "Unavailable";
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader("/proc/version"), 256);
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 (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 j.n("Linux ", str);
}
public static JSONObject m(String str) {
try {
return new JSONObject(str);
} catch (Throwable unused) {
return new JSONObject();
}
}
public static String n(Context context) {
DisplayMetrics displayMetrics = new DisplayMetrics();
((WindowManager) context.getApplicationContext().getSystemService("window")).getDefaultDisplay().getMetrics(displayMetrics);
return displayMetrics.widthPixels + "*" + displayMetrics.heightPixels;
}
public static String o(String str) {
try {
Uri parse = Uri.parse(str);
return String.format("%s%s", parse.getAuthority(), parse.getPath());
} catch (Throwable th) {
n.b.e(th);
return "-";
}
}
public static String p(String str) {
try {
MessageDigest messageDigest = MessageDigest.getInstance(EvpMdRef.MD5.JCA_NAME);
messageDigest.update(str.getBytes());
byte[] digest = messageDigest.digest();
StringBuilder sb2 = new StringBuilder(digest.length * 2);
for (byte b10 : digest) {
sb2.append(Character.forDigit((b10 & 240) >> 4, 16));
sb2.append(Character.forDigit(b10 & 15, 16));
}
return sb2.toString();
} catch (NoSuchAlgorithmException unused) {
return "";
}
}
}