Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Renaming a locked folder silently removes its lock

Abierto Apto para principiantes
#1,195 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
android, kotlin
Área
mobile, security

Línea de trabajo

Empieza con renameDir en app/src/main/kotlin/org/fossify/gallery/adapters/DirectoryAdapter.kt y los helpers de preferencias de protección de carpetas en BaseConfig.kt (líneas 207–225). Sigue cómo el cambio de nombre de una sola carpeta actualiza su ruta y luego comprueba cómo el cambio de nombre de varias carpetas gestiona las carpetas protegidas. Se considera terminado cuando cambiar el nombre de una carpeta protegida conserva su bloqueo en la nueva ruta y la ruta anterior deja de tener esa protección.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug needs triage
Checklist
  • I can reproduce the bug with the latest version given here.
  • I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.
Affected app version

1.14.0

Affected Android/Custom ROM version

Android 16

Affected device model

Xiaomi 17 pro max

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug
  1. Have a folder Pictures/Secret with one image.
  2. Long-press the folder → ⋮ → Lock folder → OK → PIN tab → enter 1234 twice. The folder now shows the lock icon, and opening it asks for the PIN.
  3. Long-press the folder → ⋮ → Rename. The app asks for the PIN; enter it. Rename the folder to Secret2 → OK.
  4. Force-stop the app, open it again and tap Secret2.
Expected behavior

The renamed folder is still locked: it shows the lock icon and asks for the PIN.

Actual behavior

The lock icon is gone and Secret2 opens without asking for the PIN (also after restarting the app).

If the folder is renamed back to Secret, the lock icon comes back, so the lock is still stored under the old folder path.

Screenshots/Screen recordings

No response

Additional information

The lock is stored in preferences keyed by the folder path (protected_folder_hash_<path> / protected_folder_type_<path>):
https://github.com/FossifyOrg/Commons/blob/227e7d3cdea2343679eb0863bb597fc7a9200b4d/commons/src/main/kotlin/org/fossify/commons/helpers/BaseConfig.kt#L207-L225

The single-folder rename asks for the PIN, then updates the Directory item and its DB row, but does not move the lock to the new path:
https://github.com/FossifyOrg/Gallery/blob/ea7499d425c583c960566ffa9f05b7dfaedd30f1/app/src/main/kotlin/org/fossify/gallery/adapters/DirectoryAdapter.kt#L309-L338

The multi-folder rename in the same function skips protected folders (!config.isFolderProtected(it), L342), so a rename is clearly not meant to drop the lock. And since the rename happens inside Gallery, the app knows the old and new path; for file renames it already moves the path-keyed media and favorites rows (updateDBMediaPath):
https://github.com/FossifyOrg/Gallery/blob/ea7499d425c583c960566ffa9f05b7dfaedd30f1/app/src/main/kotlin/org/fossify/gallery/extensions/Context.kt#L1033-L1041

Possible fix: in renameDir, if the old path is protected, call addFolderProtection(newPath, hash, type) with the old values and removeFolderProtection(oldPath).

Lenguaje dominante
Kotlin
Estrellas
3.8k
Forks
270
Merge medio
1 d 7 h
PR fusionados (30 d)
13

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de FossifyOrg/Gallery

Todos los issues de FossifyOrg/Gallery

Issues similares

Más issues de Kotlin

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.