modified: src/main.rs
Some checks failed
gitea/Frida-android-native/pipeline/head There was a failure building this commit

modified:   src/simple_log.rs
This commit is contained in:
Michael Wain 2024-10-07 02:13:52 +03:00
parent da9741e215
commit d73fbe6189
2 changed files with 2 additions and 8 deletions

View File

@ -27,7 +27,6 @@ pub unsafe extern "C" fn Java_com_alterdekim_frida_FridaLib_run(
tun_fd: jint, tun_fd: jint,
close_fd_on_drop: jboolean, close_fd_on_drop: jboolean,
) -> jint { ) -> jint {
simple_log::init_logger();
let config = env.get_string(config_b32).unwrap().into(); let config = env.get_string(config_b32).unwrap().into();
let close_fd_on_drop = close_fd_on_drop != 0; let close_fd_on_drop = close_fd_on_drop != 0;
mobile::mobile_run(config, close_fd_on_drop, tun_fd) mobile::mobile_run(config, close_fd_on_drop, tun_fd)

View File

@ -1,12 +1,7 @@
use crossbeam_channel::unbounded; use crossbeam_channel::unbounded;
use crossbeam_channel::{ Sender, Receiver }; use crossbeam_channel::{ Sender, Receiver };
static tx: Sender<Vec<u8>>; static bnd: (Sender<Vec<u8>>, Receiver<Vec<u8>>) = unbounded::<Vec<u8>>();
static rx: Receiver<Vec<u8>>;
pub fn init_logger() {
(tx, rx) = unbounded::<Vec<u8>>();
}
pub fn fetch_logs() -> Vec<u8> { pub fn fetch_logs() -> Vec<u8> {
if let Ok(bytes) = rx.recv() { if let Ok(bytes) = rx.recv() {
@ -49,6 +44,6 @@ impl SimpleLogger {
record.module_path().unwrap_or(""), record.module_path().unwrap_or(""),
record.args() record.args()
); );
push_log(msg.as_bytes()); push_log(msg.as_bytes().to_vec());
} }
} }