Renaming a locked folder silently removes its lock
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
app/src/main/kotlin/org/fossify/gallery/adapters/DirectoryAdapter.kt の renameDir と、BaseConfig.kt (207~225 行) にあるフォルダー保護設定のヘルパーから始めます。単一フォルダーの名前変更でパスがどのように更新されるかを追い、その後、複数フォルダーの名前変更で保護されたフォルダーがどのように扱われるかを確認します。保護されたフォルダーの名前を変更したとき、新しいパスでロックが維持され、古いパスにはその保護が残らなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- Have a folder
Pictures/Secretwith one image. - Long-press the folder → ⋮ → Lock folder → OK → PIN tab → enter
1234twice. The folder now shows the lock icon, and opening it asks for the PIN. - Long-press the folder → ⋮ → Rename. The app asks for the PIN; enter it. Rename the folder to
Secret2→ OK. - 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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
FossifyOrg/Gallery のほかの issue
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
FossifyOrg/Gallery#1196 ·
メンテナーはふだん 1 日以内に返信
-
bug needs triage
難易度 2/5 半日 初心者へのやさしさ 60/100
FossifyOrg/Gallery#1181 ·
メンテナーはふだん 1 日以内に返信
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
FossifyOrg/Gallery#1167 ·
メンテナーはふだん 1 日以内に返信
-
Instead of the trash symbol on the main page with folders, add a delete option to the dropdown menu.オープンfeature request needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
FossifyOrg/Gallery#1165 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
feature request needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
FossifyOrg/Gallery#1153 ·
メンテナーはふだん 1 日以内に返信
FossifyOrg/Gallery の issue をすべて見る
似ている issue
-
[Submission] Viaオープンsubmit-adaption submit-adaption-violation
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
BetterAndroid/android-notification-icon-project#811 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[BUG] setTargetSourceSet scans the whole classpath once for every class, so scanning is very slowオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
sergio-sastre/ComposablePreviewScanner#156 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
sameerasw/essentials#1621 ·
メンテナーはふだん 1 日以内に返信
-
pending:code-area pending:issue-category to-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信