[FEATURE] Add url to HashedFile

This commit is contained in:
Gravita 2025-06-02 13:24:45 +07:00
parent c65e20d77b
commit 88fa3ca1a0

View file

@ -20,6 +20,8 @@ public final class HashedFile extends HashedEntry {
public final long size;
@LauncherNetworkAPI
private final byte[] digest;
@LauncherNetworkAPI
public final String url;
public HashedFile(HInput input) throws IOException {
@ -30,6 +32,13 @@ public HashedFile(HInput input) throws IOException {
public HashedFile(long size, byte[] digest) {
this.size = VerifyHelper.verifyLong(size, VerifyHelper.L_NOT_NEGATIVE, "Illegal size: " + size);
this.digest = digest == null ? null : DIGEST_ALGO.verify(digest).clone();
this.url = null;
}
public HashedFile(long size, byte[] digest, String url) {
this.size = VerifyHelper.verifyLong(size, VerifyHelper.L_NOT_NEGATIVE, "Illegal size: " + size);
this.digest = digest == null ? null : DIGEST_ALGO.verify(digest).clone();
this.url = url;
}