mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
Вернул проверку runtime
This commit is contained in:
parent
4f65a0a396
commit
e82359a347
1 changed files with 6 additions and 0 deletions
|
@ -89,9 +89,15 @@ public static void setConfig(LauncherConfig cfg)
|
||||||
|
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public static URL getResourceURL(String name) throws IOException {
|
public static URL getResourceURL(String name) throws IOException {
|
||||||
|
LauncherConfig config = getConfig();
|
||||||
|
byte[] validDigest = config.runtime.get(name);
|
||||||
|
if (validDigest == null)
|
||||||
|
throw new NoSuchFileException(name);
|
||||||
|
|
||||||
// Resolve URL and verify digest
|
// Resolve URL and verify digest
|
||||||
URL url = IOHelper.getResourceURL(RUNTIME_DIR + '/' + name);
|
URL url = IOHelper.getResourceURL(RUNTIME_DIR + '/' + name);
|
||||||
|
if (!Arrays.equals(validDigest, SecurityHelper.digest(SecurityHelper.DigestAlgorithm.MD5, url)))
|
||||||
|
throw new NoSuchFileException(name); // Digest mismatch
|
||||||
|
|
||||||
// Return verified URL
|
// Return verified URL
|
||||||
return url;
|
return url;
|
||||||
|
|
Loading…
Reference in a new issue