transfer file from one zip to another, WIP
This commit is contained in:
parent
0fdf619360
commit
8157325a02
3 changed files with 86 additions and 14 deletions
|
|
@ -1,12 +1,13 @@
|
|||
use apk_frauder::ZipFileReader;
|
||||
use apk_frauder::ZipFileWriter;
|
||||
use std::fs::File;
|
||||
|
||||
fn main() {
|
||||
/*
|
||||
let file = File::open("app-release.apk").expect("failed to open file");
|
||||
//let file = File::open("tst_64.zip").expect("failed to open file");
|
||||
let zip_file = ZipFileReader::new(file);
|
||||
//println!("{}", zip_file.get_file_names().join("\n"));
|
||||
/*
|
||||
for file in &zip_file.files {
|
||||
println!("{}", file.get_name());
|
||||
println!("local: {:?}", file.local_header.malformed_extra_field);
|
||||
|
|
@ -33,6 +34,17 @@ fn main() {
|
|||
println!("Not signed whith scheme >= v2");
|
||||
}
|
||||
zip_file.check_holes();
|
||||
*/
|
||||
println!("{:#?}", zip_file.get_file_info("classes.dex"));
|
||||
*/
|
||||
|
||||
let file = File::open("app-release.apk").expect("failed to open file");
|
||||
let out_file = File::create("app-release.out.zip").expect("failed to create file");
|
||||
let mut zip_file = ZipFileReader::new(file);
|
||||
let mut out_file =
|
||||
ZipFileWriter::new(out_file, zip_file.zip64_end_of_central_directory.clone());
|
||||
for f in zip_file.files.clone() {
|
||||
out_file.insert_file_from_zip(f, &mut zip_file);
|
||||
}
|
||||
out_file.write_central_directory();
|
||||
//println!("{:#?}", zip_file.zip64_end_of_central_directory);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue