Page 1 of 2

Start activity Package Installer

Posted: 10 Apr 2019 12:16
by anuraag
Start activity Package Installer not working here. Can anyone check it?

Edit: Got an old apk of 1.35, 1.36. Its working on 1.35, 1.36 but not with 1.37.

Re: Start activity Package Installer

Posted: 10 Apr 2019 20:18
by Martin
Hi,

Thanks for reporting!

Automagic has to declare a new permission otherwise the package installer silently ignores the request.
I'll add the permission in 1.38.

Regards,
Martin

Re: Start activity Package Installer

Posted: 11 Apr 2019 01:23
by Desmanto
@anuraag : It seems starting from oreo above, Automagic requires permission REQUEST_INSTALL_PACKAGES to install app thru package installer
https://stackoverflow.com/questions/473 ... aller-oreo
There is additional permission need to be allowed, so that Automagic can initiate the package installer. Have checked the permission and Automagic 1.37 doesn't have it currently. Older version don't have this permission either. But I am lazy to try older version on my current pie phone.

I wonder why older version is working. Maybe you try it on device prior to oreo?

Re: Start activity Package Installer

Posted: 11 Apr 2019 01:41
by anuraag
Desmanto wrote:I wonder why older version is working. Maybe you try it on device prior to oreo?
I have tested them on same device with oreo.

I think those permission are present in previous builds. It somehow not working/removed as 1.37 targets API level 28.

Re: Start activity Package Installer

Posted: 11 Apr 2019 17:05
by anuraag
@Martin
Action: android.intent.action.DELETE
Data URI: package:{packageName}

Always gives operation = cancel and result_code = 0

Re: Start activity Package Installer

Posted: 12 Apr 2019 13:55
by Desmanto
anuraag wrote:I have tested them on same device with oreo.

I think those permission are present in previous builds. It somehow not working/removed as 1.37 targets API level 28.
Oh yes, you are right. I misread the compile SDK. AM 1.36 below still target Nougat. 1.37 above already target Pie, hence must comply to the latest permission.

Re: Start activity Package Installer

Posted: 12 Apr 2019 19:52
by Martin
@anuraag: deleting a package requires another permission on Android P (android.permission.REQUEST_DELETE_PACKAGES). I'll add this permission too.
It seems that you also have to add a special extra to get a result code of OK, otherwise the package installer always returns 0. Please try to add putBoolean("android.intent.extra.RETURN_RESULT", true) in the extras field to see if this helps.

Regards,
Martin

Re: Start activity Package Installer

Posted: 16 Apr 2019 14:47
by anuraag
@Martin
Latest EAP solves installation issue. But choosing file returns "content://" which does not work. "file://" scheme works.

Uninstall still gives operation=cancel and result_code=0 with extra field android.intent.extra.RETURN_RESULT

Re: Start activity Package Installer

Posted: 16 Apr 2019 17:23
by Martin
Did you select a file on the "external SD card" or are you using Android Q?

Start Activity with following settings works for me for uninstalling:
Action: android.intent.action.DELETE
Data URI: package:app.to.uninstall
Extras: putBoolean("android.intent.extra.RETURN_RESULT", true);
Wait for result: checked

When executing the action I get variable operation=ok and result_code=-1.

I've tested this on Android Q. What device and Android version are you using?

Re: Start activity Package Installer

Posted: 16 Apr 2019 22:44
by anuraag
Martin wrote:
16 Apr 2019 17:23
Did you select a file on the "external SD card" or are you using Android Q?
Yes external sd card. Internal storage is fine. I am using android 8.1.
Martin wrote:
16 Apr 2019 17:23
Start Activity with following settings works for me for uninstalling:
Action: android.intent.action.DELETE
Data URI: package:app.to.uninstall
Extras: putBoolean("android.intent.extra.RETURN_RESULT", true);
Wait for result: checked

When executing the action I get variable operation=ok and result_code=-1.

I've tested this on Android Q. What device and Android version are you using?
Checked again. Operation=cancel and result_code=0 . Moto G5 plus with stock android 8.1.
Edit: same with android.intent.action.VIEW now. On previous version 1.37 i was getting operation=ok for android.intent.action.VIEW.