use of jadx.gui.jobs.BackgroundExecutor in project jadx by skylot.
the class QuarkManager method start.
public void start() {
if (!checkFileSize(LARGE_APK_SIZE)) {
int result = JOptionPane.showConfirmDialog(mainWindow, "The selected file size is too large (over 30M) that may take a long time to analyze, do you want to continue", "Quark: Warning", JOptionPane.YES_NO_OPTION);
if (result == JOptionPane.NO_OPTION) {
return;
}
}
BackgroundExecutor executor = mainWindow.getBackgroundExecutor();
executor.execute("Quark install", this::checkInstall, installStatus -> executor.execute("Quark analysis", this::startAnalysis, analysisStatus -> loadReport()));
}
use of jadx.gui.jobs.BackgroundExecutor in project jadx by skylot.
the class QuarkReportPanel method buildTree.
private JTree buildTree() {
JTree tree = new JTree(treeRoot);
tree.setLayout(new BorderLayout());
tree.setBorder(BorderFactory.createEmptyBorder());
tree.setShowsRootHandles(false);
tree.setScrollsOnExpand(false);
tree.setSelectionModel(null);
tree.setCellRenderer(cellRenderer);
tree.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent event) {
if (SwingUtilities.isLeftMouseButton(event)) {
Object node = getNodeUnderMouse(tree, event);
if (node instanceof MethodTreeNode) {
JMethod method = ((MethodTreeNode) node).getJMethod();
BackgroundExecutor executor = tabbedPane.getMainWindow().getBackgroundExecutor();
executor.execute("Decompiling class", () -> tabbedPane.codeJump(method), // TODO: fix bug with incorrect jump on just decompiled code
status -> tabbedPane.codeJump(method));
}
}
}
});
tree.addTreeExpansionListener(new TreeExpansionListener() {
@Override
public void treeExpanded(TreeExpansionEvent event) {
TreePath path = event.getPath();
Object leaf = path.getLastPathComponent();
if (leaf instanceof CrimeTreeNode) {
CrimeTreeNode node = (CrimeTreeNode) leaf;
Enumeration<TreeNode> children = node.children();
while (children.hasMoreElements()) {
TreeNode child = children.nextElement();
tree.expandPath(path.pathByAddingChild(child));
}
}
}
@Override
public void treeCollapsed(TreeExpansionEvent event) {
}
});
return tree;
}
Aggregations