patch code received from dyn loading
This commit is contained in:
parent
b476d04b78
commit
1c7b84261d
7 changed files with 40 additions and 16 deletions
18
patcher/src/code_loading_patcher.rs
Normal file
18
patcher/src/code_loading_patcher.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
use std::fs::File;
|
||||
|
||||
use androscalpel::Apk;
|
||||
use anyhow::Result;
|
||||
|
||||
use crate::runtime_data::RuntimeData;
|
||||
|
||||
/// Insert statically bytecode that was loaded from other source at runtime.
|
||||
/// For now, we ignore class collision.
|
||||
pub fn insert_code(apk: &mut Apk, data: &RuntimeData) -> Result<()> {
|
||||
for dyn_data in &data.dyn_code_load {
|
||||
for file in &dyn_data.files {
|
||||
let file = File::open(file)?;
|
||||
apk.add_code(file, crate::labeling, false)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue