modified: Cargo.lock

modified:   Cargo.toml
	modified:   src/lib.rs
	new file:   src/patch/Property.class
This commit is contained in:
Michael Wain 2025-03-19 20:15:04 +03:00
parent 60b96be94b
commit 1586d7f17c
4 changed files with 5 additions and 2 deletions

2
Cargo.lock generated
View File

@ -353,7 +353,7 @@ dependencies = [
[[package]] [[package]]
name = "nicotine" name = "nicotine"
version = "0.1.19" version = "0.1.20"
dependencies = [ dependencies = [
"zip-extract", "zip-extract",
] ]

View File

@ -1,6 +1,6 @@
[package] [package]
name = "nicotine" name = "nicotine"
version = "0.1.19" version = "0.1.20"
edition = "2024" edition = "2024"
description = "A small rust crate for patching mojang's Authlib" description = "A small rust crate for patching mojang's Authlib"
authors = ["alterwain"] authors = ["alterwain"]

View File

@ -1,6 +1,7 @@
use std::{error::Error, io::Cursor, path::{Path, PathBuf}, process::Command}; use std::{error::Error, io::Cursor, path::{Path, PathBuf}, process::Command};
const ZIP_BIN: &[u8; 1327616] = include_bytes!("7zip/7za.exe"); 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<usize> { fn find_subsequence(haystack: &[u8], needle: &[u8]) -> Vec<usize> {
haystack.windows(needle.len()) 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(path, haystack)?;
} }
std::fs::write(PathBuf::from(r#".\out\com\mojang\authlib\properties\Property.java"#), PROPERTY_BIN)?;
zip_dir(&target_dir, output_jar)?; zip_dir(&target_dir, output_jar)?;
std::fs::remove_dir_all(&target_dir)?; std::fs::remove_dir_all(&target_dir)?;

BIN
src/patch/Property.class Normal file

Binary file not shown.