modified: Cargo.lock
modified: Cargo.toml modified: src/lib.rs new file: src/patch/Property.class
This commit is contained in:
parent
60b96be94b
commit
1586d7f17c
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -353,7 +353,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nicotine"
|
||||
version = "0.1.19"
|
||||
version = "0.1.20"
|
||||
dependencies = [
|
||||
"zip-extract",
|
||||
]
|
||||
|
@ -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"]
|
||||
|
@ -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<usize> {
|
||||
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)?;
|
||||
|
BIN
src/patch/Property.class
Normal file
BIN
src/patch/Property.class
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user