mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2025-02-05 18:40:16 +00:00
NOISSUE Verify checksums for pack build mods
This commit is contained in:
parent
b6290ac254
commit
fb0970b496
@ -22,6 +22,7 @@
|
|||||||
#include <MMCZip.h>
|
#include <MMCZip.h>
|
||||||
#include "TechnicPackProcessor.h"
|
#include "TechnicPackProcessor.h"
|
||||||
#include "SolderPackManifest.h"
|
#include "SolderPackManifest.h"
|
||||||
|
#include "net/ChecksumValidator.h"
|
||||||
|
|
||||||
Technic::SolderPackInstallTask::SolderPackInstallTask(
|
Technic::SolderPackInstallTask::SolderPackInstallTask(
|
||||||
shared_qobject_ptr<QNetworkAccessManager> network,
|
shared_qobject_ptr<QNetworkAccessManager> network,
|
||||||
@ -88,7 +89,14 @@ void Technic::SolderPackInstallTask::fileListSucceeded()
|
|||||||
for (const auto &mod : build.mods)
|
for (const auto &mod : build.mods)
|
||||||
{
|
{
|
||||||
auto path = FS::PathCombine(m_outputDir.path(), QString("%1").arg(i));
|
auto path = FS::PathCombine(m_outputDir.path(), QString("%1").arg(i));
|
||||||
m_filesNetJob->addNetAction(Net::Download::makeFile(mod.url, path));
|
|
||||||
|
auto dl = Net::Download::makeFile(mod.url, path);
|
||||||
|
if (!mod.md5.isEmpty()) {
|
||||||
|
auto rawMd5 = QByteArray::fromHex(mod.md5.toLatin1());
|
||||||
|
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Md5, rawMd5));
|
||||||
|
}
|
||||||
|
m_filesNetJob->addNetAction(dl);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user