Open simvesel opened 1 year ago
Exists method SharedPreferences#contains: https://developer.android.com/reference/android/content/SharedPreferences#contains(java.lang.String)
Then you can simplify the code of the following functions: https://github.com/freeotp/freeotp-android/blob/67f1c1c2261adb67db1aee9f980f89c0194207ed/mobile/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java#L79 https://github.com/freeotp/freeotp-android/blob/67f1c1c2261adb67db1aee9f980f89c0194207ed/mobile/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java#L103-L110
In general it is incorrect compare String like as this: if (key == restore_uuid) {
if (key == restore_uuid) {
Thank you for the recommendation, PRs are welcome.
I'm sorry, but I don't have the Android SDK installed to change code and make unit tests.
Exists method SharedPreferences#contains: https://developer.android.com/reference/android/content/SharedPreferences#contains(java.lang.String)
Then you can simplify the code of the following functions: https://github.com/freeotp/freeotp-android/blob/67f1c1c2261adb67db1aee9f980f89c0194207ed/mobile/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java#L79 https://github.com/freeotp/freeotp-android/blob/67f1c1c2261adb67db1aee9f980f89c0194207ed/mobile/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java#L103-L110
In general it is incorrect compare String like as this:
if (key == restore_uuid) {