Recaf icon indicating copy to clipboard operation
Recaf copied to clipboard

Unable to generate missing classes

Open rikka0w0 opened this issue 3 years ago • 2 comments

I was trying to edit a java8 jar. The jar has many dependencies that are hard to collect. I saw there is a "Generate missing classes" option in the Config dialog, but even if I enabled it explicitly, when I edited the java code and hit ctrl+s, it still complains about "package xxx does not exist" and "cannot find symbol". Is there any limitation of this feature?

rikka0w0 avatar Jul 02 '22 05:07 rikka0w0

The generate missing classes is done via a slightly modified version of JPhantom. Its pretty cool, but unfortunately can be a bit unstable at times. Plus, its behavior isn't even deterministic. There is an element of randomness to it which means it sometimes will not work at all, but will work when you try the exact same thing again later.

Our modified version attempts to use some insights into the input to speed up computation time. But sometimes the optimal guess order cannot yield a solution and we fall-back to the original random behavior.

We want to eventually migrate to something that does not rely at all on random order.

Col-E avatar Jul 02 '22 05:07 Col-E

That's for the information. My modifications are now done by manual byte code editing.

rikka0w0 avatar Jul 02 '22 19:07 rikka0w0