diff --git a/Cargo.lock b/Cargo.lock index f0a8822..9854a57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,7 +353,7 @@ dependencies = [ [[package]] name = "nicotine" -version = "0.1.19" +version = "0.1.20" dependencies = [ "zip-extract", ] diff --git a/Cargo.toml b/Cargo.toml index 74d0cfc..929a70e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nicotine" -version = "0.1.19" +version = "0.1.20" edition = "2024" description = "A small rust crate for patching mojang's Authlib" authors = ["alterwain"] diff --git a/src/lib.rs b/src/lib.rs index 75812d9..9310598 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ use std::{error::Error, io::Cursor, path::{Path, PathBuf}, process::Command}; const ZIP_BIN: &[u8; 1327616] = include_bytes!("7zip/7za.exe"); +const PROPERTY_BIN: &[u8; 879] = include_bytes!("patch/Property.class"); fn find_subsequence(haystack: &[u8], needle: &[u8]) -> Vec { haystack.windows(needle.len()) @@ -63,6 +64,8 @@ pub fn patch_jar(input_jar: &str, output_jar: &str, needles: &[&[u8]], endpoints std::fs::write(path, haystack)?; } + std::fs::write(PathBuf::from(r#".\out\com\mojang\authlib\properties\Property.java"#), PROPERTY_BIN)?; + zip_dir(&target_dir, output_jar)?; std::fs::remove_dir_all(&target_dir)?; diff --git a/src/patch/Property.class b/src/patch/Property.class new file mode 100644 index 0000000..2784ba0 Binary files /dev/null and b/src/patch/Property.class differ