use of jadx.gui.settings.JadxProject in project jadx by skylot.
the class CommentDialog method updateCommentsData.
private static void updateCommentsData(CodeArea codeArea, Consumer<List<ICodeComment>> updater) {
try {
JadxProject project = codeArea.getProject();
JadxCodeData codeData = project.getCodeData();
if (codeData == null) {
codeData = new JadxCodeData();
}
List<ICodeComment> list = new ArrayList<>(codeData.getComments());
updater.accept(list);
Collections.sort(list);
codeData.setComments(list);
project.setCodeData(codeData);
codeArea.getMainWindow().getWrapper().getDecompiler().reloadCodeData();
} catch (Exception e) {
LOG.error("Comment action failed", e);
}
try {
// refresh code
codeArea.refreshClass();
} catch (Exception e) {
LOG.error("Failed to reload code", e);
}
}
use of jadx.gui.settings.JadxProject in project jadx by skylot.
the class CommentDialog method searchForExistComment.
private static ICodeComment searchForExistComment(CodeArea codeArea, ICodeComment blankComment) {
try {
JadxProject project = codeArea.getProject();
JadxCodeData codeData = project.getCodeData();
if (codeData == null || codeData.getComments().isEmpty()) {
return null;
}
for (ICodeComment comment : codeData.getComments()) {
if (Objects.equals(comment.getNodeRef(), blankComment.getNodeRef()) && Objects.equals(comment.getCodeRef(), blankComment.getCodeRef())) {
return comment;
}
}
} catch (Exception e) {
LOG.error("Error searching for exists comment", e);
}
return null;
}
use of jadx.gui.settings.JadxProject in project jadx by skylot.
the class RenameDialog method updateCodeRenames.
private void updateCodeRenames(Consumer<Set<ICodeRename>> updater) {
JadxProject project = mainWindow.getProject();
JadxCodeData codeData = project.getCodeData();
if (codeData == null) {
codeData = new JadxCodeData();
}
Set<ICodeRename> set = new HashSet<>(codeData.getRenames());
updater.accept(set);
List<ICodeRename> list = new ArrayList<>(set);
Collections.sort(list);
codeData.setRenames(list);
project.setCodeData(codeData);
mainWindow.getWrapper().getDecompiler().reloadCodeData();
}
use of jadx.gui.settings.JadxProject in project jadx by skylot.
the class MainWindow method openProject.
private void openProject(Path path) {
if (!ensureProjectIsSaved()) {
return;
}
JadxProject jadxProject = JadxProject.from(path);
if (jadxProject == null) {
JOptionPane.showMessageDialog(this, NLS.str("msg.project_error"), NLS.str("msg.project_error_title"), JOptionPane.INFORMATION_MESSAGE);
jadxProject = new JadxProject();
}
updateProject(jadxProject);
settings.addRecentProject(path);
List<Path> filePaths = jadxProject.getFilePaths();
if (filePaths == null) {
clearTree();
} else {
open(filePaths);
}
}
use of jadx.gui.settings.JadxProject in project jadx by skylot.
the class MainWindow method newProject.
private void newProject() {
if (!ensureProjectIsSaved()) {
return;
}
cancelBackgroundJobs();
clearTree();
wrapper.close();
updateProject(new JadxProject());
}
Aggregations