Projects STRLCPY jadx Commits eaf623a5
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
    skipped 8 lines
    9 9  import java.io.File;
    10 10  import java.util.ArrayList;
    11 11  import java.util.Collections;
     12 +import java.util.Enumeration;
    12 13  import java.util.HashMap;
    13 14  import java.util.IdentityHashMap;
    14 15  import java.util.Iterator;
    skipped 105 lines
    120 121   }
    121 122   prevPkg.getInnerPackages().add(pkg);
    122 123   }
     124 + }
     125 + 
     126 + public JClass searchClassInTree(JClass node) {
     127 + Enumeration en = this.breadthFirstEnumeration();
     128 + while (en.hasMoreElements()) {
     129 + Object obj = en.nextElement();
     130 + if (node.equals(obj)) {
     131 + return (JClass) obj;
     132 + }
     133 + }
     134 + return null;
    123 135   }
    124 136   
    125 137   public boolean isFlatPackages() {
    skipped 32 lines
  • ■ ■ ■ ■ ■
    jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
    skipped 75 lines
    76 76   
    77 77   private JTree tree;
    78 78   private DefaultTreeModel treeModel;
     79 + private JRoot treeRoot;
    79 80   private TabbedPane tabbedPane;
    80 81   
    81 82   public MainWindow(JadxWrapper wrapper) {
    skipped 34 lines
    116 117   }
    117 118   
    118 119   private void initTree() {
    119  - JRoot treeRoot = new JRoot(wrapper);
     120 + treeRoot = new JRoot(wrapper);
    120 121   treeModel.setRoot(treeRoot);
    121 122   treeModel.reload();
    122 123   tree.expandRow(0);
    skipped 29 lines
    152 153   return;
    153 154   }
    154 155   JClass jCls = selectedCodePanel.getCls();
     156 + if (jCls.getParent() == null && treeRoot != null) {
     157 + // node not register in tree
     158 + jCls = treeRoot.searchClassInTree(jCls);
     159 + if (jCls == null) {
     160 + LOG.error("Class not found in tree");
     161 + return;
     162 + }
     163 + }
    155 164   TreeNode[] pathNodes = treeModel.getPathToRoot(jCls);
    156 165   if (pathNodes == null) {
    157 166   return;
    158 167   }
    159 168   TreePath path = new TreePath(pathNodes);
    160 169   tree.setSelectionPath(path);
    161  - tree.expandPath(path);
    162 170   tree.makeVisible(path);
    163 171   }
    164 172   
    skipped 257 lines
Please wait...
Page is in error, reload to recover