mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
Compare commits
5 commits
9351f3ca1e
...
74af58bc7a
Author | SHA1 | Date | |
---|---|---|---|
|
74af58bc7a | ||
|
d97b856ad6 | ||
|
5436b2a2d6 | ||
|
5aa4fe8d47 | ||
|
b10535042f |
6 changed files with 15 additions and 16 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);
|
||||
return new Texture(url, cloak, null);
|
||||
} 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);
|
||||
return new Texture(url, local, cloak, null);
|
||||
} 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) throws IOException {
|
||||
public Texture(String url, boolean cloak, Map<String, String> metadata) throws IOException {
|
||||
this.url = IOHelper.verifyURL(url);
|
||||
|
||||
// Fetch texture
|
||||
|
@ -37,20 +37,25 @@ public Texture(String url, boolean cloak) throws IOException {
|
|||
}
|
||||
|
||||
// Get digest of texture
|
||||
digest = SecurityHelper.digest(DIGEST_ALGO, new URL(url));
|
||||
metadata = null; // May be auto-detect?
|
||||
digest = SecurityHelper.digest(DIGEST_ALGO, texture);
|
||||
this.metadata = metadata; // May be auto-detect?
|
||||
}
|
||||
|
||||
public Texture(String url, Path local, boolean cloak) throws IOException {
|
||||
public Texture(String url, Path local, boolean cloak, Map<String, String> metadata) 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, local);
|
||||
this.metadata = null;
|
||||
this.digest = SecurityHelper.digest(DIGEST_ALGO, texture);
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
public Texture(String url, byte[] digest) {
|
||||
this.url = IOHelper.verifyURL(url);
|
||||
this.digest = digest == null ? new byte[0] : digest;
|
||||
|
|
|
@ -20,7 +20,6 @@ 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();
|
||||
|
@ -138,7 +137,6 @@ public static void checkStackTrace(Class<?> mainClass) {
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private static int getCorrectOSArch() {
|
||||
// As always, mustdie must die
|
||||
if (OS_TYPE == OS.MUSTDIE)
|
||||
|
@ -152,7 +150,6 @@ public static String getEnvPropertyCaseSensitive(String name) {
|
|||
return System.getenv().get(name);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean isJVMMatchesSystemArch() {
|
||||
return JVM_BITS == OS_BITS;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ 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"));
|
||||
|
@ -131,7 +130,6 @@ public static void checkStackTrace(Class<?> mainClass) {
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private static int getCorrectOSArch() {
|
||||
// As always, mustdie must die
|
||||
if (OS_TYPE == OS.MUSTDIE)
|
||||
|
@ -147,7 +145,6 @@ public static String getEnvPropertyCaseSensitive(String name) {
|
|||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
public static boolean isJVMMatchesSystemArch() {
|
||||
return JVM_BITS == OS_BITS;
|
||||
}
|
||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
|||
Subproject commit 19e9cf3d6ce7148db4374e3736862d52b5854638
|
||||
Subproject commit fc263e19bc73cc7cb0f64c4e78c092c363b6769a
|
|
@ -12,7 +12,7 @@
|
|||
verBcpkix = '1.70'
|
||||
verSlf4j = '1.7.36'
|
||||
verLog4j = '2.19.0'
|
||||
verMySQLConn = '8.0.32'
|
||||
verMySQLConn = '8.0.33'
|
||||
verPostgreSQLConn = '42.5.1'
|
||||
verProguard = '7.3.1'
|
||||
verLaunch4j = '3.50'
|
||||
|
|
Loading…
Reference in a new issue