passes: rename mixin classes + patch mixins.json/refmap like OBF

- Remove absorb_mixins keep rule (mixin classes now renameable)
- Add mixins.rs: patch_mixins_json rewrites package + entries via
  common prefix of mapped names; patch_refmap_json rewrites all strings
- Resources pass routes *.mixins.json and *refmap.json to specialized
  patchers, falls back to generic text remap

Reference: OBF fabric-obfuscator patchMixinsJson/patchRefmapJson.
This commit is contained in:
Loki 2026-10-12 14:18:19 +02:00
parent b73c72d56d
commit 90506a4736
Signed by: boba
GPG key ID: 253067914055423B
17 changed files with 490 additions and 24 deletions

View file

@ -3,7 +3,7 @@
use std::collections::{BTreeMap, BTreeSet};
use noxis_analysis::{Analysis, ClassHierarchy};
use noxis_analysis::{Analysis, ClassHierarchy, external_dispatch_families};
use noxis_classfile::Program;
use noxis_core::{Config, Context, NameStyle, Rng};
@ -97,6 +97,7 @@ impl RenameMaps {
pub(super) fn build_virtual_families(
program: &Program,
analysis: &Analysis,
hierarchy: &ClassHierarchy,
) -> (BTreeMap<FamilyKey, Vec<MemberKey>>, BTreeSet<FamilyKey>) {
let mut families: BTreeMap<FamilyKey, Vec<MemberKey>> = BTreeMap::new();
let mut locked: BTreeSet<FamilyKey> = BTreeSet::new();
@ -124,6 +125,11 @@ pub(super) fn build_virtual_families(
));
}
}
// Семейства, которые диспатчатся через внешние интерфейсы/классы, обязаны
// сохранить имя: внешний вызывающий код не переименовать.
locked.extend(external_dispatch_families(program, hierarchy));
(families, locked)
}