本文整理匯總了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);
}