Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GUI]CommonSearchDialog::openSelectedItem closes search dialog once item selected. #1032

Closed
4B5F5F4B opened this issue Nov 25, 2020 · 2 comments

Comments

@4B5F5F4B
Copy link

4B5F5F4B commented Nov 25, 2020

Hi,

JADX is my favorite APK reverse engineering tool but one thing annoys me a lot. Whenever I selects code snippet in search dialog and jumps to the code, search dialog will close. So I have to open search dialog again if I want to continue my searching.

I notice there's a dispose function called in CommonSearchDialog::openSelectedItem

protected void openSelectedItem() 
{
		int selectedId = resultsTable.getSelectedRow();
		if (selectedId == -1) {
			return;
		}
		JNode node = (JNode) resultsModel.getValueAt(selectedId, 0);
		tabbedPane.codeJump(new JumpPosition(node.getRootClass(), node.getLine()));

		dispose();
}

I tries to patch the code like this

protected void openSelectedItem() 
{
		int selectedId = resultsTable.getSelectedRow();
		if (selectedId == -1) {
			return;
		}
		JNode node = (JNode) resultsModel.getValueAt(selectedId, 0);
		tabbedPane.codeJump(new JumpPosition(node.getRootClass(), node.getLine()));

		//dispose();
}

Then search dialog will not close any longer:)

@jpstotz
Copy link
Collaborator

jpstotz commented Nov 27, 2020

I also wanted to implement something similar but until now I have not managed to do so.
I think the main problem is that just disabling is in my opinion not a good option. The search dialog is a "multi-purpose dialog used several times within Jadx and not always it is the best solution to keep it open.

I had something in mind where there is a checkbox in the search dialog to "keep it open". What do you think of such a solution?

skylot pushed a commit that referenced this issue Jan 30, 2021
Co-authored-by: tobias <tobias.hotmail.com>
@skylot
Copy link
Owner

skylot commented Jan 30, 2021

Added in PR #1108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants