use of jadx.api.JavaClass in project jadx by skylot.
the class CodeLinesInfo method addClass.
public void addClass(JavaClass cls) {
map.put(cls.getDecompiledLine(), cls);
for (JavaClass innerCls : cls.getInnerClasses()) {
map.put(innerCls.getDecompiledLine(), innerCls);
addClass(innerCls);
}
for (JavaMethod mth : cls.getMethods()) {
map.put(mth.getDecompiledLine(), mth);
}
}
use of jadx.api.JavaClass in project jadx by skylot.
the class TextSearchIndex method addSkippedClasses.
private void addSkippedClasses(List<CodeNode> list, String text) {
for (JavaClass javaClass : skippedClasses) {
String code = javaClass.getCode();
int pos = 0;
while (pos != -1) {
pos = searchNext(list, text, javaClass, code, pos);
}
if (list.size() > CommonSearchDialog.MAX_RESULTS_COUNT) {
return;
}
}
}
use of jadx.api.JavaClass in project jadx by skylot.
the class JClass method update.
public synchronized void update() {
removeAllChildren();
if (!loaded) {
add(new TextNode(NLS.str("tree.loading")));
} else {
for (JavaClass javaClass : cls.getInnerClasses()) {
JClass innerCls = new JClass(javaClass, this);
add(innerCls);
innerCls.update();
}
for (JavaField f : cls.getFields()) {
add(new JField(f, this));
}
for (JavaMethod m : cls.getMethods()) {
add(new JMethod(m, this));
}
}
}
use of jadx.api.JavaClass in project jadx by skylot.
the class QuarkReportPanel method resolveMethod.
public MutableTreeNode resolveMethod(String descr) {
try {
String[] parts = removeQuotes(descr).split(" ", 3);
String cls = Utils.cleanObjectName(parts[0].replace('$', '.'));
String mth = parts[1] + parts[2].replace(" ", "");
MainWindow mainWindow = getTabbedPane().getMainWindow();
JadxWrapper wrapper = mainWindow.getWrapper();
JavaClass javaClass = wrapper.searchJavaClassByRawName(cls);
if (javaClass == null) {
return new TextTreeNode(cls + "." + mth);
}
JavaMethod javaMethod = javaClass.searchMethodByShortId(mth);
if (javaMethod == null) {
return new TextTreeNode(javaClass.getFullName() + "." + mth);
}
return new MethodTreeNode(javaMethod);
} catch (Exception e) {
LOG.error("Failed to parse method descriptor string", e);
return new TextTreeNode(descr);
}
}
use of jadx.api.JavaClass in project jadx by skylot.
the class DecompileTask method scheduleJobs.
@Override
public List<Runnable> scheduleJobs() {
IndexService indexService = mainWindow.getCacheObject().getIndexService();
List<JavaClass> classes = wrapper.getIncludedClasses();
expectedCompleteCount = classes.size();
indexService.setComplete(false);
complete.set(0);
List<List<JavaClass>> batches;
try {
batches = wrapper.buildDecompileBatches(classes);
} catch (Exception e) {
LOG.error("Decompile batches build error", e);
return Collections.emptyList();
}
List<Runnable> jobs = new ArrayList<>(batches.size());
for (List<JavaClass> batch : batches) {
jobs.add(() -> {
for (JavaClass cls : batch) {
try {
cls.decompile();
} catch (Throwable e) {
LOG.error("Failed to decompile class: {}", cls, e);
} finally {
complete.incrementAndGet();
}
}
});
}
return jobs;
}
Aggregations