Closed MidKnightXI closed 1 year ago
Btw I used the function you provided like that
fn rebuild_ad_dir(path: &str) -> Result<()>
{
let asar_file = std::fs::read(path)?;
let asar = AsarReader::new(&asar_file)?;
println!("There are {} files in archive.asar", asar.files().len());
for content in asar.files().keys() {
println!("{}", content.display());
}
Ok(())
}
pub fn remove_ads() -> bool
{
let asar: String = format_asar_path();
let asar_path = std::path::Path::new(&asar);
if asar_path.exists()
{
kill_opgg();
// unpack_asar(asar_path.to_str().unwrap());
let test = rebuild_ad_dir(asar_path.to_str().unwrap());
match test {
Ok(v) => println!("working with version: {v:?}"),
Err(e) => println!("error parsing header: {e:?}"),
}
return true;
}
return false;
}
Sorry, didn't notice my GitHub notifications until now!
Btw I used the function you provided like that
What does this program output when running rebuild_ad_dir
?
Sorry I didn't work on my stuff lastly but I just checked and it appears that I'm getting this error:
error parsing header: Json(Error("data did not match any variant of untagged enum Header", line: 0, column: 0))
What does app.asar look like? Can you upload the asar somewhere (use catbox.moe if you don't already use another file uploading site) so I can take a look at it?
Sorry for taking an eternity and a half, I've figured out the issue.
Some objects seem to have an unpacked
value. I'm not entirely sure what this does?
Should be fixed with https://github.com/Absolucy/asar-rs/commit/97db6737d4d855a087c1882d234c6569014c70f5
Sure.
0.2.0 published on crates.io.
Context
I'm looking to unpack a .asar archive to rewrite some files in it.
I already did this in JS with the asar npm package from electron and I'm trying to rewrite this code in Rust due to "performance issues" and that I'm not satisfied with my own code.
JS Code with asar lib
Just to give you an exemple of what I'm trying to reproduce
I tried to open a .asar with your crate (with the exemple provided and the path to my archive but it ends up not listing its content