[BUG] Automatic picture uploads strip GPS location from photos (missing ACCESS_MEDIA_LOCATION) Actual behaviour on Android
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 62/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- mobile, mobile-dev
Línea de trabajo
Empieza comprobando owncloudApp/src/main/AndroidManifest.xml para localizar el permiso ACCESS_MEDIA_LOCATION que falta y la ruta de gestión de permisos; el punto de entrada de la subida mencionado en el informe se llama UploadFileFromContentUriWorker. Después de conceder el permiso, compara una subida automática con la foto original, incluidos su SHA-256 y sus metadatos GPS. El trabajo estará terminado cuando la subida conserve los datos de la foto original y se informe a los usuarios que rechacen el permiso de que los metadatos de ubicación pueden eliminarse.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Photos uploaded by Automatic uploads → Picture uploads reach the server with their GPS location removed on Android. Nothing warns the user, so a backup quietly differs from the original.
The uploaded file is the same size as the original but not byte-identical. The only difference is a run of 43–48 bytes inside the EXIF GPS block, all set to zero in the uploaded copy. All other EXIF data (camera model, exposure, timestamps) is untouched. That pattern is Android's media-location redaction, not an EXIF edit: on Android 10+ the system blanks location metadata for any app reading media without android.permission.ACCESS_MEDIA_LOCATION. The ownCloud app doesn't declare this permission (it's absent from owncloudApp/src/main/AndroidManifest.xml on master), so every photo it reads arrives already redacted.
Expected behaviour:
Automatic uploads should send a byte-identical copy of the original photo, including its location metadata (as they do already on the iOS client) If the user declines the media-location permission, the app should at least say that uploads will have their location removed instead of quietly altering like this.
Steps to reproduce:
On an Android 10+ device, turn on location tagging in the camera app.
In ownCloud, turn on Settings → Automatic uploads → Picture uploads, with the source folder set to DCIM/Camera.
Take a photo and wait for it to upload.
Download the uploaded file (web UI or WebDAV) and compare it with the original from the device:
exiftool -gps:all uploaded.jpg shows no position (e.g. GPSLatitudeRef: Unknown ()), while the original has one.
cmp -l original.jpg uploaded.jpg shows about 45 differing bytes, all 0 in the uploaded file.
Verified fix
I rebuilt the same 4.8.4 APK with a single change, adding this line to the binary manifest (no code changes), re-signed it, and installed it with the permission granted:
After that, new automatic uploads are byte-identical to the originals (matching SHA-256) with GPS intact. The current Storage Access Framework read path (DocumentFile.fromTreeUri → contentResolver.openInputStream in UploadFileFromContentUriWorker) needs no other change. Android just stops redacting once the app holds the permission.
Note on #3056: that issue (missing geotags with "Picture from camera") was closed with "it is not in our plans to add the location permission in the app". ACCESS_MEDIA_LOCATION is not a device-location permission. It doesn't let the app see where the phone is. It only lets the app read location data that is already stored in the user's own photos. Nextcloud's Android client, which started as a fork of this codebase, declares it for the same reason. iOS owncloud client also keeps this location data intact, so it's an os differentiation that's not desirable either.
Video uploads are probably affected the same way, since Android also redacts location in video metadata, but I haven't verified that.
Environment data
Android version: 17 (ColorOS 17)
Device model: OPPO Find N6 (CPH2765)
Stock or customized system: Stock
ownCloud app version: 4.8.4 (Google Play)
ownCloud server version: 10.16.6 Community
Logs
Web server error log
N/A — the upload succeeds without errors; the file content is altered on the device before upload.
ownCloud log (data/owncloud.log)
N/A — no errors are logged.
- Lenguaje dominante
- Kotlin
- Estrellas
- 4.2k
- Forks
- 3.1k
- Merge medio
- 3 d 9 h
- PR fusionados (30 d)
- 16
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de owncloud/android
-
KW-related Type:bug UI / UX
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
[BUG] Lint reports an errorAbiertoType:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
owncloud/android#4485 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
-
Contributions are welcome p3-medium Type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
owncloud/android#4300 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
owncloud/android#3720 · 8 comentarios ·
Los mantenedores suelen responder en 1 día
-
Contributions are welcome Technical
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
Todos los issues de owncloud/android
Issues similares
-
👀 example 📱 iOS
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
hyochan/react-native-nitro-sound#871 ·
Los mantenedores suelen responder en 2 días
-
android:plan main:plan packages:learn
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
a:bug in:configuration-cache re:windows
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ankidroid/Anki-Android#23453 ·
Los mantenedores suelen responder en 1 día