Home-screen shortcut to a folder that no longer exists opens an "open with" chooser instead of an error

Aperta Adatta ai principianti
#4,800 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
79/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
android, kotlin
Ambito
backend, mobile

Direzione di ricerca

Inizia in MainActivity.java, intorno alle righe 2019–2029, dove il problema dice che vengono aperti i percorsi delle scorciatoie, e segui il modo in cui distingue le directory dai file. Controlla la gestione dei percorsi delle scorciatoie in Utils.java, intorno alle righe 476–491. Fai in modo che una cartella mancante produca un errore e che la cartella corrente rimanga aperta; verifica rinominando una cartella dopo aver creato la relativa scorciatoia nella schermata Home e toccando la scorciatoia.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
When a home-screen folder shortcut ("Add Shortcut") points to a folder that no longer exists, for example because it was renamed in Amaze, tapping it does not show an error. Amaze stays at the storage root and Android shows an app chooser (Certificate Installer, Chrome, Contacts), because the missing path is opened as a file.

To Reproduce
Steps to reproduce the behavior:

  1. Long-press a folder (here TestB) → ⋮ → "Add Shortcut" → "Add automatically".
  2. In Amaze, rename TestB to TestC.
  3. Go to the home screen and tap the "TestB" shortcut.
  4. Amaze shows /storage/emulated/0 and an "open with" chooser appears.

Expected behavior
A message that the folder no longer exists (and ideally the shortcut is updated or disabled when the folder is renamed in Amaze), not an app chooser for a non-existent file.

Screenshots

home shortcut app chooser after tap
01-home-shortcut 02-app-chooser-after-tap
The "TestB" shortcut on the home screen. After renaming the folder and tapping the shortcut.

Smartphone (please complete the following information):

  • Device: Android Emulator (google_apis image)
  • OS: Android 11 (API 30)
  • Rooted: No
  • Version: 3.11.5 (versionCode 127, release APK from GitHub). Also seen on 3.11.4 and 3.11.3.

Additional context
The path is opened as a folder only if it is a directory; anything else, including a path that does not exist, goes to FileUtils.openFile: MainActivity.java#L2019-L2029

The shortcut stores the path as its id and extra (Utils.java#L476-L491) and is not updated after a rename.

Possible fix: if the path does not exist, show an error toast (and stay at the current folder) instead of calling openFile.

Similar older report for the drawer: #328.

Lingua principale
Kotlin
Stelle
6.5k
Fork
1.7k
Merge medio
1g 1h
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TeamAmaze/AmazeFileManager

Tutte le issue di TeamAmaze/AmazeFileManager

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.