mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #30 - Fixed various client bugs
This commit is contained in:
@ -64,7 +64,7 @@ public class RelayUpdateChecker {
|
||||
for(net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry etr : EagRuntime.getConfiguration().getRelays()) {
|
||||
relaysList.add(new RelayEntry(etr.address));
|
||||
}
|
||||
byte[] b = PlatformApplication.getLocalStorage("lastRelayUpdate");
|
||||
byte[] b = PlatformApplication.getLocalStorage("lastRelayUpdate", false);
|
||||
if(b != null) {
|
||||
try {
|
||||
lastUpdateCheck = (new DataInputStream(new EaglerInputStream(b))).readLong();
|
||||
@ -79,7 +79,7 @@ public class RelayUpdateChecker {
|
||||
try {
|
||||
EaglerOutputStream bao = new EaglerOutputStream(8);
|
||||
(new DataOutputStream(bao)).writeLong(lastUpdateCheck);
|
||||
PlatformApplication.setLocalStorage("lastRelayUpdate", bao.toByteArray());
|
||||
PlatformApplication.setLocalStorage("lastRelayUpdate", bao.toByteArray(), false);
|
||||
} catch (IOException e) {
|
||||
}
|
||||
for (int i = 0, l = relaysList.size(); i < l; ++i) {
|
||||
|
@ -148,7 +148,16 @@ public class UpdateCertificate {
|
||||
throw new CertificateInvalidException("SHA256 checksum of signature payload is invalid!");
|
||||
}
|
||||
|
||||
return new UpdateCertificate(certData, EaglerZLIB.newGZIPInputStream(new EaglerInputStream(signaturePayload)), vers);
|
||||
UpdateCertificate cert;
|
||||
try(InputStream gis = EaglerZLIB.newGZIPInputStream(new EaglerInputStream(signaturePayload))) {
|
||||
cert = new UpdateCertificate(certData, gis, vers);
|
||||
}
|
||||
|
||||
if(System.currentTimeMillis() < cert.sigTimestamp) {
|
||||
throw new CertificateInvalidException("Update certificate timestamp is from the future!?");
|
||||
}
|
||||
|
||||
return cert;
|
||||
}
|
||||
|
||||
private UpdateCertificate(byte[] certData, InputStream is, int sigVers) throws IOException {
|
||||
|
@ -94,7 +94,7 @@ public class UpdateService {
|
||||
}
|
||||
}
|
||||
}
|
||||
byte[] latestUpdate = PlatformApplication.getLocalStorage(EaglercraftVersion.updateLatestLocalStorageKey);
|
||||
byte[] latestUpdate = PlatformApplication.getLocalStorage(EaglercraftVersion.updateLatestLocalStorageKey, false);
|
||||
if(latestUpdate != null) {
|
||||
addCertificateToSet(latestUpdate, false);
|
||||
}
|
||||
@ -150,7 +150,7 @@ public class UpdateService {
|
||||
latestUpdateFound = cert;
|
||||
if (saveLatest) {
|
||||
PlatformApplication.setLocalStorage(EaglercraftVersion.updateLatestLocalStorageKey,
|
||||
certificateData);
|
||||
certificateData, false);
|
||||
}
|
||||
}
|
||||
}else if(EagRuntime.getConfiguration().isLogInvalidCerts()) {
|
||||
|
Reference in New Issue
Block a user