The support forum is temporarily read-only. For urgent requests, please email contact[at]psyberia.net

[closed] AQ v2 Marshmallow External SD Permissions

Any question about the app? Ask it here
Yemble
Posts: 333
Joined: Sun Apr 28, 2013 5:02 pm

[closed] AQ v2 Marshmallow External SD Permissions

Post by Yemble »

Android 6 (Marshmallow) treats its users with contempt and tries its hardest to prevent them from using THEIR external SD device in the way that they choose to do so. This is arrogance beyond belief, however, there is an internal mechanism for allowing an app to request write access to an external SD, providing that app has been made Marshmallow complient.

With regard to AQ, I would like to use the original AlpineQuest folder at the root of my SD card, rather than the horrendous path that Marshmallow forces you to use by default. Unfortunately, AQ shows this application path with a padlock (read-only) and will not allow me to select it.

Would you please implement the internal Android dialog that allows you to select the external SD for read-write access, when you click on the padlock symbol, thus making the /AlpineQuest/ path selectable as the app path for AQ.

I have a number of apps installed which use this same method for granting write access to external SD paths, so it must be a standard Marshmallow feature.
Yemble
Posts: 333
Joined: Sun Apr 28, 2013 5:02 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Yemble »

In the meantime, the same thing can be achieved by editing the /data/system/packages.xml file. You will need root access to do this and make a backup of it first!

Note that this is most easily done on a Windows PC with a decent editor, like UltraEdit.

Search for "alpinequest" and add in the highlighted line below, then reboot your device:

Code: Select all

    <package name="psyberia.alpinequest.full" codePath="/data/app/psyberia.alpinequest.full-1" nativeLibraryPath="/data/app/psyberia.alpinequest.full-1/lib" publicFlags="404274756" privateFlags="0" ft="154907b7678" it="151e42c11f0" ut="154907bded2" version="109" userId="10176" installer="com.android.vending">
        <sigs count="1">
            <cert index="62" key="308201b53082011ea00302010202044baf4a7d300d06092a864886f70d0101050500301f310a300806035504061301463111300f060355040313085073796265726961301e170d3130303332383132323432395a170d3335303332323132323432395a301f310a300806035504061301463111300f06035504031308507379626572696130819f300d06092a864886f70d010101050003818d0030818902818100b61f3f1bae1610e128be6aa68f7348ddafeddbd3adcb7a09c2a7f1333ce797dab9a819e816377b44c59f864b2ca3b08686290b3e040ccab34a36015f8d1c711bf5932e8670b640c16fa19d2610bf32757a970da163bd2465885799d0b22c368c8d1069f55d8c53189525bfe5ae075db1a741129d4ac5ef5d6352f901b7b082650203010001300d06092a864886f70d0101050500038181008ac5f684b1c16db2b34f2465ac97560b542e68dc5f4516bea5e41c531d10db7a45066137a8ac491b703e57670e0480b040643dcf2d90b86b6a4c2a986591856b54f659d6688c209dc0162a0e04012ef88d63f573521add1ba223cf64191b2099a49549e06d5b72cabc2ad2d20b59946abb23c9ba61d33f4ef04b315b57a5c341" />
        </sigs>
        <perms>
            <item name="android.permission.INTERNET" granted="true" flags="0" />
            <item name="android.permission.ACCESS_NETWORK_STATE" granted="true" flags="0" />
            <item name="android.permission.VIBRATE" granted="true" flags="0" />
            [b][color=#FF0000]<item name="android.permission.WRITE_MEDIA_STORAGE" granted="true" flags="0" />[/color][/b]
        </perms>
        <proper-signing-keyset identifier="72" />
    </package>
    
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Psyberia-Support »

Hi,
Here are some clarifications about the SD write support (which is quite complex thanks to Google lack of decision about this subject).

Until Android 1.5
Apps are able to freely read/write SD storage.

From Android 1.6 to Android 4.3
Applications are able to freely read SD storage, and write when requesting (at install time) the permission called "WRITE_EXTERNAL_STORAGE" (that users cannot refuse).

From Android 4.4 to Android 5.1
Apps are able to freely read SD storage, and write only one particular folder (located the "/Android/data/" folder).
They can also read/write basic files on the SD storage using a new method called Storage Access Framework, which doesn't give enough freedom to be used by the application (more complex operations are needed to store and access maps).

From Android 6.0
Two other methods have been added to write on SD storages:
- Users can "Adopt" the SD cards (when re-formatting it from the Android settings) so it behave like the internal storage, and is becomes freely readable/writable by all applications;
- Applications can request to the user the permission to write on the SD cards during execution time, users can grant or not the permission but will still be able to use the application in any case.

AlpineQuest does request the WRITE_EXTERNAL_STORAGE permission at install time, and AlpineQuest 2.x does ask to the user the grant to write on the SD card on devices with Android 6.0 or more.

For devices with Android 6.0 or more, you can manage the state of this grant as explained here.
Do you like AlpineQuest ? Leave a small comment on Google Play !
Yemble
Posts: 333
Joined: Sun Apr 28, 2013 5:02 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Yemble »

Sorry, but AQ v2 never asked me about external SD permissions during the upgrade from AQ v1.4, on any of my three devices and the read-only paths in the application path selection are shown with a padlock and are NOT selectable. It is here that the user should be prompted to allow write access, rather than just once at installation time (which is a nonsense if you think about it, since the entire purpose of this dialog is to allow the user to change the application path).
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Psyberia-Support »

The application checks all requested permissions (write external storage and access to fine location - ie GPS) at each startup, and if one of them is not granted then it requests to Android to ask the user (it cannot be done directly).
However it's true that some users notified me that they did only see the permission request message only after re-installing the application (during the next app start), and not after the update... Version 1.4.x had all permissions automatically granted (as being not designed for Android 6), so they may already be granted when updating the application, explaining why you don't see the request request message.
Even if you don't see this message, you can still grant or not the permissions requested by the application as explained in the link given above. Do you see them as granted on your devices?
Do you like AlpineQuest ? Leave a small comment on Google Play !
Yemble
Posts: 333
Joined: Sun Apr 28, 2013 5:02 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Yemble »

Android 6 (Marshmallow) requires the WRITE_MEDIA_STORAGE, rather than WRITE_EXTERNAL_STORAGE permission. I think that this is the cause of the confusion.

Would you please modify the AQ installer to request the WRITE_MEDIA_STORAGE permission and add it to the manifest. This permission is definitely not being granted by the current installer, in fact, if that permission has been added manually, the current AQ v2.02 installer removes it !
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Psyberia-Support »

Unfortunately this particular permission (WRITE_MEDIA_STORAGE) is not a "real" permission and cannot be used by developers. This permission exists only so that built-in pre-installed applications (like the "My Files" pre-installed file manager app or "Camera" app) can freely write on external storages, without asking the permission to the user.
If you've a rooted device, you can manually add this permission to any apps (like you did for AlpineQuest), but it cannot be added by the app themselves.

Here is the complete list of permissions, WRITE_EXTERNAL_STORAGE is the only one needed to write external storages, and only with the user consent since Android 6.0.
Do you like AlpineQuest ? Leave a small comment on Google Play !
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Psyberia-Support »

This other user just confirmed that after un-installing and re-installing the application, the permission request has been shown.
Based on the last attachement (the PDF file), Google explains that when updating apps, the permissions should be granted.
It seems that in practice the system doesn't display the permission request message nor grants the permissions...
Do you like AlpineQuest ? Leave a small comment on Google Play !
Yemble
Posts: 333
Joined: Sun Apr 28, 2013 5:02 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Yemble »

Unfortunately, we are talking about two different things. Re-installing AQ does not solve my issue regarding releasing the read-only padlock on the <extSD>/AlpineQuest folder, which I would like to select as my application path.

The re-install did prompt twice for permissions, as per the other thread, but this has no effect upon <extSD>/AlpineQuest access.
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Psyberia-Support »

Maybe.
One thing sure is that the app does request all permissions and that if you see a padlock icon then it's because it couldn't write at that location...
You can have a look at the SD card troubleshooting chapter on the online help just in case...
Unfortunately I don't have any other ideas...
Do you like AlpineQuest ? Leave a small comment on Google Play !
Yemble
Posts: 333
Joined: Sun Apr 28, 2013 5:02 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Yemble »

I already know the solution: WRITE_MEDIA_STORAGE

If only the AQ installer did not remove that permission, then I would be happy.

Other apps, like Titanium Backup, FX, ES File Manager, etc., manage to grant write access to the root of the external SD card on Marshmallow... why can't AQ?
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Psyberia-Support »

Have you read my previous post just above??

WRITE_MEDIA_STORAGE is not a permission!
It's something internal to the system, that you can only because your device is rooted.
Do you like AlpineQuest ? Leave a small comment on Google Play !
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Psyberia-Support »

Please don't take me responsible for all those restrictions and limitations imposed by Google...
I try to do my best so users can make the best use as possible of their devices, but I'm tired (just as you I guess) to spend (loose) so much time dealing with those technical issues instead of concentrating my efforts on tasks that really matters, business related (mapping, hiking, etc)...
Do you like AlpineQuest ? Leave a small comment on Google Play !
Yemble
Posts: 333
Joined: Sun Apr 28, 2013 5:02 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Yemble »

Psyberia-Support wrote:Please don't take me responsible for all those restrictions and limitations imposed by Google...
I try to do my best so users can make the best use as possible of their devices, but I'm tired (just as you I guess) to spend (loose) so much time dealing with those technical issues instead of concentrating my efforts on tasks that really matters, business related (mapping, hiking, etc)...
I agree that we have all been stitched up by Google (again), both users and developers. However, it remains a fact that the developers of many well know apps have worked around this for rooted devices. It would be nice if AQ could do the same, for rooted devices, as well. Many of us users do have rooted phones and tablets - it is not uncommon.
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

Re: AQ v2 Marshmallow External SD Permissions

Post by Psyberia-Support »

That would be "nice" to have, but not my priority right now. Rooted devices are still an exception, for system tool apps like backuping or file managing, it make sense, but for an hiking application that's just a plus.

I have so many (common) features already planned that I just don't want to spend time on studying how to work with rooted devices, documentation is poor and unofficial, and there is no guarantee that working stuffs and hacks will work in the following Android versions (they usually try to fix those kind of breaches)...

Moreover I consider owners of rooted device "experienced" users, and they are still able to change themselves the android permissions file like you explain in your post just above.

Sorry about that.
Do you like AlpineQuest ? Leave a small comment on Google Play !
Post Reply