Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revoking permission at MemeCreateActivity causes app crashed #227

Open
aper-project opened this issue Apr 28, 2021 · 2 comments
Open

Revoking permission at MemeCreateActivity causes app crashed #227

aper-project opened this issue Apr 28, 2021 · 2 comments

Comments

@aper-project
Copy link

Hi, there, I've found a crash in MemeTastic v1.6.7(68), which is downloaded from F-Droid.

I seems that it is related to the dangerous permission android.permission.WRITE_EXTERNAL_STORAGE and is triggered during the following call chain:

net.gsantner.memetastic.activity.MemeCreateActivity.onCreate(android.os.Bundle)void
  net.gsantner.memetastic.activity.MemeCreateActivity.initMemeSettings(android.os.Bundle)boolean
    net.gsantner.memetastic.activity.MemeCreateActivity.extractBitmapFromIntent(android.content.Intent)android.graphics.Bitmap
      net.gsantner.opoc.util.ShareUtil.extractFileFromIntent(android.content.Intent)java.io.File
        android.os.Environment.getExternalStorageDirectory()java.io.File

This call chain does not involves either permission checking (via checkSelfPermission) nor permission request (via requestPermissions) to the corresponding permission, which may produce unexpected consequence.

Reproduce crash

In fact, I found this lack of permission management causes a crash on my Samsung device, following the steps:

  1. enter the app from the home screen and allow the permission request
  2. choose one meme item and enter the ``create meme activity''
  3. go to system setting and revoke the storage permission
  4. go back to the app and it crashes

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

@gsantner
Copy link
Owner

You manually, forcefully remove the permission from the app. And MemeTastic saves to external storage / Pictures folder.

What did you expect to happen? Hm.

@aper-project
Copy link
Author

You manually, forcefully remove the permission from the app. And MemeTastic saves to external storage / Pictures folder.

What did you expect to happen? Hm.

Yes, it's unusual, but it happens. I noticed that the main activity will show a message "need permission to storage ..." if the user denied the permission request.
So I believe it would be better if a notice is presented to the users, when the permission is missing, rather than simply leave it crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants