auto install apk?

Post your questions and help other users.

Moderator: Martin

Post Reply
Friend1
Posts: 52
Joined: 03 May 2017 06:00

auto install apk?

Post by Friend1 » 03 Jul 2018 19:15

Hi Desmanto;
Is there any way to auto install dowloaded file to Automagic folder sliently or without user interaction?
Thank you very much for your helps.

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

Re: auto install apk?

Post by Desmanto » 04 Jul 2018 06:47

Your question is ambigious. I understand it as you want to install apk as android app silently or it can also means you want to import automagic's flow silently too. I will answer both.

Silent install apk
To install apk without prompt, you need root. Use execute root command

Code: Select all

pm install -r /storage/emulated/0/Download/nameofyourapkhere.apk
-r is to replace. You might need option -d if you want to downgrade the version of the app. You can look at more available option at here : http://adbshell.com/commands/adb-install

There is no way to bypass it without root access. Even if you can open the file using Start Activity via Package Installer, the installing process will block out all accessibility. It will also nag you if you overlay shown (widget overlay), preventing you from installing it. To tap the install, you can't use Control UI, but must use input x y (which need root). So essentially, root is needed for silent apk installation.

Auto "install" flow
To automatically import new downloaded flow, just use Action Import Flows/Widgets; point to the path of the xml flow. You might need to tick the Replace if you have the flow and want to update it to the latest version. After imported, every flow will be disabled (for safety reason). So if you are sure it is properly configured, you can use action Set Flow State and set that flow to enabled. Essentially auto import and enable the flow silently. You probably can couple this with some other trigger or as continuation from Action Download URL or maybe HTTP request Triggers.
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.

Post Reply