skylot / jadx

Dex to Java decompiler
Apache License 2.0
40.9k stars 4.81k forks source link

Excluded Packages doesn't exclude packages when saving #534

Open dazzleworth opened 5 years ago

dazzleworth commented 5 years ago

The File -> Preferences -> Excluded packages (Edit) is supposed to exclude from the decompiler, but how to exclude when saving with the Save All button Ctrl + S?

All files get saved.

asashour commented 5 years ago

Is this a bug, or a feature? :)

skylot commented 5 years ago

It is a bug. Actually, this feature implementation not completed yet. And I am not sure how to correctly fix that. I want to move this exclude list to the core and cli, but this will hide all excluded classes in UI so it will be impossible to revert exclusion. Or we can just somehow fix saveAll method in jadx-gui (like passing class list to getSaveExecutor()). Or add flag EXCLUDED which will include class in list but will exclude from saving.

asashour commented 5 years ago

I have to say I don'y fully understand.

I guess we exclude packages, not classes.

I want to move this exclude list to the core and cli, but this will hide all excluded classes in UI so it will be impossible to revert exclusion.

I guess the only way to have CLI handles it, is to have an --excluded flag, and this can be reverted by the UI.

Or add flag EXCLUDED which will include class in list but will exclude from saving.

Is list here decompilation class list, or UI shown tree? I guess decompilation class list.

I guess I miss the question of "what is meant by exclusion?"

  1. They don't exist, so they are not decompiled, not shown and references to them will be empty.
  2. Or they are hidden from some parts of the process.
skylot commented 5 years ago

I guess we exclude packages, not classes.

No. We exclude classes

I guess the only way to have CLI handles it, is to have an --excluded flag, and this can be reverted by the UI.

It is exactly what I mean. But if we exclude classes in core and methods like getClasses() will not contains them. Than UI will don't know anything about such classes and packages, and excluded classes will be completely excluded from UI and user can't bring them back using right click menu.

Is list here decompilation class list, or UI shown tree?

UI build tree from classes in decompilation class list

I guess I miss the question of "what is meant by exclusion?"

Classes must be excluded from decompilation process and must be hidden in UI tree, but excluded packages must be show in "gray" and allow to undo exclusion.

And now, I think, I have a plan how to do it:

dazzleworth commented 5 years ago

image

image

image

image

No worries, I did it already. How to I push ?

dazzleworth commented 5 years ago

@skylot Your decompiler is too difficult to extend.

For example, JadxDecompiler is final which means Im not able to extend it so easily.

There are many others, that isnt possible to share here.

asashour commented 5 years ago

@skylot Your decompiler is too difficult to extend.

You can always raise a PR to change that. What is the missing thing you want to add?

Although I think extending/fixing the decompiler, means changing other classes.

asashour commented 5 years ago

No worries, I did it already. How to I push ?

Great! There are plenty of articles of how to do that, e.g. here.

The steps are mainly:

  1. Forking jadx and cloning your repository locally.
  2. Create a new branch for the issue
  3. Push your branch.
  4. Create a PR

These can be done by command line or from your IDE (you don't need to sign commits).

If you need any help, we are here. You can also send your changes as java files, and I can create the PR.