1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

yeet md5 hash from geyser dump

This commit is contained in:
onebeastchris
2025-11-08 18:01:11 +01:00
parent af04a7aa19
commit 94067d16ed

View File

@@ -85,7 +85,7 @@ public class DumpInfo {
private Object config;
private final Object2IntMap<DeviceOs> userPlatforms;
private final int connectionAttempts;
private final HashInfo hashInfo;
private final String hash;
private final RamInfo ramInfo;
private LogsInfo logsInfo;
private final BootstrapDumpInfo bootstrapInfo;
@@ -118,16 +118,11 @@ public class DumpInfo {
}
}
String md5Hash = "unknown";
String sha256Hash = "unknown";
try {
// https://stackoverflow.com/questions/320542/how-to-get-the-path-of-a-running-jar-file
// https://stackoverflow.com/questions/304268/getting-a-files-md5-checksum-in-java
File file = new File(DumpInfo.class.getProtectionDomain().getCodeSource().getLocation().toURI());
ByteSource byteSource = Files.asByteSource(file);
// Jenkins uses MD5 for its hash - TODO remove
//noinspection UnstableApiUsage,deprecation
md5Hash = byteSource.hash(Hashing.md5()).toString();
//noinspection UnstableApiUsage
sha256Hash = byteSource.hash(Hashing.sha256()).toString();
} catch (Exception e) {
@@ -135,7 +130,7 @@ public class DumpInfo {
e.printStackTrace();
}
}
this.hashInfo = new HashInfo(md5Hash, sha256Hash);
this.hash = sha256Hash;
this.ramInfo = new RamInfo();
@@ -302,9 +297,6 @@ public class DumpInfo {
}
}
public record HashInfo(String md5Hash, String sha256Hash) {
}
public record RamInfo(long free, long total, long max) {
public RamInfo() {
this(Runtime.getRuntime().freeMemory() / MEGABYTE,