openfoodfacts / openfoodfacts-androidapp

Native version of Open Food Facts on Android - Coders & Decoders welcome 🤳🥫
https://android.openfoodfacts.org
Apache License 2.0
764 stars 446 forks source link

Revoking permission at AddProductActivity crashes app #3967

Open aper-project opened 3 years ago

aper-project commented 3 years ago

Hi, there, I've found a crash in version 3.2.8, which is downloaded from F-Droid.

I seems that it is related to the dangerous permission android.permission.WRITE_EXTERNAL_STORAGE and is triggered in the AddProductActivity. It may be caused when the app attempts to writing external storage without either permission checking (via checkSelfPermission) nor permission request (via requestPermissions).

Reproduce crash

This crash can be reproduced on my Samsung device, following the steps:

  1. grant the storage permission in the system setting
  2. scan a product (also need camera permission) and then enter the "add new product" page
  3. type any information about the product
  4. go to the system setting and revoke the permission
  5. in the app, tape twice the "next" botton and reach the "nutrition facts" tab
  6. click "add this product" and then the app crashes

@teolemon Could you help me review this issue? If you need more information, I may make a video showing the crash. Very thanks!

teolemon commented 3 years ago

@aper-project can you paste the video here ?

aper-project commented 3 years ago

@aper-project can you paste the video here ?

So sorry for my late reply. I attach the video below.

https://user-images.githubusercontent.com/68948244/123377274-6af6e500-d5be-11eb-9d96-dd954281a0c3.mp4

TanishMoral11 commented 2 weeks ago

@teolemon can you assign this task to me