maks / MGit

A Git client for Android.
https://manichord.com/projects/mgit.html
GNU General Public License v3.0
1.22k stars 166 forks source link

Can not import SSH key #640

Open exp-3 opened 2 years ago

exp-3 commented 2 years ago

Browsing for files displays only folders, not files.

exp-3 commented 2 years ago

S20521-22070298 S20521-22071914

prahal commented 2 years ago

I have the same issue but only on my Android 11 device.

prahal commented 2 years ago

I confirm I can reproduce the issue of no file shown by import ssh key inapp browser in Android Studio 4.1.1 AVD with "Nexus 5X API 30 x86" (Android 11) with MGit 1.6.2 and the issue is not there with an emulated "Nexus 5X API 29 x86" (Android 10). The issue is still there on ColorOS 12 (Android 12) to which I recently upgraded.

prahal commented 2 years ago

I found a workaround, rename the key file to .JPG or .mp3 (I suppose a few other extensions too, but for one .pdf or .zip does not work). Then in MGit import ssh key in-app browser, you will see the file with the added extension. Import it. Then in MGit rename the imported key without the extension, by long touching the filename and clicking on the label icon that appears on top. In the rename popup remove the extension. Then press "Rename".

prahal commented 2 years ago

This is due not Google Play Store only giving "multimedia files access" to MGit. There is an FDroid version 1.6.3 which has access to all files, which should fix this issue.

joneldominic commented 1 year ago

I also encountered the same issue. Would mind @prahal share with us on what could be the possible reason why google only gives it "multimedia files access"?

prahal commented 1 year ago

@joneldominic this is a known issue. Google Play store decides if an application is tagged to have access to all files. MGit has been refused this access even after numerous attempts from MGit author to comply with undisclosed requirements (and it could even be that it is totally arbitrary on the Google Play Store decision side). This Google Play store restriction is only enforced in the newest Android versions. Thuswhy it starts with Android 11. The F-Droid MGit has full access tagged so it is able to access files that are not multimedia files only.

For the complete attempt to fix Google Play Store MGit permissions #620

In fact, as told in this bug report this will be fixed because Google Play Store next version will be only for Android below 11. One will have to install from F-Droid otherwise.

prahal commented 1 year ago

By the way this bug could be closed per the issue is fixed. Install from F-Droid. One matter that might prevent that is if it is not possible to upgrade. Private keys stored in the application space will get lost if one uninstalls and installs.

joneldominic commented 1 year ago

This is understood. Thank you.