mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] Отладочный вывод verifyHDir
This commit is contained in:
parent
4597ea64e9
commit
a26311be88
1 changed files with 11 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
||||||
import ru.gravit.utils.helper.JVMHelper.OS;
|
import ru.gravit.utils.helper.JVMHelper.OS;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.ProcessBuilder.Redirect;
|
import java.lang.ProcessBuilder.Redirect;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
|
@ -537,9 +538,18 @@ public static void verifyHDir(Path dir, HashedDir hdir, FileNameMatcher matcher,
|
||||||
|
|
||||||
// Hash directory and compare (ignore update-only matcher entries, it will break offline-mode)
|
// Hash directory and compare (ignore update-only matcher entries, it will break offline-mode)
|
||||||
HashedDir currentHDir = new HashedDir(dir, matcher, true, digest);
|
HashedDir currentHDir = new HashedDir(dir, matcher, true, digest);
|
||||||
if (!hdir.diff(currentHDir, matcher).isSame())
|
HashedDir.Diff diff = hdir.diff(currentHDir, matcher);
|
||||||
|
if (!diff.isSame())
|
||||||
|
{
|
||||||
|
diff.extra.walk(File.separator, (e,k,v) -> {
|
||||||
|
LogHelper.error("Extra %s", e);
|
||||||
|
});
|
||||||
|
diff.mismatch.walk(File.separator, (e,k,v) -> {
|
||||||
|
LogHelper.error("Mismatch %s", e);
|
||||||
|
});
|
||||||
throw new SecurityException(String.format("Forbidden modification: '%s'", IOHelper.getFileName(dir)));
|
throw new SecurityException(String.format("Forbidden modification: '%s'", IOHelper.getFileName(dir)));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private ClientLauncher() {
|
private ClientLauncher() {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue