distriqt/ANE-PackageManager

Issue when trying to install an apk on older devices

rzv86 opened this issue · 10 comments

rzv86 commented

Hello.
I'm using your ANE to install an additional java apk from my adobe air application on android devices.
It's working fine on samsung s8(android 9), lenovo tab p10(android 9), but no success on my older devices: samsung note p600(android 5.1.1), huawei mediapad m2 10(android 5.1.1) or even on samsung s8 (android 7.0).

On the working devices settings can be opened to check "install unknown app"-"allow from this source" and after that my secondary app can be installed, but nothing happens on the older android versions devices. My samsung s8(android 7.0) displays an error: "Package installer has stopped".

I develop app with air sdk 32, starling 2.5.1, feathers 4.0, also i'm using your permission ANE.
Min sdk target 17, target sdk 27.

Thank you,

Can you post some example code that replicates the issue and the log from the device?

https://airnativeextensions.github.io/tutorials/device-logs

Cheers

rzv86 commented

So, I've made 2 logcats, one on the samsung p600(android5.1.1) and one on samsung s8(android 7.0)

logcat p600.docx

logcat samsung s8.docx

can you take a look?

thanks

rzv86 commented

I've tried it on my devices, all are working fine except my samsung s8(android 7.0) wich gave me the same error like it did before: "Package installer has stopped".
Below you can find the logcat.

logcat 2 samsung s8.docx

I read on this link- https://stackoverflow.com/questions/54128272/update-app-via-apk-download-with-url-not-showing-open-done-screen - that installing an app is different on newer devices (Build.VERSION.SDK_INT >= 24, meaning android 7.0 nougat ), and you need to ask user to grant permission from settings like we do on samsung 9(android 9) and lenovo tab(android 9).

Also, I've noticed in my new logcat:
Permission Denial: opening provider com.distriqt.extension.packagemanager.content.PackageManagerFileProvider from ProcessRecord{a4d5eae 27934:com.google.android.packageinstaller/u0a34} (pid=27934, uid=10034) that is not exported from uid 10248...
So my first thought was if you treated correctly sdk 24 on your ANE.

Thanks,

rzv86 commented

Hello again. Do you have any news on this?

We are still looking into this one.

Regarding your question on requesting permissions you are following the docs on checking canRequestApplicationInstalls and allowing unknown sources? This was only introduced in android 26 not 24.

https://github.com/distriqt/ANE-PackageManager/wiki/u.Installing-Apps

However there are other grant permissions that changed earlier.

rzv86 commented

Yes, I check for "canRequestApplicationInstalls" first, if false then I use "PackageManager.service.showManageUnknownAppSourcesSettings();" , user checks unknown sources in settings, after that, in my app:
"if(PackageManager.service.canRequestApplicationInstalls == true){
..
PackageManager.service.installApplication( apkfile.nativePath );
}"

Now your last ANE build work's fine on all my devices.

Thank you.

Great, glad to hear it's working now, will push this update into release later today.