正在查看: Spermatid Pro v6.4.3 应用的 e.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Spermatid Pro v6.4.3 应用的 e.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package dc;
import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import androidx.annotation.NonNull;
import com.hailiang.advlib.core.QMConfig;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.json.JSONObject;
public class e {
public static String a;
public static e a() {
return b.a;
}
public static String b(@NonNull Context context) {
if (!TextUtils.isEmpty(a)) {
return a;
}
String b = com.hailiang.advlib.common.e.b(context);
a = b;
return b;
}
public static String c(Context context, String str, String str2, String str3) throws IOException {
long currentTimeMillis = System.currentTimeMillis();
URLConnection openConnection = new URL(str).openConnection();
try {
File file = new File(str2 + "/" + str3);
String a2 = (file.exists() && Build.VERSION.SDK_INT == 33) ? com.hailiang.advlib.common.e.a(new FileInputStream(file), 0, -1) : "";
File file2 = new File(str2 + "/" + d(str3));
g(file2);
file2.createNewFile();
FileOutputStream fileOutputStream = new FileOutputStream(file2);
InputStream inputStream = openConnection.getInputStream();
if (str.endsWith(".jar")) {
com.hailiang.advlib.common.e.a(inputStream, fileOutputStream);
} else {
com.hailiang.advlib.common.e.b(inputStream, fileOutputStream);
}
inputStream.close();
fileOutputStream.flush();
fileOutputStream.close();
if (!k(file2)) {
com.hailiang.advlib.common.d.a(context, "NOT_MATCH", str, System.currentTimeMillis() - currentTimeMillis);
g(file2);
try {
if (openConnection instanceof HttpURLConnection) {
if (((HttpURLConnection) openConnection).getErrorStream() != null) {
((HttpURLConnection) openConnection).getErrorStream().close();
}
((HttpURLConnection) openConnection).disconnect();
}
} catch (Throwable unused) {
}
return "";
}
if (Build.VERSION.SDK_INT != 33) {
h(file, file2);
com.hailiang.advlib.common.d.a(context, "FINISH", str, System.currentTimeMillis() - currentTimeMillis);
String str4 = str2 + str3;
try {
if (openConnection instanceof HttpURLConnection) {
if (((HttpURLConnection) openConnection).getErrorStream() != null) {
((HttpURLConnection) openConnection).getErrorStream().close();
}
((HttpURLConnection) openConnection).disconnect();
}
} catch (Throwable unused2) {
}
return str4;
}
if (!i(a2, file2)) {
g(file2);
com.hailiang.advlib.common.d.a(context, "READ_FILE", str, System.currentTimeMillis() - currentTimeMillis);
try {
if (openConnection instanceof HttpURLConnection) {
if (((HttpURLConnection) openConnection).getErrorStream() != null) {
((HttpURLConnection) openConnection).getErrorStream().close();
}
((HttpURLConnection) openConnection).disconnect();
}
} catch (Throwable unused3) {
}
return "";
}
h(file, file2);
com.hailiang.advlib.common.d.a(context, "FINISH", str, System.currentTimeMillis() - currentTimeMillis);
String str5 = str2 + str3;
try {
if (openConnection instanceof HttpURLConnection) {
if (((HttpURLConnection) openConnection).getErrorStream() != null) {
((HttpURLConnection) openConnection).getErrorStream().close();
}
((HttpURLConnection) openConnection).disconnect();
}
} catch (Throwable unused4) {
}
return str5;
} catch (Throwable th) {
if (openConnection != null) {
try {
if (openConnection instanceof HttpURLConnection) {
if (((HttpURLConnection) openConnection).getErrorStream() != null) {
((HttpURLConnection) openConnection).getErrorStream().close();
}
((HttpURLConnection) openConnection).disconnect();
}
} catch (Throwable unused5) {
}
}
throw th;
}
}
public static String d(String str) {
return "temp_" + str;
}
public static void g(File file) {
if (file == null || !file.exists()) {
return;
}
file.delete();
}
public static void h(File file, File file2) {
if (file.exists()) {
file.delete();
}
file2.renameTo(file);
if (Build.VERSION.SDK_INT >= 34) {
file.setReadOnly();
}
}
public static boolean i(String str, File file) {
if (TextUtils.isEmpty(str)) {
return true;
}
try {
return !str.equals(com.hailiang.advlib.common.e.a(new FileInputStream(file), 0, -1));
} catch (Throwable unused) {
return true;
}
}
public static boolean k(@NonNull File file) throws IOException {
ZipFile zipFile;
try {
zipFile = new ZipFile(file);
try {
Enumeration<? extends ZipEntry> entries = zipFile.entries();
boolean z = false;
boolean z2 = false;
while (entries.hasMoreElements()) {
ZipEntry nextElement = entries.nextElement();
if (nextElement.getName().equals("androidx.temp")) {
z = true;
} else if (nextElement.getName().equals("android.temp")) {
z2 = true;
}
if (!z || !z2) {
}
}
try {
zipFile.close();
} catch (IOException unused) {
}
boolean a2 = com.hailiang.advlib.common.e.a();
return a2 == z || (a2 ^ true) == z2;
} catch (Throwable th) {
th = th;
if (zipFile != null) {
try {
zipFile.close();
} catch (IOException unused2) {
}
}
throw th;
}
} catch (Throwable th2) {
th = th2;
zipFile = null;
}
}
public final JSONObject e(Context context, QMConfig qMConfig) {
FileInputStream fileInputStream;
String str;
File file = new File(f.f + "/" + f.b);
try {
if (file.length() > 0) {
fileInputStream = new FileInputStream(file);
try {
str = com.hailiang.advlib.common.e.a(fileInputStream, 0, -1);
} catch (Throwable th) {
th = th;
try {
th.printStackTrace();
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (Throwable th2) {
th2.printStackTrace();
}
}
return null;
} finally {
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (Throwable th3) {
th3.printStackTrace();
}
}
}
}
} else {
str = "";
fileInputStream = null;
}
String str2 = Build.VERSION.RELEASE;
if (str2 == null) {
throw new IllegalStateException();
}
String str3 = Build.BRAND;
String str4 = Build.MODEL;
String packageName = context.getPackageName();
String b = b(context);
if (TextUtils.isEmpty(b)) {
return null;
}
JSONObject jSONObject = new JSONObject();
String p = f.p(context);
Log.d("cold_start", "value=" + p);
jSONObject.put("current_md5", str).put("brand", str3).put("model", str4).put("sdk_version", "3.470.13.436").put("os_version", str2).put("package_name", packageName).put("app_version", b).put("local_version", f.m).put("remote_version", f.n).put("is_androidx", String.valueOf(com.hailiang.advlib.common.e.a())).put("load_version", f.o).put("lib_pkg_name", c.a()).put("dda", URLEncoder.encode(Base64.encodeToString(p.getBytes(), 0)));
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (Throwable th4) {
th4.printStackTrace();
}
}
return jSONObject;
} catch (Throwable th5) {
th = th5;
fileInputStream = null;
}
}
public void f(com.hailiang.advlib.core.QMConfig r9) {
throw new UnsupportedOperationException("Method not decompiled: dc.e.f(com.hailiang.advlib.core.QMConfig):void");
}
public void j(QMConfig qMConfig) {
com.hailiang.advlib.common.d.a(new a(this, qMConfig));
}
public e() {
}
}