TechWar v1.6.8版本的 MD5 值为:513ba4241f5234b566380e05da0f1813
以下内容为反编译后的 p7c92c359.java 源代码,内容仅作参考
package p54109b83.p40fa73c9;
import arc.Core;
import arc.files.Fi;
import arc.func.Boolf;
import arc.func.Cons;
import arc.func.Func;
import arc.struct.ObjectMap;
import arc.util.Log;
import arc.util.OS;
import arc.util.Strings;
import arc.util.io.PropertiesUtils;
import java.io.File;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import p54109b83.pa74ad8df.p34b6cd75;
import p54109b83.pad148a3c.p198df8d2;
import p54109b83.pb68187da;
public class p7c92c359 {
public static String createReport(String error) {
String sb;
String report = "Mindustry has crashed. How unfortunate.\n";
p198df8d2 p198df8d2Var = pb68187da.mods;
if (p198df8d2Var != null && p198df8d2Var.list().size == 0 && p34b6cd75.build != -1) {
report = "Mindustry has crashed. How unfortunate.\nReport this at https://github.com/Anuken/Mindustry/issues/new?labels=bug&template=bug_report.md\n\n";
}
StringBuilder sb2 = new StringBuilder();
sb2.append(report);
sb2.append("Version: ");
sb2.append(p34b6cd75.combined());
String str = "";
sb2.append(pb68187da.headless ? " (Server)" : "");
sb2.append("\nOS: ");
sb2.append(OS.osName);
sb2.append(" x");
sb2.append(OS.osArchBits);
sb2.append(" (");
sb2.append(OS.osArch);
sb2.append(")\n");
if ((OS.isAndroid || OS.isIos) && Core.app != null) {
str = "Android API level: " + Core.app.getVersion() + "\n";
}
sb2.append(str);
sb2.append("Java Version: ");
sb2.append(OS.javaVersion);
sb2.append("\nRuntime Available Memory: ");
sb2.append((Runtime.getRuntime().maxMemory() / 1024) / 1024);
sb2.append("mb\nCores: ");
sb2.append(Runtime.getRuntime().availableProcessors());
sb2.append("\n");
if (pb68187da.mods == null) {
sb = "<no mod init>";
} else {
StringBuilder sb3 = new StringBuilder();
sb3.append("Mods: ");
sb3.append(!pb68187da.mods.list().contains(new Boolf() {
@Override
public final boolean get(Object obj) {
return ((p198df8d2.p0ae2bbc6) obj).shouldBeEnabled();
}
}) ? "none (vanilla)" : pb68187da.mods.list().select(new Boolf() {
@Override
public final boolean get(Object obj) {
return ((p198df8d2.p0ae2bbc6) obj).shouldBeEnabled();
}
}).toString(", ", new Func() {
@Override
public final Object get(Object obj) {
String lambda$createReport$0;
lambda$createReport$0 = p7c92c359.lambda$createReport$0((p198df8d2.p0ae2bbc6) obj);
return lambda$createReport$0;
}
}));
sb = sb3.toString();
}
sb2.append(sb);
sb2.append("\n\n");
sb2.append(error);
return sb2.toString();
}
public static String lambda$createReport$0(p198df8d2.p0ae2bbc6 mod) {
return mod.name + ":" + mod.meta.version;
}
public static void log(Throwable exception) {
try {
Core.settings.getDataDirectory().child("crashes").child("crash_" + System.currentTimeMillis() + ".txt").writeString(createReport(Strings.neatError(exception)));
} catch (Throwable th) {
}
}
public static void send(Throwable exception, Cons<File> writeListener) {
try {
try {
Log.err(exception);
} catch (Throwable th) {
exception.printStackTrace();
}
try {
Core.settings.manualSave();
} catch (Throwable th2) {
}
if (OS.username.equals("anuke") && !"steam".equals(p34b6cd75.modifier)) {
ret();
}
if (p34b6cd75.number == 0) {
try {
ObjectMap<String, String> map = new ObjectMap<>();
PropertiesUtils.load(map, new InputStreamReader(p7c92c359.class.getResourceAsStream("/version.properties")));
p34b6cd75.type = map.get("type");
p34b6cd75.number = Integer.parseInt(map.get("number"));
p34b6cd75.modifier = map.get("modifier");
if (map.get("build").contains(".")) {
String[] split = map.get("build").split("\\.");
p34b6cd75.build = Integer.parseInt(split[0]);
p34b6cd75.revision = Integer.parseInt(split[1]);
} else {
p34b6cd75.build = Strings.canParseInt(map.get("build")) ? Integer.parseInt(map.get("build")) : -1;
}
} catch (Throwable e) {
e.printStackTrace();
Log.err("Failed to parse version.", new Object[0]);
}
}
try {
File file = new File(OS.getAppDataDirectoryString(pb68187da.appName), "crashes/crash-report-" + new SimpleDateFormat("MM_dd_yyyy_HH_mm_ss").format(new Date()) + ".txt");
new Fi(OS.getAppDataDirectoryString(pb68187da.appName)).child("crashes").mkdirs();
new Fi(file).writeString(createReport(writeException(exception)));
writeListener.get(file);
} catch (Throwable e2) {
Log.err("Failed to save local crash report.", e2);
}
try {
pb68187da.f1net.dispose();
} catch (Throwable th3) {
}
} catch (Throwable death) {
death.printStackTrace();
}
ret();
}
private static void ret() {
System.exit(1);
}
private static String writeException(Throwable e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
return sw.toString();
}
}