mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-03-20 08:08:14 +03:00
Compare commits
No commits in common. "74af58bc7acc7e477d3aef3713ad5ce92611811d" and "9351f3ca1e44afc95be1836b9a3c6fecc5e7f2cf" have entirely different histories.
74af58bc7a
...
9351f3ca1e
6 changed files with 16 additions and 15 deletions
|
@ -29,7 +29,7 @@ public RequestTextureProvider(String skinURL, String cloakURL) {
|
|||
|
||||
private static Texture getTexture(String url, boolean cloak) throws IOException {
|
||||
try {
|
||||
return new Texture(url, cloak, null);
|
||||
return new Texture(url, cloak);
|
||||
} catch (FileNotFoundException ignored) {
|
||||
return null; // Simply not found
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ private static Texture getTexture(String url, boolean cloak) throws IOException
|
|||
|
||||
private static Texture getTexture(String url, Path local, boolean cloak) throws IOException {
|
||||
try {
|
||||
return new Texture(url, local, cloak, null);
|
||||
return new Texture(url, local, cloak);
|
||||
} catch (FileNotFoundException ignored) {
|
||||
return null; // Simply not found
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public final class Texture extends StreamObject {
|
|||
|
||||
public final Map<String, String> metadata;
|
||||
|
||||
public Texture(String url, boolean cloak, Map<String, String> metadata) throws IOException {
|
||||
public Texture(String url, boolean cloak) throws IOException {
|
||||
this.url = IOHelper.verifyURL(url);
|
||||
|
||||
// Fetch texture
|
||||
|
@ -37,25 +37,20 @@ public Texture(String url, boolean cloak, Map<String, String> metadata) throws I
|
|||
}
|
||||
|
||||
// Get digest of texture
|
||||
digest = SecurityHelper.digest(DIGEST_ALGO, texture);
|
||||
this.metadata = metadata; // May be auto-detect?
|
||||
digest = SecurityHelper.digest(DIGEST_ALGO, new URL(url));
|
||||
metadata = null; // May be auto-detect?
|
||||
}
|
||||
|
||||
public Texture(String url, Path local, boolean cloak, Map<String, String> metadata) throws IOException {
|
||||
public Texture(String url, Path local, boolean cloak) throws IOException {
|
||||
this.url = IOHelper.verifyURL(url);
|
||||
byte[] texture;
|
||||
try (InputStream input = IOHelper.newInput(local)) {
|
||||
texture = IOHelper.read(input);
|
||||
}
|
||||
try (ByteArrayInputStream input = new ByteArrayInputStream(texture)) {
|
||||
IOHelper.readTexture(input, cloak); // Verify texture
|
||||
}
|
||||
this.digest = SecurityHelper.digest(DIGEST_ALGO, texture);
|
||||
this.metadata = metadata;
|
||||
this.digest = SecurityHelper.digest(DIGEST_ALGO, local);
|
||||
this.metadata = null;
|
||||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
public Texture(String url, byte[] digest) {
|
||||
this.url = IOHelper.verifyURL(url);
|
||||
this.digest = digest == null ? new byte[0] : digest;
|
||||
|
|
|
@ -20,6 +20,7 @@ public final class JVMHelper {
|
|||
public static final OperatingSystemMXBean OPERATING_SYSTEM_MXBEAN =
|
||||
ManagementFactory.getOperatingSystemMXBean();
|
||||
public static final OS OS_TYPE = OS.byName(OPERATING_SYSTEM_MXBEAN.getName());
|
||||
@Deprecated
|
||||
public static final int OS_BITS = getCorrectOSArch();
|
||||
// System properties
|
||||
public static final String OS_VERSION = OPERATING_SYSTEM_MXBEAN.getVersion();
|
||||
|
@ -137,6 +138,7 @@ public static void checkStackTrace(Class<?> mainClass) {
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private static int getCorrectOSArch() {
|
||||
// As always, mustdie must die
|
||||
if (OS_TYPE == OS.MUSTDIE)
|
||||
|
@ -150,6 +152,7 @@ public static String getEnvPropertyCaseSensitive(String name) {
|
|||
return System.getenv().get(name);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isJVMMatchesSystemArch() {
|
||||
return JVM_BITS == OS_BITS;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ public final class JVMHelper {
|
|||
// System properties
|
||||
public static final String OS_VERSION = OPERATING_SYSTEM_MXBEAN.getVersion();
|
||||
|
||||
@Deprecated
|
||||
public static final int OS_BITS = getCorrectOSArch();
|
||||
|
||||
public static final ARCH ARCH_TYPE = getArch(System.getProperty("os.arch"));
|
||||
|
@ -130,6 +131,7 @@ public static void checkStackTrace(Class<?> mainClass) {
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private static int getCorrectOSArch() {
|
||||
// As always, mustdie must die
|
||||
if (OS_TYPE == OS.MUSTDIE)
|
||||
|
@ -145,6 +147,7 @@ public static String getEnvPropertyCaseSensitive(String name) {
|
|||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
public static boolean isJVMMatchesSystemArch() {
|
||||
return JVM_BITS == OS_BITS;
|
||||
}
|
||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
|||
Subproject commit fc263e19bc73cc7cb0f64c4e78c092c363b6769a
|
||||
Subproject commit 19e9cf3d6ce7148db4374e3736862d52b5854638
|
|
@ -12,7 +12,7 @@
|
|||
verBcpkix = '1.70'
|
||||
verSlf4j = '1.7.36'
|
||||
verLog4j = '2.19.0'
|
||||
verMySQLConn = '8.0.33'
|
||||
verMySQLConn = '8.0.32'
|
||||
verPostgreSQLConn = '42.5.1'
|
||||
verProguard = '7.3.1'
|
||||
verLaunch4j = '3.50'
|
||||
|
|
Loading…
Reference in a new issue