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