mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 17:11:39 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify dir with matcher using ClientLauncher's API
|
// Verify dir with matcher using FunctionalBridge`s API
|
||||||
ClientLauncher.verifyOffline(dir, hdir.object, matcher, digest);
|
return FunctionalBridge.offlineUpdateRequest(dir, hdir, matcher, digest).run();
|
||||||
return hdir;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)));
|
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() {
|
private ClientLauncher() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue