[Upgrading, Modifying and Unlocking] ashark2:
There is a rediculous bug in google photos, that do not allow you to delete pictures from sd card. The problem is that most people store their pictures on sd, and google photos uploads pictures from sd and not even check if it could delete from there.

Why this is happening? Because google have broken access to sd in Android 4.4. There is no official way how apps could ask for write access in android 4.4.

Google+ photos was discontinued, and offer user to install Google photos. However, google+ photos was system app (so no sd problems), but new downloaded google photo app is not system (so cannot write to sd).

But developers have found a bug in android 4.4 that still allow apps to write to sd. However, it may not work on some devices.

In android 5.0 there is official way how apps could write to sd (ask directory via Storage Access Framework).

I have experimented a lot and here I have suggestions how to solve this problem.

This is workaround methods table. This do not require app mod, but REQUIRE ROOT

(sorry, it is not possible to make html formatting)

Method Android KK Android LP Android MM Android N

1) SD fix (add media_rw to platform.xml) Yes Yes No Not tested

2) Make app system No (crashes) No (starts normal, but app itself says, that is installed incorectly) No (starts normal, but app itself says, that is installed incorectly) Also, clear cache, or it will lie, that it can move to trash. Not tested

3) Make app system (some old version), after that install new version as usual

Not tested No Yes (not clear how it works however, maybe after cache cleaning it will brake again)

Not tested

4) Xposed XinternalSD Not tested Not tested Yes Not tested

5) Xposed Marshmallow fix

Not tested Not tested No Not tested

6) Add <item name="android.permission.WRITE_MEDIA_STORAGE" granted="true" flags="0" /> to /data/system/packages.xml

Not tested Not tested No Not tested

This is ideas of app modification, so that app do not require root

Method | Can be used by google | Can be used by community | Android KK | Android LP | Android MM | Android N

1) KK backdoor (where possible) + LP SAF | Yes | Do not know. Maybe microG? | Yes | Yes | Yes | Yes

2) Google services backdoor | Yes | No, because microG will not be system app. | Yes | Yes | Yes | Yes

3) Private directory in /data/data | Yes | Do not know. Maybe microG? | Yes | Yes | Yes | Yes

I have seen how OG Youtube app works. Especially interesting noroot + microG way. Is it possible to make the same with google photos?

Conclusion.

There are applications, that uses my ideas and works without a problem. For example, FX file explorer uses KitKat workaround on 4.4 and saf on 5.0+. Also gp has all the same permissions as fx. It looks like google do not allow users to manage photos on their device intentionally. Do not know why, maybe to make people use internal storage for photos and move all to cloud, so make people dependent from their services. But why then even «sync» anything from sd?

Anyway, we should solve this. Is it possible to modify google photos like og youtube? This is needed because if we somehow modify apk, it will not be accepted by google services due to wrong signature. Xposed is not a way, because as you remember, we need noroot way. So, alternative google services possibly could help.

This is how GP behaves now:

User want to delete a picture

Is there direct write access to sd?

Yes — delete picture.

No — Say that gp have no write access to sd.

How it should behave?

User want to delete a picture

Is there direct write access to sd?

Yes — delete picture.

No — then

— Is it Android 5.0+?

— Yes — ask user to allow access via SAF and after that delete picture.

— No — (means we are on Android 4.4 or specially configured 4.3- as in 4.4) then:

— — Show message: «No access, use root or change android version» or «Set your system camera to save pictures in /storage/extSdCard/Android/data/com.google.android.apps.photos/DCIM», or «Update google services, then gp will be allowed to delete pictures».

Will be glad to hear your thoughts.

Related topics:

http://www.xda-developers.com/does-google-photos-backup-even-when-uninstalled/

http://xdaforums.com/htc-10/help/google-photos-remove-photos-sd-card-t3447699

http://xdaforums.com/lg-g5/help/google-photos-deleting-sd-photos-t3360822