Start activity Package Installer

Post your questions and help other users.

Moderator: Martin

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Start activity Package Installer

Post by anuraag » 10 Apr 2019 12:16

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.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Start activity Package Installer

Post by Martin » 10 Apr 2019 20:18

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

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Start activity Package Installer

Post by Desmanto » 11 Apr 2019 01:23

@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?
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Start activity Package Installer

Post by anuraag » 11 Apr 2019 01:41

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.

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Start activity Package Installer

Post by anuraag » 11 Apr 2019 17:05

@Martin
Action: android.intent.action.DELETE
Data URI: package:{packageName}

Always gives operation = cancel and result_code = 0

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Start activity Package Installer

Post by Desmanto » 12 Apr 2019 13:55

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.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Start activity Package Installer

Post by Martin » 12 Apr 2019 19:52

@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

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Start activity Package Installer

Post by anuraag » 16 Apr 2019 14:47

@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

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Start activity Package Installer

Post by Martin » 16 Apr 2019 17:23

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?

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Start activity Package Installer

Post by anuraag » 16 Apr 2019 22:44

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.

Post Reply