AndreMiras / EtherollApp

Provably fair dice game running on the Ethereum blockchain
MIT License
57 stars 22 forks source link

App collapsed when i denied access to my media. #141

Closed darewealth closed 5 years ago

darewealth commented 5 years ago

Describe the bug.

When the app I launched the app on my gionee device, I denied access to my media and other files. Then when I clicked on the settings to change Mainet to Testnet, and I clicked on the back arrow on the app, it asked for the access again and I denied and the app collapsed.

Steps to reproduce.

Expected Behaviour

I expect that I should be able to use the app without granting access to my file. Besides, it shouldn't collapse.

Screen recording

https://youtu.be/wW7OlUJoY8k

Devices and Versions):)

Log


05-02 12:41:49.866  4098  4098 I snet_event_log: [permissions_requested,10201,com.github.andremiras.etheroll:android.permission-group.STORAGE|false|1]
05-02 12:41:49.874  1311  1331 I am_finish_activity: [0,13293485,8134,com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity,app-request]
05-02 12:41:49.877  1311  1331 I am_home_stack_moved: [0,0,1,1,finishActivity adjustFocus setFocusedActivity]
05-02 12:41:49.877  1311  1331 I wm_task_moved: [8134,1,12]
05-02 12:41:49.881  1311  1331 I am_focused_activity: [0,com.github.andremiras.etheroll/org.kivy.android.PythonActivity]
05-02 12:41:49.882  1311  1331 I am_pause_activity: [0,13293485,com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity]
05-02 12:41:49.908  4098  4098 I am_on_paused_called: [0,com.android.packageinstaller.permission.ui.GrantPermissionsActivity]
05-02 12:41:49.911  1311  3287 I am_resume_activity: [0,133491771,8134,com.github.andremiras.etheroll/org.kivy.android.PythonActivity]
05-02 12:41:49.917  3773  3773 I am_on_resume_called: [0,org.kivy.android.PythonActivity]
05-02 12:41:49.993  1311  1331 I am_destroy_activity: [0,13293485,8134,com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity,finish-imm]
05-02 12:41:50.120  1311  3216 I am_proc_died: [0,4139,com.android.cellbroadcastreceiver]
05-02 12:41:51.118  1311  3215 I am_proc_start: [0,4193,10045,com.google.process.gapps,content provider,com.google.android.gsf/.gservices.GservicesProvider]
05-02 12:41:51.191  1311  3217 I am_proc_bound: [0,4193,com.google.process.gapps]
05-02 12:41:54.449  1311  3215 I am_home_stack_moved: [0,0,1,1,sourceStackToFront]
05-02 12:41:54.449  1311  3215 I wm_task_moved: [8134,1,12]
05-02 12:41:54.454  1311  3215 I am_create_activity: [0,230046542,8134,com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity,android.content.pm.action.REQUEST_PERMISSIONS,NULL,NULL,8388608]
05-02 12:41:54.455  1311  3215 I am_pause_activity: [0,133491771,com.github.andremiras.etheroll/org.kivy.android.PythonActivity]
05-02 12:41:54.462  1311  3215 I am_home_stack_moved: [0,0,1,1,startedActivity setFocusedActivity]
05-02 12:41:54.462  1311  3215 I wm_task_moved: [8134,1,12]
05-02 12:41:54.470  1311  3215 I am_focused_activity: [0,com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity]
05-02 12:41:54.551  3773  3773 I am_on_paused_called: [0,org.kivy.android.PythonActivity]
05-02 12:41:54.556  1311  1562 I am_restart_activity: [0,230046542,8134,com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity]
05-02 12:41:54.761  4098  4098 I am_on_resume_called: [0,com.android.packageinstaller.permission.ui.GrantPermissionsActivity]
05-02 12:41:55.059  1311  1427 I am_activity_launch_time: [0,230046542,com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity,507,507]
05-02 12:41:55.178  1311  1331 I am_proc_died: [0,3444,com.android.settings]```
AndreMiras commented 5 years ago

Nice bug report thank you! I assume this is the last version v2019.0426 not yet published on F-Droid right? I hope I'll be able to work on the bug next week

AndreMiras commented 5 years ago

Sentry issue: ETHEROLL-BE-2D

AndreMiras commented 5 years ago

Juste a little update. I've been more busy than expected so I couldn't work on it as expected. However I think it's worth knowing what happens and what are the options. As far as I know Android apps have 3 places to store and read files:

  1. private app dir getFilesDir() hidden from users; deleted with the app
  2. public app dir getExternalFilesDir() accessible to users; deleted with the app
  3. public external dir getExternalStoragePublicDirectory()- persists even when the app is deleted

We're currently using getExternalStoragePublicDirectory() method for storing everything (keys and settings) so we're sure the user never loses anything. However the third method requires dynamic read/write permission. So when we decline it, the app still tries to read/write settings from there and crashes. So I'd like to make 2 the new default and 3 optional, but it brings quite some "complexity" as it has more scenario e.g.

But we'll get there :smile:

AndreMiras commented 5 years ago

It's fixed in the develop branch, but not yet release to the F-Droid market. I still want to address a couple of related things before making a new release. So there's now an option to persist keystore to the external storage (sdcard), see bottom of the screenshot. This is not the default, which means permissions won't be mandatory to use the app. However uninstalling the app would also drop the keystore. Etheroll settings

AndreMiras commented 5 years ago

Hi @darewealth I just made a release that integrate the fix. It should (hopefully) be available on the F-Droid next week, but you can also pick it up from here before it propagates to the F-Droid market. https://github.com/AndreMiras/EtherollApp/releases/tag/v2019.0624