提交 58365a89 编写于 作者: A Ahmed Ashour 提交者: skylot

fix(gui): remove tree children expansions as well (PR #630)

上级 172f7f75
...@@ -78,13 +78,26 @@ public class JadxProject { ...@@ -78,13 +78,26 @@ public class JadxProject {
public void removeTreeExpansion(String[] expansion) { public void removeTreeExpansion(String[] expansion) {
for (Iterator<String[]> it = treeExpansions.iterator(); it.hasNext(); ) { for (Iterator<String[]> it = treeExpansions.iterator(); it.hasNext(); ) {
if (Arrays.equals(it.next(), expansion)) { if (isParentOfExpansion(expansion, it.next())) {
it.remove(); it.remove();
} }
} }
changed(); changed();
} }
private boolean isParentOfExpansion(String[] parent, String[] child) {
if (Arrays.equals(parent, child)) {
return true;
}
for (int i = child.length - parent.length; i > 0; i--) {
String[] arr = Arrays.copyOfRange(child, i, child.length);
if (Arrays.equals(parent, arr)) {
return true;
}
}
return false;
}
private void changed() { private void changed() {
if (settings.isAutoSaveProject()) { if (settings.isAutoSaveProject()) {
save(); save();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册