Skip to content

Commit 93bbef3

Browse files
authored
[release/3.6] 修复 RemoteMod::getIntegrityCheck 未选择正确的算法的问题 (#4443)
#4238
1 parent 9dcc272 commit 93bbef3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

HMCLCore/src/main/java/org/jackhuang/hmcl/mod/RemoteMod.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,13 @@ public Map<String, String> getHashes() {
302302

303303
public FileDownloadTask.IntegrityCheck getIntegrityCheck() {
304304
if (hashes.containsKey("md5")) {
305-
return new FileDownloadTask.IntegrityCheck("MD5", hashes.get("sha1"));
305+
return new FileDownloadTask.IntegrityCheck("MD5", hashes.get("md5"));
306306
} else if (hashes.containsKey("sha1")) {
307307
return new FileDownloadTask.IntegrityCheck("SHA-1", hashes.get("sha1"));
308+
} else if (hashes.containsKey("sha256")) {
309+
return new FileDownloadTask.IntegrityCheck("SHA-256", hashes.get("sha256"));
308310
} else if (hashes.containsKey("sha512")) {
309-
return new FileDownloadTask.IntegrityCheck("SHA-256", hashes.get("sha1"));
311+
return new FileDownloadTask.IntegrityCheck("SHA-512", hashes.get("sha512"));
310312
} else {
311313
return null;
312314
}

0 commit comments

Comments
 (0)