Upgrade dependencies to latest stable

zip 0.6.6 -> 8.6.0 (the 0.6 line is unmaintained), aes 0.8 -> 0.9
(BlockCipherDecrypt trait replaces BlockDecrypt), sha2 0.10 -> 0.11
(Array no longer formats as hex; local hex_digest helpers). Outputs are
byte-identical across the upgrade: full golden corpus and Android corpus
sidecars all pass.
This commit is contained in:
2026-09-02 03:19:06 +08:00
parent d3dd1a8ff8
commit cbfacbc31f
8 changed files with 222 additions and 120 deletions
+11 -2
View File
@@ -183,7 +183,7 @@ fn read_file(path: &Path) -> Result<Vec<u8>> {
fn sha256_bytes(data: &[u8]) -> String {
let mut digest = Sha256::new();
digest.update(data);
format!("{:x}", digest.finalize())
hex_digest(&digest.finalize())
}
fn sha256_file(path: &Path) -> Result<String> {
@@ -199,7 +199,7 @@ fn sha256_file(path: &Path) -> Result<String> {
}
digest.update(&buffer[..read]);
}
Ok(format!("{:x}", digest.finalize()))
Ok(hex_digest(&digest.finalize()))
}
fn copy_range(source: &[u8], output: &mut File, size: usize, path: &Path) -> Result<()> {
@@ -1480,3 +1480,12 @@ pub fn restore_libil2cpp(options: &RestoreOptions) -> Result<RestoreReport> {
elapsed_seconds: started.elapsed().as_secs_f64(),
})
}
/// Lowercase hex of a digest output (sha2 0.11's `Array` no longer formats as
/// hex directly).
fn hex_digest(data: &[u8]) -> String {
let mut out = String::with_capacity(data.len() * 2);
for byte in data {
out.push_str(&format!("{byte:02x}"));
}
out
}