metinkale38 / prayer-times-android

A useful Application with a set of tools needed by every muslim.
https://play.google.com/store/apps/details?id=com.metinkale.prayer
Apache License 2.0
239 stars 105 forks source link

Crash app when accessing Restore / Backup feature #121

Closed rezamusic881 closed 4 years ago

rezamusic881 commented 6 years ago

Expected behavior

Supposedly, the Backup / Restore feature works normally and does not cause crashes in the application.

Actual behavior

When I click on the Backup / Restore feature in the settings feature, the Application stops automatically.

How to reproduce

  1. Get the Prayer Times app on F-Droid
  2. After you successfully install the app, Open the app.
  3. Enter the settings menu
  4. Click the Restore / Backup feature, then the app will stop.


Recording Of The Bug

https://youtu.be/PhQznzeUjSs

Logcat

05-17 00:52:58.149 12216 12216 E AndroidRuntime: FATAL EXCEPTION: main
05-17 00:52:58.149 12216 12216 E AndroidRuntime: Process: com.metinkale.prayer, PID: 12216
05-17 00:52:58.149 12216 12216 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.metinkale.prayer/com.metinkale.prayerapp.settings.BackupRestoreActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File com.metinkale.prayerapp.settings.BackupRestoreActivity$a.b(int)' on a null object reference
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2741)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2802)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at android.app.ActivityThread.-wrap12(ActivityThread.java)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1549)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:163)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6361)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
05-17 00:52:58.149 12216 12216 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File com.metinkale.prayerapp.settings.BackupRestoreActivity$a.b(int)' on a null object reference
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at com.metinkale.prayerapp.settings.BackupRestoreActivity.onItemClick(BackupRestoreActivity.java:83)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at com.metinkale.prayerapp.MainActivity.onCreate(MainActivity.java:151)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at com.metinkale.prayerapp.settings.BackupRestoreActivity.onCreate(BackupRestoreActivity.java:62)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at android.app.Activity.performCreate(Activity.java:6865)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2694)
05-17 00:52:58.149 12216 12216 E AndroidRuntime:    ... 9 more

Proof Of Work Done

http://www.github.com/rezamusic881

yasinkeles commented 6 years ago

Add the relevant activity into ProGuard will solve the problem