getIdentifier(ref)

putClassName


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@585 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent a58ace28de
commit 4d71621216
  1. 45
      jode/jode/obfuscator/MethodIdentifier.java

@ -145,7 +145,7 @@ public class MethodIdentifier extends Identifier implements Opcodes {
}
public void analyze() {
if (Obfuscator.isDebugging)
if (Obfuscator.verboseLevel > 1)
Obfuscator.err.println("Analyze: "+this);
String type = getType();
@ -258,16 +258,14 @@ public class MethodIdentifier extends Identifier implements Opcodes {
case opc_invokeinterface:
case opc_invokevirtual: {
Reference ref = (Reference) instr.objData;
ClassIdentifier ci = (ClassIdentifier)
clazz.bundle.getIdentifier(ref.getClazz());
String newType = clazz.bundle.getTypeAlias(ref.getType());
if (ci != null) {
MethodIdentifier mi = (MethodIdentifier)
ci.getIdentifier(ref.getName(), ref.getType());
clazz.bundle.getIdentifier(ref);
String newType = clazz.bundle.getTypeAlias(ref.getType());
if (mi != null)
instr.objData = new Reference
(ci.getFullAlias(), mi.getAlias(), newType);
} else
("L"+mi.clazz.getFullAlias().replace('.','/')+';',
mi.getAlias(), newType);
else
instr.objData = new Reference
(ref.getClazz(), ref.getName(), newType);
break;
@ -278,13 +276,12 @@ public class MethodIdentifier extends Identifier implements Opcodes {
case opc_getfield: {
Reference ref = (Reference) instr.objData;
String newType = clazz.bundle.getTypeAlias(ref.getType());
ClassIdentifier ci = (ClassIdentifier)
clazz.bundle.getIdentifier(ref.getClazz());
if (ci != null) {
FieldIdentifier fi = (FieldIdentifier)
ci.getIdentifier(ref.getName(), ref.getType());
clazz.bundle.getIdentifier(ref);
if (fi != null) {
instr.objData = new Reference
(ci.getFullAlias(), fi.getAlias(), newType);
("L"+fi.clazz.getFullAlias().replace('.','/')+';',
fi.getAlias(), newType);
} else
instr.objData = new Reference
(ref.getClazz(), ref.getName(), newType);
@ -292,19 +289,11 @@ public class MethodIdentifier extends Identifier implements Opcodes {
break;
}
case opc_new:
case opc_anewarray:
case opc_checkcast:
case opc_instanceof:
case opc_multianewarray: {
String clName = (String) instr.objData;
if (clName.charAt(0) == '[') {
clName = clazz.bundle.getTypeAlias(clName);
} else {
ClassIdentifier ci = (ClassIdentifier)
clazz.bundle.getIdentifier(clName);
if (ci != null)
clName = ci.getFullAlias();
}
instr.objData = clName;
break;
}
@ -314,8 +303,8 @@ public class MethodIdentifier extends Identifier implements Opcodes {
Handler[] handlers = strippedBytecode.getExceptionHandlers();
for (int i=0; i< handlers.length; i++) {
if (handlers[i].type != null) {
ClassIdentifier ci = (ClassIdentifier)
clazz.bundle.getIdentifier(handlers[i].type);
ClassIdentifier ci =
clazz.bundle.getClassIdentifier(handlers[i].type);
if (ci != null)
handlers[i].type = ci.getFullAlias();
}
@ -347,12 +336,12 @@ public class MethodIdentifier extends Identifier implements Opcodes {
exceptionsIndex = gcp.putUTF("Exceptions");
excIndices = new int[exceptions.length];
for (int i=0; i< exceptions.length; i++) {
ClassIdentifier ci = (ClassIdentifier)
clazz.bundle.getIdentifier(exceptions[i]);
ClassIdentifier ci =
clazz.bundle.getClassIdentifier(exceptions[i]);
if (ci != null)
excIndices[i] = gcp.putClassRef(ci.getFullAlias());
excIndices[i] = gcp.putClassName(ci.getFullAlias());
else
excIndices[i] = gcp.putClassRef(exceptions[i]);
excIndices[i] = gcp.putClassName(exceptions[i]);
}
exceptions = null;
}

Loading…
Cancel
Save