mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-20 05:26:30 +02:00
Download the right file
This commit is contained in:
parent
022af4b5c5
commit
040bb955ec
@ -149,7 +149,7 @@ public class UpdateManager {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
processIndex(HandlerManager.getNewLoc(opts.downloadURI, pf.index.file),
|
processIndex(HandlerManager.getNewLoc(opts.downloadURI, pf.index.file),
|
||||||
HashUtils.getHash(pf.index.hash, pf.index.hashFormat), manifest);
|
HashUtils.getHash(pf.index.hashFormat, pf.index.hash), pf.index.hashFormat, manifest);
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
ui.handleExceptionAndExit(e1);
|
ui.handleExceptionAndExit(e1);
|
||||||
}
|
}
|
||||||
@ -171,11 +171,11 @@ public class UpdateManager {
|
|||||||
// TODO: implement
|
// TODO: implement
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void processIndex(URI indexUri, Object indexHash, ManifestFile manifest) {
|
protected void processIndex(URI indexUri, Object indexHash, String hashFormat, ManifestFile manifest) {
|
||||||
GeneralHashingSource indexFileSource;
|
GeneralHashingSource indexFileSource;
|
||||||
try {
|
try {
|
||||||
Source src = HandlerManager.getFileSource(opts.downloadURI);
|
Source src = HandlerManager.getFileSource(indexUri);
|
||||||
indexFileSource = HashUtils.getHasher("sha256").getHashingSource(src);
|
indexFileSource = HashUtils.getHasher(hashFormat).getHashingSource(src);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO: still launch the game if updating doesn't work?
|
// TODO: still launch the game if updating doesn't work?
|
||||||
// TODO: ask user if they want to launch the game, exit(1) if they don't
|
// TODO: ask user if they want to launch the game, exit(1) if they don't
|
||||||
@ -192,6 +192,8 @@ public class UpdateManager {
|
|||||||
|
|
||||||
if (!indexFileSource.hashIsEqual(indexHash)) {
|
if (!indexFileSource.hashIsEqual(indexHash)) {
|
||||||
System.out.println("Hash problems!!!!!!!");
|
System.out.println("Hash problems!!!!!!!");
|
||||||
|
System.out.println(indexHash);
|
||||||
|
System.out.println(indexFileSource.getHash());
|
||||||
// TODO: throw exception
|
// TODO: throw exception
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,11 @@ public class HasherHashingSource implements IHasher {
|
|||||||
return objHash.value == null ? true : false;
|
return objHash.value == null ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return type + ": " + value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user