Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download/Update install intent uses wrong file path #634

Closed
kudiaborm opened this issue Jun 10, 2016 · 5 comments
Assignees
Labels
Bug
Milestone

Comments

@kudiaborm
Copy link

@kudiaborm kudiaborm commented Jun 10, 2016

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).

CopyFIle.txt
FailedUpdate.txt
IsolatedError.txt

@ameshkov ameshkov added this to the 2.6 milestone Jun 10, 2016
@ameshkov ameshkov added the Bug label Jun 10, 2016
@ameshkov

This comment has been minimized.

Copy link
Member

@ameshkov ameshkov commented Jun 10, 2016

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?

@Revertron

This comment has been minimized.

Copy link
Member

@Revertron Revertron commented Jun 14, 2016

Okay, I will fix it tomorrow.

@Revertron

This comment has been minimized.

Copy link
Member

@Revertron Revertron commented Jun 15, 2016

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?

@Revertron

This comment has been minimized.

Copy link
Member

@Revertron Revertron commented Jun 15, 2016

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...

@Revertron

This comment has been minimized.

Copy link
Member

@Revertron Revertron commented Jun 15, 2016

Fixed it :)
Making a copy to our cache and starting PackageManager from there.

@Revertron Revertron closed this Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.