public ConstantPool getPool() { if (pool == null && loader != null) { pool = loader.loadPool(qualifiedName); } return pool; }
public DataInputFullStream getClassStream(String qualifiedClassName) throws IOException { Link link = mapClassLinks.get(qualifiedClassName); return link == null ? null : getClassStream(link.externalPath, link.internalPath); }
public void reload(LazyLoader loader) throws IOException { List<StructClass> lstClasses = new ArrayList<>(); for (StructClass cl : classes) { String oldName = cl.qualifiedName; StructClass newCl; try (DataInputFullStream in = loader.getClassStream(oldName)) { newCl = new StructClass(in, cl.isOwn(), loader); } lstClasses.add(newCl); Link lnk = loader.getClassLink(oldName); loader.removeClassLink(oldName); loader.addClassLink(newCl.qualifiedName, lnk); } classes = lstClasses; }
try (DataInputFullStream in = loader.getClassStream(file.getAbsolutePath(), null)) { StructClass cl = new StructClass(in, isOwn, loader); classes.put(cl.qualifiedName, cl); unit.addClass(cl, filename); loader.addClassLink(cl.qualifiedName, new LazyLoader.Link(file.getAbsolutePath(), null));
classes.put(cl.qualifiedName, cl); unit.addClass(cl, name); loader.addClassLink(cl.qualifiedName, new LazyLoader.Link(file.getAbsolutePath(), name));
public byte[] loadBytecode(StructMethod mt, int codeFullLength) { String className = mt.getClassStruct().qualifiedName; try (DataInputFullStream in = getClassStream(className)) { if (in != null) { in.discard(8); for (int i = 0; i < size; i++) { in.discard(6); skipAttributes(in); skipAttributes(in); continue;
public void expandData() throws IOException { if (containsCode && !expanded) { byte[] code = classStruct.getLoader().loadBytecode(this, codeFullLength); seq = parseBytecode(new DataInputFullStream(code), codeLength, classStruct.getPool()); expanded = true; } }
public Fernflower(IBytecodeProvider provider, IResultSaver saver, Map<String, Object> customProperties, IFernflowerLogger logger) { Map<String, Object> properties = new HashMap<>(IFernflowerPreferences.DEFAULTS); if (customProperties != null) { properties.putAll(customProperties); } String level = (String)properties.get(IFernflowerPreferences.LOG_LEVEL); if (level != null) { try { logger.setSeverity(IFernflowerLogger.Severity.valueOf(level.toUpperCase(Locale.US))); } catch (IllegalArgumentException ignore) { } } structContext = new StructContext(saver, this, new LazyLoader(provider)); classProcessor = new ClassesProcessor(structContext); PoolInterceptor interceptor = null; if ("1".equals(properties.get(IFernflowerPreferences.RENAME_ENTITIES))) { helper = loadHelper((String)properties.get(IFernflowerPreferences.USER_RENAMER_CLASS), logger); interceptor = new PoolInterceptor(); converter = new IdentifierConverter(structContext, helper, interceptor); } else { helper = null; converter = null; } DecompilerContext context = new DecompilerContext(properties, logger, structContext, classProcessor, interceptor); DecompilerContext.setCurrentContext(context); }
public void reload(LazyLoader loader) throws IOException { List<StructClass> lstClasses = new ArrayList<>(); for (StructClass cl : classes) { String oldName = cl.qualifiedName; StructClass newCl; try (DataInputFullStream in = loader.getClassStream(oldName)) { newCl = new StructClass(in, cl.isOwn(), loader); } lstClasses.add(newCl); Link lnk = loader.getClassLink(oldName); loader.removeClassLink(oldName); loader.addClassLink(newCl.qualifiedName, lnk); } classes = lstClasses; }
try (DataInputFullStream in = loader.getClassStream(file.getAbsolutePath(), null)) { StructClass cl = new StructClass(in, isOwn, loader); classes.put(cl.qualifiedName, cl); unit.addClass(cl, filename); loader.addClassLink(cl.qualifiedName, new LazyLoader.Link(LazyLoader.Link.CLASS, file.getAbsolutePath(), null));
classes.put(cl.qualifiedName, cl); unit.addClass(cl, name); loader.addClassLink(cl.qualifiedName, new LazyLoader.Link(LazyLoader.Link.ENTRY, file.getAbsolutePath(), name));
public byte[] loadBytecode(StructMethod mt, int codeFullLength) { String className = mt.getClassStruct().qualifiedName; try (DataInputFullStream in = getClassStream(className)) { if (in != null) { in.discard(8); for (int i = 0; i < size; i++) { in.discard(6); skipAttributes(in); skipAttributes(in); continue;
public ConstantPool loadPool(String classname) { try (DataInputFullStream in = getClassStream(classname)) { if (in != null) { in.discard(8); return new ConstantPool(in); } return null; } catch (IOException ex) { throw new RuntimeException(ex); } }
public ConstantPool getPool() { if (pool == null && loader != null) { pool = loader.loadPool(qualifiedName); } return pool; }
public void expandData() throws IOException { if (containsCode && !expanded) { byte[] code = classStruct.getLoader().loadBytecode(this, codeFullLength); seq = parseBytecode(new DataInputFullStream(code), codeLength, classStruct.getPool()); expanded = true; } }
public Fernflower(IBytecodeProvider provider, IResultSaver saver, Map<String, Object> options, IFernflowerLogger logger) { structContext = new StructContext(saver, this, new LazyLoader(provider)); DecompilerContext.initContext(options); DecompilerContext.setCounterContainer(new CounterContainer()); DecompilerContext.setLogger(logger); }
public DataInputFullStream getClassStream(String qualifiedClassName) throws IOException { Link link = mapClassLinks.get(qualifiedClassName); return link == null ? null : getClassStream(link.externalPath, link.internalPath); }
public ConstantPool loadPool(String classname) { try (DataInputFullStream in = getClassStream(classname)) { if (in != null) { in.discard(8); return new ConstantPool(in); } return null; } catch (IOException ex) { throw new RuntimeException(ex); } }