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

Fixes issue #211 - EXIF data stripped while sharing pictures #295

Merged
merged 4 commits into from
Apr 25, 2023

Conversation

sivasubramaniamv
Copy link
Contributor

@sivasubramaniamv sivasubramaniamv commented Apr 20, 2023

Fixes #211

Device Info:

Brand: Realme
Model: Narzo 30 5G
API Level: 33 (Android 13)

Changes Made:

  1. Added ACCESS_MEDIA_LOCATION permission to the manifest
  2. Requested permission in MainActivity

Resources:

Android documentation (media location permission)

The EXIF data was stripped due to privacy features implemented in the Android OS. Android devices targeting Android 10 (API level 29) and above must declare the ACCESS_MEDIA_LOCATION permission and request it during runtime.

As the permission is classified as DANGEROUS, explicit user concern is required to obtain images without redacting EXIF data.

image
Permission is requested when the user enters MainActivity

The image EXIF data is retained when shared from within the app and Intent (Share with - Snapdrop)

@fm-sys
Copy link
Owner

fm-sys commented Apr 21, 2023

Really nice, thank you very much!

However, there are probably many users who don't care about retained EXIF data but would be afraid of granting the permission. What about making it configurable in the settings?

@sivasubramaniamv
Copy link
Contributor Author

image

I tried to make it configurable in the settings, but there are a few challenges.

As you can see in the picture, it is a switch preference that is disabled by default. When the user clicks on it, the permission prompt appears. Depending on the user's choice to grant or deny the permission, the switch UI state should change.

Let's say that the user granted permission and uses the app for some time. They come back to the app settings and click on the "Retain location metadata" preference again, expecting that the location data will be removed in transfers thereafter. But that's not how it works right? It is a permission and not a feature that we can enable or disable anytime within the application.

I'm unsure if there is a programmatic way to disable the permissions that were granted to our app by the user. Even if we can manage to do so, the Android OS will prevent the permission dialog from appearing more than two times for specific permission.

Can you propose a feasible way of making it configurable in the settings?

@fm-sys
Copy link
Owner

fm-sys commented Apr 23, 2023

Your screenshot looks really good 👍

Maybe add a hint to the summary to make clear it is a one-way-toogle.

Something like this:

Some media files might contain location data, which are stripped by default. Grant permission to include full metadata.

We could hide / grey out the toggle as soon as permission is granted.

@sivasubramaniamv
Copy link
Contributor Author

Now when the user grants permission or denies it two times (denies it permanently) the preference is disabled.

@fm-sys
Copy link
Owner

fm-sys commented Apr 25, 2023

LGTM, thank you!

(I've pushed some changes to match with our code style)

@fm-sys fm-sys merged commit 4c89fbc into fm-sys:master Apr 25, 2023
3 checks passed
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

Successfully merging this pull request may close these issues.

EXIF data stripped while sharing pictures
2 participants