Closed eybisi closed 5 days ago
@eybisi thanks for test case! Actually, right now I am working on a new approach for break/continue handling (related to #2339), so it affects loops and switches. And I will add your test case into that change, it may take some time though :slightly_smiling_face:
vineflower or fernflower handles this case, maybe it's worth looking at how they perform code generation for such cases...
Fixed. Cause of the issue was incorrect checks for empty default case, hope fix will cover all cases. Also, rework mentioned above, not going well and will be postponed, so I made a fix just for this case.
Issue details
if switch is inside endless while loop, (while(true)) default switch branch is always discarded and lost. Following java code:
results in:
I've attached sample app.
Relevant log output or stacktrace
Provide sample and class/method full name
app-debug.zip
class : org.abc.obfusactiontests.MainActivity method : jadxEndlessSwitch
Jadx version
dev