jadx
jadx copied to clipboard
[core] Weird `if` conditions #2
Hey!
APK: https://drive.google.com/file/d/1XBpFGkIORvQkPu8sYaWFpSZ1ZI87QpxR/view?usp=sharing
File com/samsung/android/knox/location/GeofenceFactory.java
:
public static Geofence createGeofence(int i, Parcel parcel) {
if (i != 1) {
if (i != 2) {
if (i != 3) {
return null;
}
return new LinearGeofence(parcel);
}
return new PolygonalGeofence(parcel);
}
return new CircularGeofence(parcel);
}
This condition can be simplified to
public static Geofence createGeofence(int i, Parcel parcel) {
if (i == 1) {
return new CircularGeofence(parcel);
} else if (i == 2) {
return new PolygonalGeofence(parcel);
} else if (i == 3) {
return new LinearGeofence(parcel);
} else {
return null;
}
}
That would be great to keep positive conditions, but not negative
I don't think this is a bug.