增加自动构建

This commit is contained in:
Lkhsss
2024-03-03 09:56:06 +08:00
parent 62b1d68a20
commit fa7551b374
4 changed files with 134 additions and 76 deletions

View File

@ -4,13 +4,11 @@ use aes::cipher::{generic_array::GenericArray, BlockDecrypt, KeyInit};
use aes::Aes128;
use base64;
use colored::*;
use core::panic;
use log::{debug, error, info, trace, warn};
use serde_derive::{Deserialize, Serialize};
use serde_json::{self, Value};
use std::fs::{self, File};
use std::io::{BufReader, Error, ErrorKind, Read, Seek, SeekFrom, Write};
// use std::iter::Enumerate;
use std::path::Path;
use std::str::from_utf8;
@ -500,8 +498,8 @@ fn aes128_to_slice(key: &[u8], blocks: &[u8]) -> Vec<u8> {
fn standardize_filename(old_filename: String) -> String {
let mut new_filename = String::from(old_filename);
debug!("规范文件名:{}", new_filename);
let standard = ["\\", "/", "*", "?", "\"", ":", "<", ">", "|"];
let resolution = ["_", "_", "", "", "", "", "", "", "_",];
let standard = ["\\", "/", "*", "?", "\"", ":", "<", ">", "|"];
let resolution = ["_", "_", "", "", "", "", "", "", "_"];
for i in 0..standard.len() {
new_filename = new_filename.replace(&standard[i].to_string(), &resolution[i].to_string());
}

View File

@ -1,6 +1,6 @@
use env_logger::Builder;
use hex::decode;
use log::{error, warn};
use log::{error, info, warn};
use ncmmiao::{dump, Key, Ncmfile};
use std::env;
use std::path::Path;
@ -76,17 +76,10 @@ fn main() {
}
}
// let filepaths = undumpfile;
let count = undumpfile.len();
let mut time = 0usize;
// let count = undumpfile.len();
// let mut time = 0usize;
for filepath in undumpfile {
time += 1;
// println!("{}/{}", &time, &count);
let mut ncmfile = Ncmfile::new(&filepath).unwrap();
dump(&mut ncmfile, &keys, Path::new("output")).unwrap();
//TODO增加计时
// let time = SystemTime::now();
// let time = SystemTime::now().duration_since(time).unwrap().as_secs();
// println!("{}",time);
}
}