mirror of
https://github.com/SuspiciousActivity/ByteEdit.git
synced 2026-08-13 17:56:17 +00:00
Fixed some bugs with deleting and adding classes
This commit is contained in:
1 parent
d492b79a8f
commit
e4cc2e5489
1 file changed
+20
-6
@@ -272,9 +272,22 @@ public class Main extends JFrame {
|
|||||||
return;
|
return;
|
||||||
if (JOptionPane.showConfirmDialog(INSTANCE, "Do you want to delete\n\"" + s + "\"?", "Delete",
|
if (JOptionPane.showConfirmDialog(INSTANCE, "Do you want to delete\n\"" + s + "\"?", "Delete",
|
||||||
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
||||||
classNodes.remove(s);
|
String substr = s.substring(0, s.length() - 6);
|
||||||
|
ArrayList<String> toRemove = new ArrayList<>();
|
||||||
|
for (String key : Main.classNodes.keySet()) {
|
||||||
|
if (key.contains("$")) {
|
||||||
|
String[] split = key.split("\\$");
|
||||||
|
if (split[0].equals(substr)) {
|
||||||
|
toRemove.add(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ArchiveTreeModel model = (ArchiveTreeModel) tree.getModel();
|
ArchiveTreeModel model = (ArchiveTreeModel) tree.getModel();
|
||||||
|
classNodes.remove(s);
|
||||||
model.paths.remove(s);
|
model.paths.remove(s);
|
||||||
|
for (String rem : toRemove) {
|
||||||
|
classNodes.remove(rem);
|
||||||
|
}
|
||||||
model.refresh();
|
model.refresh();
|
||||||
model.reload();
|
model.reload();
|
||||||
}
|
}
|
||||||
@@ -667,11 +680,12 @@ public class Main extends JFrame {
|
|||||||
} else {
|
} else {
|
||||||
model = (ArchiveTreeModel) tree.getModel();
|
model = (ArchiveTreeModel) tree.getModel();
|
||||||
}
|
}
|
||||||
if (node.name.contains("/") ? (!node.name.split("/")[node.name.split("/").length - 1].contains("$"))
|
String name = node.name + ".class";
|
||||||
: (!node.name.contains("$"))) {
|
if (name.contains("/") ? (!name.split("/")[name.split("/").length - 1].contains("$"))
|
||||||
model.paths.add(node.name + ".class");
|
: (!name.contains("$"))) {
|
||||||
} else if (node.name.startsWith("$") || node.name.contains("$$") || node.name.endsWith("$")) { // obfuscated
|
model.paths.add(name);
|
||||||
model.paths.add(node.name + ".class");
|
} else if (name.startsWith("$") || name.contains("$$") || name.endsWith("$")) { // obfuscated
|
||||||
|
model.paths.add(name);
|
||||||
}
|
}
|
||||||
model.refresh();
|
model.refresh();
|
||||||
model.reload();
|
model.reload();
|
||||||
|
|||||||
Reference in new issue
Block a user