jadx icon indicating copy to clipboard operation
jadx copied to clipboard

[feature] Accessibility improvements with keyboard shortcuts

Open Surendrajat opened this issue 5 years ago • 6 comments

Describe your idea:

So it took me a while to figure out that CTRL + Click is the shortcut for Go to declaration. It's common for IDEs but not so common among popular RE tools. Cutter, JEB, IDA, Binary Ninja… etc. all use almost the same shortcuts, and it'll be nice to see these common shortcuts also present in Jadx. A few of them are:

Action Shortcut(s) Status
Go to declaration Double-Click :heavy_check_mark:
Find Usage (cross-ref) X :heavy_check_mark:
Rename N :heavy_check_mark:
Back ESC :heavy_check_mark:
Forward ALT + :heavy_check_mark:
Smali ⇄ Java (Tab) :heavy_check_mark:
CFG ⇄ Java/Smali (Space) NYI
Add a comment ; :heavy_check_mark:
View all comments CTRL + ; :heavy_check_mark:
Save Project CTRL + S
Save Project as.. CTRL + SHIFT + S

:heavy_check_mark: ⇒ Done NYI ⇒ (Feature) Not Yet Implemented

Hopefully, it will help users of other tools feel right at home using Jadx and I feel it's much faster to navigate read-only code with a single keystroke.

Please let me know what you think of it. Thanks.

Surendrajat avatar Jan 16 '21 11:01 Surendrajat

@Surendrajat thank you for this shortcuts list! I don't have much experience in using RE tools, so I made most of the shortcuts the same as in IntelliJ IDEA. I will try to add your shortcuts suggestions, but here several issues:

  • double-click action currently used to mark all occurrence of the symbol, not sure if it is useful, but it is default in the editor widget jadx used (RSyntaxTextArea). I need to check if this can be changed.
  • editor doesn't have a visible caret now, so there is no current symbol for shortcut action. It is possible to show caret or use a symbol under the mouse, not sure what is better.

Anyway, as you stated, jadx is missing a full list of all shortcuts. I made a short list as a jadx-gui features overview link in readme. But looks like it must be a simple list explicitly stated in readme.

skylot avatar Jan 16 '21 12:01 skylot

@skylot Thanks for replying.

About issues:

  1. All RE tools(and IDEA) select and highlight a symbol on a single-click so double-click is free to use. I hope the library you use allows you to do that. Also note, they highlight symbol occurrences only in the symbol scope and not all occurrences in the file.
  2. You can do both if possible. So if you implement the first one(ie. single-click selects the symbol, double-click jumps to definition) single-click can bring the cursor to the symbol, and a moving cursor on a symbol will also select and highlight the symbol so that the selected symbol is always under the cursor.

See below screenshot from JEB (same in other tools too):

jeb_symbol_selection

Also, I found out that Jadx supports projects now (yey!) so I have added shortcuts for saving projects. I know Jadx have CTRL + S for 'Save All' but if you think projects work good, hope you can reassign it.

Also also, I saw an issue and found out that you will be adding support for adding comments in the source(thanks a lot), I've added comment related shortcuts too.

Surendrajat avatar Jan 16 '21 14:01 Surendrajat

@skylot

Also, I found out that Jadx supports projects now (yey!) so I have added shortcuts for saving projects. I know Jadx have CTRL + S for 'Save All' but if you think projects work good, hope you can reassign it.

I was wondering if you have considered this. Most shortcuts for existing features are implemented now. If projects are in good shape, I want to default to projects.

Surendrajat avatar Jan 31 '21 06:01 Surendrajat

@Surendrajat Sure, project shortcuts are good. And for 'saving' actions, I think, we need to make a single export action with a new shortcut and options in dialog window like:

  • [ ] export as a Gradle project
  • [ ] don't save classes from excluded packages
  • [ ] don't save resources
  • [ ] ... etc

If projects are in good shape

Project is a little useless now because it only saved opened files and tree state, all other settings are global now. I plan to save in projects also:

  • open tabs
  • window sizes and positions
  • all user renaming (#1022)
  • comments (#359)
  • maybe an override of global settings

skylot avatar Jan 31 '21 07:01 skylot

Sure, project shortcuts are good.

Cool.

And for 'saving' actions, I think, we need to make a single export action with a new shortcut..

We can reuse the same CTRL + E for that.?

I was thinking project stored renames and all, but now I see why that jobf file was hanging around :)

Anyway I think it's probably better to making the project feature the default for save option and incrementally add the missing bits.

Surendrajat avatar Jan 31 '21 11:01 Surendrajat

We can reuse the same CTRL + E for that.?

Yeah, it is ok

I think it's probably better to making the project feature the default for save option and incrementally the missing bits.

I agree :)

skylot avatar Jan 31 '21 14:01 skylot

Now is possible to customize shortcuts. The feature was implemented by @Mino260806 in PR #1980.

skylot avatar Aug 03 '23 19:08 skylot