jadx icon indicating copy to clipboard operation
jadx copied to clipboard

[gui] Passed `--mappings-path` gets immediately overriden

Open NebelNidas opened this issue 1 year ago • 2 comments

Here, the path is still present: https://github.com/skylot/jadx/blob/e9a7ccd00c1a372ed6f6bdbf3701d6cb2bfa0a12/jadx-gui/src/main/java/jadx/gui/JadxWrapper.java#L64

Only to get overridden in jadx.gui.settings.JadxProject#fillJadxArgs two lines later:

  • https://github.com/skylot/jadx/blob/e9a7ccd00c1a372ed6f6bdbf3701d6cb2bfa0a12/jadx-gui/src/main/java/jadx/gui/JadxWrapper.java#L66
  • https://github.com/skylot/jadx/blob/e9a7ccd00c1a372ed6f6bdbf3701d6cb2bfa0a12/jadx-gui/src/main/java/jadx/gui/settings/JadxProject.java#L68

NebelNidas avatar Jun 03 '23 09:06 NebelNidas

IMO, CLI args should have priority over the already present options. In my original PR, that's how it was handled, but it also didn't modify the project settings so the override wasn't permanent.

NebelNidas avatar Jun 03 '23 09:06 NebelNidas

CLI args should have priority over the already present options

Agree, but only on first load, otherwise you will not be able open another mapping (it will be overwritten by cli args) So, we need to update project params from cli args, and next always use project params.

BTW, looks like I forgot to move mapping path and other mapping arg to plugin options, this will also help to use more common approach for handling params.

skylot avatar Jun 03 '23 14:06 skylot