modified: Cargo.toml
This commit is contained in:
parent
df6981e34d
commit
60b96be94b
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -353,7 +353,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nicotine"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
dependencies = [
|
||||
"zip-extract",
|
||||
]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nicotine"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
edition = "2024"
|
||||
description = "A small rust crate for patching mojang's Authlib"
|
||||
authors = ["alterwain"]
|
||||
|
@ -30,7 +30,7 @@ fn write_7za() {
|
||||
let _ = std::fs::write("tmp/7za.exe", ZIP_BIN);
|
||||
}
|
||||
|
||||
pub fn patch_jar(input_jar: &str, output_jar: &str, needles: &[&[u8]], endpoint: &str) -> Result<(), Box<dyn Error + Sync + Send>> {
|
||||
pub fn patch_jar(input_jar: &str, output_jar: &str, needles: &[&[u8]], endpoints: &[&str]) -> Result<(), Box<dyn Error + Sync + Send>> {
|
||||
|
||||
write_7za();
|
||||
|
||||
@ -41,11 +41,11 @@ pub fn patch_jar(input_jar: &str, output_jar: &str, needles: &[&[u8]], endpoint:
|
||||
|
||||
zip_extract::extract(Cursor::new(archive), &target_dir, true)?;
|
||||
|
||||
let replacement = endpoint.as_bytes();
|
||||
|
||||
for path in recursively_find_classes(PathBuf::from(".\\out")) {
|
||||
let mut haystack = std::fs::read(&path).unwrap();
|
||||
for needle in needles {
|
||||
for index in 0..needles.len() {
|
||||
let needle = needles[index];
|
||||
let replacement = endpoints[index].as_bytes();
|
||||
let mut v = find_subsequence(&haystack, needle);
|
||||
if v.is_empty() { continue; }
|
||||
while let Some(g) = v.first() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user