Search in sources :

Example 1 with MainWindow

use of jadx.gui.ui.MainWindow in project jadx by skylot.

the class QuarkReportPanel method resolveMethod.

public MutableTreeNode resolveMethod(String descr) {
    try {
        String[] parts = removeQuotes(descr).split(" ", 3);
        String cls = Utils.cleanObjectName(parts[0].replace('$', '.'));
        String mth = parts[1] + parts[2].replace(" ", "");
        MainWindow mainWindow = getTabbedPane().getMainWindow();
        JadxWrapper wrapper = mainWindow.getWrapper();
        JavaClass javaClass = wrapper.searchJavaClassByRawName(cls);
        if (javaClass == null) {
            return new TextTreeNode(cls + "." + mth);
        }
        JavaMethod javaMethod = javaClass.searchMethodByShortId(mth);
        if (javaMethod == null) {
            return new TextTreeNode(javaClass.getFullName() + "." + mth);
        }
        return new MethodTreeNode(javaMethod);
    } catch (Exception e) {
        LOG.error("Failed to parse method descriptor string", e);
        return new TextTreeNode(descr);
    }
}
Also used : JadxWrapper(jadx.gui.JadxWrapper) JavaClass(jadx.api.JavaClass) MainWindow(jadx.gui.ui.MainWindow) JavaMethod(jadx.api.JavaMethod)

Example 2 with MainWindow

use of jadx.gui.ui.MainWindow in project jadx by skylot.

the class QuarkManager method start.

public void start() {
    if (!checkFileSize(LARGE_APK_SIZE)) {
        int result = JOptionPane.showConfirmDialog(mainWindow, "The selected file size is too large (over 30M) that may take a long time to analyze, do you want to continue", "Quark: Warning", JOptionPane.YES_NO_OPTION);
        if (result == JOptionPane.NO_OPTION) {
            return;
        }
    }
    BackgroundExecutor executor = mainWindow.getBackgroundExecutor();
    executor.execute("Quark install", this::checkInstall, installStatus -> executor.execute("Quark analysis", this::startAnalysis, analysisStatus -> loadReport()));
}
Also used : SystemInfo(jadx.gui.utils.SystemInfo) Logger(org.slf4j.Logger) Files(java.nio.file.Files) LoggerFactory(org.slf4j.LoggerFactory) JadxRuntimeException(jadx.core.utils.exceptions.JadxRuntimeException) JOptionPane(javax.swing.JOptionPane) InputStreamReader(java.io.InputStreamReader) File(java.io.File) ArrayList(java.util.ArrayList) BackgroundExecutor(jadx.gui.jobs.BackgroundExecutor) List(java.util.List) Paths(java.nio.file.Paths) UiUtils(jadx.gui.utils.UiUtils) JRoot(jadx.gui.treemodel.JRoot) BufferedReader(java.io.BufferedReader) MainWindow(jadx.gui.ui.MainWindow) Path(java.nio.file.Path) BackgroundExecutor(jadx.gui.jobs.BackgroundExecutor)

Example 3 with MainWindow

use of jadx.gui.ui.MainWindow in project jadx by skylot.

the class JadxGUI method main.

public static void main(String[] args) {
    try {
        LogCollector.register();
        JadxSettings settings = JadxSettingsAdapter.load();
        settings.setLogLevel(LogHelper.LogLevelEnum.INFO);
        // overwrite loaded settings by command line arguments
        if (!settings.overrideProvided(args)) {
            return;
        }
        printSystemInfo();
        LafManager.init(settings);
        NLS.setLocale(settings.getLangLocale());
        SwingUtilities.invokeLater(new MainWindow(settings)::init);
    } catch (Exception e) {
        LOG.error("Error: {}", e.getMessage(), e);
        System.exit(1);
    }
}
Also used : MainWindow(jadx.gui.ui.MainWindow) JadxSettings(jadx.gui.settings.JadxSettings)

Aggregations

MainWindow (jadx.gui.ui.MainWindow)3 JavaClass (jadx.api.JavaClass)1 JavaMethod (jadx.api.JavaMethod)1 JadxRuntimeException (jadx.core.utils.exceptions.JadxRuntimeException)1 JadxWrapper (jadx.gui.JadxWrapper)1 BackgroundExecutor (jadx.gui.jobs.BackgroundExecutor)1 JadxSettings (jadx.gui.settings.JadxSettings)1 JRoot (jadx.gui.treemodel.JRoot)1 SystemInfo (jadx.gui.utils.SystemInfo)1 UiUtils (jadx.gui.utils.UiUtils)1 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 InputStreamReader (java.io.InputStreamReader)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1 Paths (java.nio.file.Paths)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 JOptionPane (javax.swing.JOptionPane)1 Logger (org.slf4j.Logger)1