mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
Fixed my mistake.
This commit is contained in:
parent
f879c98995
commit
2676cd0dde
2 changed files with 2 additions and 15 deletions
|
@ -77,9 +77,8 @@ function offlineUpdateRequest(dirName, dir, matcher, digest) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Verify dir with matcher using ClientLauncher's API
|
||||
ClientLauncher.verifyOffline(dir, hdir.object, matcher, digest);
|
||||
return hdir;
|
||||
// Verify dir with matcher using FunctionalBridge`s API
|
||||
return FunctionalBridge.offlineUpdateRequest(dir, hdir, matcher, digest).run();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -551,18 +551,6 @@ public static void verifyHDir(Path dir, HashedDir hdir, FileNameMatcher matcher,
|
|||
throw new SecurityException(String.format("Forbidden modification: '%s'", IOHelper.getFileName(dir)));
|
||||
}
|
||||
|
||||
// Hack: this will break patcher because there are 2 functions with one body...
|
||||
@LauncherAPI
|
||||
public static void verifyOffline(Path dir, HashedDir hdir, FileNameMatcher matcher, boolean digest) throws IOException {
|
||||
if (matcher != null)
|
||||
matcher = matcher.verifyOnly();
|
||||
|
||||
// Hash directory and compare (ignore update-only matcher entries, it will break offline-mode)
|
||||
HashedDir currentHDir = new HashedDir(dir, matcher, true, digest);
|
||||
if (!hdir.diff(currentHDir, matcher).isSame())
|
||||
throw new SecurityException(String.format("Forbidden modification: '%s'", IOHelper.getFileName(dir)));
|
||||
}
|
||||
|
||||
private ClientLauncher() {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue