You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When decompiling the Java code, there are inconsistencies in handling floating-point numbers and boolean operations. The decompiled code introduces unnecessary type casting and operations, which differ from the original code.
In the decompiled version, unnecessary type casting to (double) was added. This differs from the original code and can lead to precision issues or unwanted behavior.
Issue 2 - Boolean XOR Operator: Original Java code:
In the decompiled version, true ^ booleans[4] was added unnecessarily, replacing !booleans[4]. This change alters the logic and is not faithful to the original intent.
Expected Behavior: The decompiled code should match the original source code without introducing unnecessary operations, type casting, or logical alterations.
** If you examine the full decompiled and original Array.java, you will see many instances of incorrect code.
In the decompiled version, true ^ booleans[4] was added unnecessarily, replacing !booleans[4]. This change alters the logic and is not faithful to the original intent.
true ^ booleans[4] (true xor a) is the same as !booleans[4] (!a) thus the logic has not changed. If you look at the smali code you will see that the actual smali code of checkBooleans uses indeed true ^ a in both cases. Therefore Jadx had already simplified the code in one case but not in the other. For code consistency I agree that it would be better to output in both cases ! instead of the true ^ ... version.
In case of checkFloats as far as I can see the generated code matches the smali code and also your java code. The constant numbers you have in your code are of type double and to compare them the Java compiler converts the floats to double. Therefore the only difference is the optional type case of the floats to double.
Issue details
When decompiling the Java code, there are inconsistencies in handling floating-point numbers and boolean operations. The decompiled code introduces unnecessary type casting and operations, which differ from the original code.
Issue 1 - Float Type Casting: Original Java code:
Decompiled Java code:
In the decompiled version, unnecessary type casting to (double) was added. This differs from the original code and can lead to precision issues or unwanted behavior.
Issue 2 - Boolean XOR Operator: Original Java code:
Decompiled Java code:
In the decompiled version, true ^ booleans[4] was added unnecessarily, replacing !booleans[4]. This change alters the logic and is not faithful to the original intent.
Expected Behavior: The decompiled code should match the original source code without introducing unnecessary operations, type casting, or logical alterations.
** If you examine the full decompiled and original Array.java, you will see many instances of incorrect code.
Relevant log output or stacktrace
Provide sample and class/method full name
attachments.zip
Jadx version
latest unstable version
The text was updated successfully, but these errors were encountered: