Ensure invalid checksums arent used.

This commit is contained in:
Daniel Scalzi committed 2020-05-30 01:26:39 -04:00
1 parent 407032df61
commit 6e94883f23
1 file changed
+1 -1
@@ -116,7 +116,7 @@ export class ForgeGradle2Adapter extends ForgeResolver {
libBuf = await readFile(localPath)
// VERIFY HASH
if (!postProcess) { // Checksums for .pack.xz in the version.json are completely useless.
if (lib.checksums != null) {
if (lib.checksums != null && lib.checksums.length == 1) {
const sha1 = createHash('sha1').update(libBuf).digest('hex')
if (sha1 !== lib.checksums[0]) {
console.debug('Hashes do not match, redownloading..')