Skip to content

Commit b271a0f

Browse files
committed
v3.0.0
1 parent e036e07 commit b271a0f

File tree

7 files changed

+243
-334
lines changed

7 files changed

+243
-334
lines changed

.cargo/config.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
[build]
2-
rustflags = [
3-
"-C", "target-feature=+aes,+sse2",
4-
"-C", "target-feature=+crt-static",
5-
]
2+
rustflags = ["-C", "target-feature=+aes,+sse2"]

Cargo.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
[package]
22
name = "rpgmad-lib"
3-
version = "2.0.0"
3+
version = "3.0.0"
44
authors = ["savannstm <[email protected]>"]
55
edition = "2021"
6-
rust-version = "1.60.0"
6+
rust-version = "1.63.0"
77
description = "Library for decrypting RPG Maker `rgss` archives."
88
readme = "README.md"
99
repository = "https://github.com/savannstm/rpgm-archive-decrypter-lib"
1010
documentation = "https://docs.rs/rpgmad-lib"
1111
license-file = "LICENSE.md"
1212

1313
[dependencies]
14-
thiserror = "1.0.65"
14+
serde = { version = "1.0.219", optional = true }
15+
strum_macros = "0.26.4"
16+
thiserror = "2.0.12"
1517

1618
[dev-dependencies]
17-
marshal-rs = "0.4.0"
19+
marshal-rs = "1.1.1"
1820
png = "0.17.16"
21+
22+
[features]
23+
serde = ["dep:serde"]

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,28 @@ Used in [rpgm-archive-decrypter](https://github.com/savannstm/rpgm-archive-decry
77
## Example
88

99
```rust
10-
use rpgmad_lib::{Decrypter, extract_archive};
10+
use rpgmad_lib::{Decrypter, decrypt_archive};
11+
use std::path::PathBuf;
1112

12-
// Using Decrypter struct
1313
let archive_content: Vec<u8> = std::fs::read("C:/Game/Game.rgss3a").unwrap();
14+
15+
// Using Decrypter struct
1416
let mut decrypter = Decrypter::new();
17+
let decrypted_files = decrypter.decrypt(&archive_content).unwrap();
1518

16-
// You can optionally set force
17-
// decrypter.set_force(true)
19+
// Using function
20+
let decrypted_files = decrypt_archive(&archive_content).unwrap();
1821

19-
decrypter.extract(&archive_content, "C:/Game").unwrap();
22+
for file in decrypted_files {
23+
let path = String::from_utf8_lossy(&file.path);
24+
let output_path = PathBuf::from("C:/Game").join(path.as_ref());
2025

21-
// Using function
22-
// let force = false; // When `true`, it will overwrite existing files in the game directory.
23-
// extract_archive(&archive_content, "C:/Game", force).unwrap();
26+
if let Some(parent) = output_path.parent() {
27+
std::fs::create_dir_all(parent).unwrap();
28+
}
29+
30+
std::fs::write(output_path, file.content).unwrap();
31+
}
2432
```
2533

2634
## License

examples/example.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.

rustfmt.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
line_width = 80
1+
max_width = 80
2+
format_strings = true
3+
version = "Two"

0 commit comments

Comments
 (0)