本文整理汇总了Java中org.benf.cfr.reader.PluginRunner类的典型用法代码示例。如果您正苦于以下问题:Java PluginRunner类的具体用法?Java PluginRunner怎么用?Java PluginRunner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PluginRunner类属于org.benf.cfr.reader包,在下文中一共展示了PluginRunner类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clazz
import org.benf.cfr.reader.PluginRunner; //导入依赖的package包/类
static String clazz(String path) {
int i = path.lastIndexOf("!/");// filesystem path can contain ! but java can not
if (i == -1) throw new IllegalArgumentException();
PluginRunner r = new PluginRunner(OPT);
String head = path.substring(0, i);
r.addJarPath(head);
String tail = path.substring(i + 2, path.length() - 6);
return r.getDecompilationFor(tail);
}
示例2: decompile
import org.benf.cfr.reader.PluginRunner; //导入依赖的package包/类
/**
* Decompiled the class.
*/
private void decompile() {
String name = classNode.name;
String text = new PluginRunner(CFRParameter.toStringMap(), new CFRSourceImpl(lookupHelper)).getDecompilationFor(name);
// Hack to substring the first indent (Where the isolated method begins)
// to the end of the class, minus one (so it substrings to the method's
// closing brace)
if (methodNode != null) {
text = text.substring(text.indexOf(" "), text.lastIndexOf("}") - 1);
}
textArea.setText(text);
textArea.moveCaretPosition(0);
}
示例3: onClassSelect
import org.benf.cfr.reader.PluginRunner; //导入依赖的package包/类
/**
* Called when a class in the file tree is selected.
*
* @param mapping
*/
public void onClassSelect(ClassMapping clazz) {
String originalName = clazz.name.original;
// Update current class
this.currentClass = clazz;
// window.getHistory().addHistory(clazz);
// Decompile using CFR, send text to the text-area.
try {
PluginRunner pluginRunner = new PluginRunner(CFRSetting.toStringMap(), new CFRSourceImpl(lookupHelper));
String decomp = pluginRunner.getDecompilationFor(originalName);
window.openSourceTab(clazz.name.getValue(), decomp);
} catch (Exception e) {
window.openTab("Error", "Error: CFR failed to decompile this class:\n" + e.getMessage());
}
}
示例4: fuck
import org.benf.cfr.reader.PluginRunner; //导入依赖的package包/类
static String fuck(String path) {
PluginRunner r = new PluginRunner(OPT);
r.addJarPath(path);
return r.getDecompilationFor(path);
}