continue parsing the application instead of falling when encontering invalid code
This commit is contained in:
parent
0990b8a9b2
commit
0e2bb5fe2d
1 changed files with 14 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue