Search in sources :

Example 1 with ExportTask

use of jadx.gui.jobs.ExportTask in project jadx by skylot.

the class MainWindow method saveAll.

private void saveAll(boolean export) {
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    fileChooser.setToolTipText(NLS.str("file.save_all_msg"));
    Path currentDirectory = settings.getLastSaveFilePath();
    if (currentDirectory != null) {
        fileChooser.setCurrentDirectory(currentDirectory.toFile());
    }
    int ret = fileChooser.showSaveDialog(mainPanel);
    if (ret == JFileChooser.APPROVE_OPTION) {
        JadxArgs decompilerArgs = wrapper.getArgs();
        decompilerArgs.setExportAsGradleProject(export);
        if (export) {
            decompilerArgs.setSkipSources(false);
            decompilerArgs.setSkipResources(false);
        } else {
            decompilerArgs.setSkipSources(settings.isSkipSources());
            decompilerArgs.setSkipResources(settings.isSkipResources());
        }
        settings.setLastSaveFilePath(fileChooser.getCurrentDirectory().toPath());
        backgroundExecutor.execute(new ExportTask(this, wrapper, fileChooser.getSelectedFile()));
    }
}
Also used : Path(java.nio.file.Path) TreePath(javax.swing.tree.TreePath) ExportTask(jadx.gui.jobs.ExportTask) JFileChooser(javax.swing.JFileChooser) JadxArgs(jadx.api.JadxArgs)

Aggregations

JadxArgs (jadx.api.JadxArgs)1 ExportTask (jadx.gui.jobs.ExportTask)1 Path (java.nio.file.Path)1 JFileChooser (javax.swing.JFileChooser)1 TreePath (javax.swing.tree.TreePath)1