public static String buildJavaClassName(String name) { String res = name.replace('/', '.'); if (res.contains("$")) { // attempt to invoke foreign member // classes correctly StructClass cl = DecompilerContext.getStructContext().getClass(name); if (cl == null || !cl.isOwn()) { res = res.replace('$', '.'); } } return res; }
private Map<String, String> processExternalInterface(StructClass cl) { Map<String, String> names = new HashMap<>(); for (String ifName : cl.getInterfaceNames()) { Map<String, String> mapInt = interfaceNameMaps.get(ifName); if (mapInt != null) { names.putAll(mapInt); } else { StructClass clintr = context.getClass(ifName); if (clintr != null) { names.putAll(processExternalInterface(clintr)); } } } renameClassIdentifiers(cl, names); return names; }
StructClass clintr = context.getClass(ifName); if (clintr != null) { names.putAll(processExternalInterface(clintr));
private boolean isVarArgCall() { StructClass cl = DecompilerContext.getStructContext().getClass(classname); if (cl != null) { StructMethod mt = cl.getMethod(InterpreterUtil.makeUniqueKey(name, stringDescriptor)); if (mt != null) { return mt.hasModifier(CodeConstants.ACC_VARARGS); } } else { // TODO: tap into IDEA indices to access libraries methods details // try to check the class on the classpath Method mtd = ClasspathHelper.findMethod(classname, name, descriptor); return mtd != null && mtd.isVarArgs(); } return false; }
private BitSet getAmbiguousParameters() { StructClass cl = DecompilerContext.getStructContext().getClass(classname); if (cl == null) return EMPTY_BIT_SET;
StructClass cl = DecompilerContext.getStructContext().getClass(classname); boolean isInterface = cl != null && cl.hasModifier(CodeConstants.ACC_INTERFACE); super_qualifier = !isInterface ? this_classname : classname;
public static String buildJavaClassName(String name) { String res = name.replace('/', '.'); if (res.contains("$")) { // attempt to invoke foreign member // classes correctly StructClass cl = DecompilerContext.getStructContext().getClass(name); if (cl == null || !cl.isOwn()) { res = res.replace('$', '.'); } } return res; }
private Map<String, String> processExternalInterface(StructClass cl) { Map<String, String> names = new HashMap<>(); for (String ifName : cl.getInterfaceNames()) { Map<String, String> mapInt = interfaceNameMaps.get(ifName); if (mapInt != null) { names.putAll(mapInt); } else { StructClass clintr = context.getClass(ifName); if (clintr != null) { names.putAll(processExternalInterface(clintr)); } } } renameClassIdentifiers(cl, names); return names; }
StructClass clintr = context.getClass(ifName); if (clintr != null) { names.putAll(processExternalInterface(clintr));
private boolean isVarArgCall() { StructClass cl = DecompilerContext.getStructContext().getClass(classname); if (cl != null) { StructMethod mt = cl.getMethod(InterpreterUtil.makeUniqueKey(name, stringDescriptor)); if (mt != null) { return mt.hasModifier(CodeConstants.ACC_VARARGS); } } else { // TODO: tap into IDEA indices to access libraries methods details // try to check the class on the classpath Method mtd = ClasspathHelper.findMethod(classname, name, descriptor); return mtd != null && mtd.isVarArgs(); } return false; }
private BitSet getAmbiguousParameters() { StructClass cl = DecompilerContext.getStructContext().getClass(classname); if (cl == null) return EMPTY_BIT_SET;
public static boolean instanceOf(StructContext context, String valclass, String refclass) { if (valclass.equals(refclass)) { return true; } StructClass cl = context.getClass(valclass); if (cl == null) { return false; } if (cl.superClass != null && instanceOf(context, cl.superClass.getString(), refclass)) { return true; } int[] interfaces = cl.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { String intfc = cl.getPool().getPrimitiveConstant(interfaces[i]).getString(); if (instanceOf(context, intfc, refclass)) { return true; } } return false; }