patch code received from dyn loading

This commit is contained in:
Jean-Marie Mineau 2025-03-11 16:13:42 +01:00
parent b476d04b78
commit 1c7b84261d
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
7 changed files with 40 additions and 16 deletions

View 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(())
}