mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-24 00:09:48 +00:00
Remap field descriptors when adding to refmap, fixes #125
This commit is contained in:
1 parent
f0dbff5076
commit
62d8443270
2 files changed
+13
-3
No files matched your search
@@ -365,9 +365,8 @@ public class ObfuscationManager implements IObfuscationManager {
|
||||
for (TargetObfuscationEnvironment targetEnv : this.targetEnvironments) {
|
||||
String obfField = obfFieldData.get(targetEnv.getType());
|
||||
if (obfField != null) {
|
||||
MemberInfo remappedReference = MemberInfo.fromSrgField(obfField, context.desc);
|
||||
String remapped = remappedReference.toString();
|
||||
targetEnv.addMapping(className, reference, remapped);
|
||||
MemberInfo remappedReference = MemberInfo.fromSrgField(obfField, targetEnv.remapDescriptor(context.desc));
|
||||
targetEnv.addMapping(className, reference, remappedReference.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,6 +269,17 @@ class TargetObfuscationEnvironment {
|
||||
return transformed ? new MemberInfo(method.name, owner, desc, method.matchAll) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remap a single descriptor in the context of this environment
|
||||
*
|
||||
* @param desc descriptor to remap
|
||||
* @return remapped descriptor, may return the original descriptor if no
|
||||
* remapping occurred
|
||||
*/
|
||||
public String remapDescriptor(String desc) {
|
||||
return ObfuscationUtil.mapDescriptor(desc, this.remapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an obfuscation mapping for a field
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user