I decompiled an apk and see many while loops that return immediately only to be followed by other code:
while (true){
return;
if (!cond1){
continue;
}
if (cond2){
continue;
}
}
If you wanted to produce this code in a decompile, what Java code would you write to get there?
Note. The decompile process is apktool -> baksmali -> smali -> dex2jar
EDIT
I can't actually get at the original Java bytecode from the Android APK (at least I don't know how to). It may be that my tools are doing a poor reverse-engineering job, but here is what the output of smali is:
:goto_8
return-void
.line 40
:sswitch_9
const/4 v0, 0x0
iput v0, p0, Lcom/sec/android/app/camera/command/ContextualTagSelectCommand;->mContextualTag:I
goto :goto_8
.line 44
:sswitch_d
const/4 v0, 0x1
iput v0, p0, Lcom/sec/android/app/camera/command/ContextualTagSelectCommand;->mContextualTag:I
goto :goto_8
Which corresponds to:
while (true)
{
return;
this.mContextualTag = 0;
continue;
this.mContextualTag = 1;
}