-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
mapping-io import support #1532
mapping-io import support #1532
Conversation
…files (will be moved to the cache dir in the future)
Also change `mapping-file` to `mappings-path`, since folders are supported, too
This pull request introduces 1 alert when merging ce2b021 into 1533b7f - view on LGTM.com new alerts:
|
@skylot Is there any way to determine during the decompilation's rename phase whether a local variable is present in bytecode or generated by the decompiler? And are the SSAVars' reg nums different to the VarNode ones? I can't use the |
I don't think it is possible. In short: bytecode only have registers next jadx split these registers into SSA variables (add version number for each register) and next in
Yes, those numbers are same |
@skylot Can you look at why the test is failing? It works fine on my machine 🤔 |
@NebelNidas |
Also, I think I will migrate your change to plugin by myself, so I will take your change once it ready and apply needed refactoring. |
Not really the case though. jadx/jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java Lines 428 to 431 in c5ed9e2
Or JadxArgs ' value is null (no launch arg set), but there is a mappings path stored in the current project's project file which only gets loaded into JadxProject .Same with JadxSettings : jadx/jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java Lines 422 to 425 in c5ed9e2
Now, I could update the values stored in |
Well, I understand your confusion, here are some details:
So JadxArgs purpose is to store all settings, other classes just wrappers to collect/store these settings. As for Also, you mention options update after initial loading: actually it is a big issue, because incremental code update is very error-prone, if you know what class code is changed you can use |
@NebelNidas I merged this PR into |
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from 18070eb That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
The follow-up to #1505, so you can now import your previously exported mappings. Partly addresses #1531.
Currently working:
[ ] Method varsnot feasible