Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Renaming a locked folder silently removes its lock

オープン 初心者向け
#1,195 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
android, kotlin
領域
mobile, security

調査の方向性

app/src/main/kotlin/org/fossify/gallery/adapters/DirectoryAdapter.kt の renameDir と、BaseConfig.kt (207~225 行) にあるフォルダー保護設定のヘルパーから始めます。単一フォルダーの名前変更でパスがどのように更新されるかを追い、その後、複数フォルダーの名前変更で保護されたフォルダーがどのように扱われるかを確認します。保護されたフォルダーの名前を変更したとき、新しいパスでロックが維持され、古いパスにはその保護が残らなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
Kotlin
スター
3.8k
フォーク
270
平均マージ
1日 7時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FossifyOrg/Gallery のほかの issue

FossifyOrg/Gallery の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。