diff --git a/androscalpel/src/apk.rs b/androscalpel/src/apk.rs index 6707993..ae8528f 100644 --- a/androscalpel/src/apk.rs +++ b/androscalpel/src/apk.rs @@ -7,7 +7,7 @@ use std::fs::File; use std::io::Cursor; use std::path::PathBuf; -use log::info; +use log::{error, info}; #[cfg(feature = "python")] use pyo3::{prelude::*, types::PyBytes}; @@ -804,11 +804,19 @@ impl Apk { let code = if code_off == 0 { None } else { - Some( - Self::get_code_from_off(code_off, dex, label_each_ins).with_context(|| { - format!("Failed to parse code of method {}", descriptor.__str__()) - })?, - ) + match Self::get_code_from_off(code_off, dex, label_each_ins) + .with_context(|| format!("Failed to parse code of method {}", descriptor.__str__())) + { + Err(e) => { + error!( + "Code of {} could not be loaded: {}", + descriptor.__str__(), + e + ); + None + } + Ok(code) => Some(code), + } }; Ok(Method {