wip
This commit is contained in:
parent
f8c70b576b
commit
a374769389
6 changed files with 163 additions and 39 deletions
|
|
@ -43,10 +43,11 @@ fn main() {
|
|||
.unwrap()
|
||||
.read_to_string(&mut json)
|
||||
.unwrap();
|
||||
let rt_data: RuntimeData = serde_json::from_str(&json).unwrap();
|
||||
let mut rt_data: RuntimeData = serde_json::from_str(&json).unwrap();
|
||||
|
||||
// Dynamic Loading
|
||||
insert_code(cli.code_loading_patch_strategy, &mut apk, &rt_data).unwrap();
|
||||
insert_code(cli.code_loading_patch_strategy, &mut apk, &mut rt_data).unwrap();
|
||||
let rt_data = rt_data; // not mut anymore
|
||||
|
||||
// Reflection
|
||||
let mut test_methods = HashMap::new();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,12 @@ use clap::ValueEnum;
|
|||
|
||||
use crate::runtime_data::RuntimeData;
|
||||
|
||||
// TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
|
||||
//
|
||||
// INSERT EMPTY CLASS LOADERS WHEN ID REFERS TO UNKNOWN CLASS LOADER
|
||||
//
|
||||
// TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
|
||||
|
||||
#[derive(ValueEnum, Debug, PartialEq, Clone, Copy, Default)]
|
||||
pub enum CodePatchingStrategy {
|
||||
#[default]
|
||||
|
|
@ -41,7 +47,10 @@ fn insert_code_model_class_loaders(apk: &mut Apk, runtime_data: &mut RuntimeData
|
|||
let mut class_defined = apk.list_classes();
|
||||
let mut class_redefined = HashSet::new();
|
||||
let mut class_loaders = HashMap::new();
|
||||
let main_cl_id = runtime_data.apk_cl_id.clone();
|
||||
let main_cl_id = runtime_data
|
||||
.apk_cl_id
|
||||
.clone()
|
||||
.unwrap_or_else(|| "MAIN".to_string());
|
||||
class_loaders.insert(
|
||||
main_cl_id.clone(),
|
||||
ClassLoader {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ pub struct RuntimeData {
|
|||
pub cnstr_new_inst_data: Vec<ReflectionCnstrNewInstData>,
|
||||
pub dyn_code_load: Vec<DynamicCodeLoadingData>,
|
||||
/// The id of the class loader of the apk (the main classloader)
|
||||
pub apk_cl_id: String,
|
||||
pub apk_cl_id: Option<String>,
|
||||
}
|
||||
|
||||
impl RuntimeData {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue