Download/Update install intent uses wrong file path
I'm not sure if this is new as of Android N, but using the in-app "check for updates" feature returns a "unable to parse app".
The resultant apk file in the downloads app also cannot parse, and the file is not actually in the ~/Downloads folder
Using the downloads app to move the file shows it is actually in /data/data/com.android.providers.downloads/cache/adguard_beta.apk and not /data/user/0/com.android.providers.downloads/cache/adguard_beta.apk
START u0 {act=android.intent.action.VIEW dat=file:///data/user/0/com.android.providers.downloads/cache/adguard_beta.apk typ=application/vnd.android.package-archive flg=0x10000000 cmp=com.google.android.packageinstaller/com.android.packageinstaller.PackageInstallerActivity} from uid 10188 on display 0
I've attached logs of my process, note that apk download names probably conflict between logs because I tried multiple times without deleting old version (i.e. apk-1, apk, apk-2).
Wow, thank you very much for the detailed research!
We didn't do it as we thought this is some specific Android N issue with applying apk update:). After all it is not as bad.
@Revertron can we fix it before releasing v2.6?
Okay, I will fix it tomorrow.
I've tested so many times the process of loading update apk and trying to install it. The errors are various from not saving file at all (we get Size: 0) to "Permission denied" when trying to install. I think we can make some ugly workaround to copy the file (IF IT EXISTS) to our cache folder, set read permissions to all and try to install it from there... I will try this ugly workaround now, but no promises.
P.S.: I can waste some time on this Android N bug, but they may eventually fix it in later releases. Is there any point for this?
java.io.FileNotFoundException: /data/user/0/com.android.providers.downloads/cache/adguard_beta-3.apk (Permission denied)
There is nothing we can do with the file...
Fixed it :) Making a copy to our cache and starting PackageManager from there.