From 01426a3d0f0aa1e546aa9d28cb24595892814d68 Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Thu, 27 Mar 2025 14:12:22 +0100 Subject: [PATCH] wip --- patcher/src/code_loading_patcher.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/patcher/src/code_loading_patcher.rs b/patcher/src/code_loading_patcher.rs index c0543db..dcc96f9 100644 --- a/patcher/src/code_loading_patcher.rs +++ b/patcher/src/code_loading_patcher.rs @@ -98,15 +98,17 @@ fn insert_code_model_class_loaders(apk: &mut Apk, data: &RuntimeData) -> Result< // and anyway, there is no reason to rename ref in it (its only parent // sould be the classbootloader, and we don't handle changing class loader // on the fly) - if let Some(new_names) = new_names.remove(&k) - && k != main_cl_id - { - v.rename_refs(new_names).map(|v| (k, v)) + if let Some(new_names) = new_names.remove(&k) { + if k != main_cl_id { + v.rename_refs(new_names).map(|v| (k, v)) + } else { + Ok((k, v)) + } } else { Ok((k, v)) } }) - .collect()?; + .collect::>()?; // TODO: get the ClassLoader::parent values... // TODO: model the delegation behavior and rename ref to class accordingly