Bug 394954

Summary: WRITE_EXTERNAL_STORAGE permissions not properly requested
Product: [Applications] kdeconnect Reporter: lists <lists>
Component: android-applicationAssignee: Albert Vaca Cintora <albertvaka>
Status: RESOLVED FIXED    
Severity: normal CC: epost.kde, lukas, nicolas.fella, suse
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description lists@rhsoft.net 2018-06-02 12:59:29 UTC
while other applications on my lineageos just request proper permissions for kdeconnect you have to manually mangle around or you can only upload to the internal storage and them moce with the device file-explorer wich mackes as example rsync your whole music to the external 400 GB sd-card impossible

steps to enable direct write access for "kdeconnect" on the external sd-card:

* adb root shell
* adb shell
* cp /data/system/packages.xml /scdard/packages.xml
* download packages.xml
* <package name="org.kde.kdeconnect_tp".....
  <perms>
   ....
   <item name="android.permission.WRITE_MEDIA_STORAGE" granted="true" flags="0" />
   <item name="android.permission.WRITE_EXTERNAL_STORAGE" granted="true" flags="0" />
  </perms>
* copy modified "packages.xml" back
* adb shell
* cat /sdcard/packages.xml > /data/system/packages.xml
* reboot device
Comment 1 Nicolas Fella 2018-06-02 18:17:12 UTC
Officially WRITE_MEDIA_STORGAE can only be granted to system apps, i.e. not us. LineageOS has decided to patch this out, this is why it works for you. We will check if we can include it without breaking things for other users
Comment 2 lists@rhsoft.net 2018-06-02 18:27:55 UTC
yes, but there are other apps like "MyLocalAccount" or "Turbo FTP client" which after get directed to write to the sd-card triggerd the LineageOS dialog and have no problem without touch "/data/system/packages.xml" by hand

https://developer.android.com/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE

https://stackoverflow.com/questions/43385895/proper-way-of-requesting-write-external-storage-permission
Comment 3 Lukas Sabota 2018-06-29 21:14:21 UTC
I'm also running into this issue on my Nokia 6.1 (2018), but sadly there is not a safe root option for the device yet to work around this.

I am fairly sure non-system applications are able to write to external storage.  The "FX File Manager" for Android is able to write to external storage (after asking permission): https://play.google.com/store/apps/details?id=nextapp.fx

I don't believe FX is installed as a system application.  Sadly it's not an open source example, but I think it may show that it is *possible*