element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
GNU Affero General Public License v3.0
3.34k stars 710 forks source link

Not possible to select recovery key #2281

Open phi-gamma opened 3 years ago

phi-gamma commented 3 years ago

Describe the bug

When choosing a key file for recovery, the dialog shows the desired file in the directory listing but doesn’t allow it to be selected.

In my case I transferred the file to /sdcard/Download/foo using adb.

hammerhead:/sdcard/Download $ file foo
foo: ASCII text

To Reproduce

  1. Install clean element (from F-Droid in my case).
  2. Launch and progress through config dialogs until it asks for the Recovery Key. Or go the „Verify this login“ menu and choose „Use a Recovery Passphrase or key“.
  3. Tap “use file” button.
  4. Navigate to directory where the keyfile is located, tap file.
  5. Nothing happens; the file is not selected and the dialog remains open.

Expected behavior Element should read the key from the file that is being tapped or at least respond with an error message if the file couldn’t be read.

Screenshots

The file dialog.

Smartphone (please complete the following information):

Additional context

bmarty commented 3 years ago

I assume the file picker only allows file with .txt extension to be selected, which is the case when you save the recovery key from Element Android.

bmarty commented 3 years ago

(FTR this is the called method: https://github.com/vector-im/element-android/blob/develop/vector/src/main/java/im/vector/app/core/utils/SystemUtils.kt#L158)