Menu
Active8 months ago
I have scenario where I have to download apk in background and install it without prompting any dialog to user. However when I try to install it using below code
It ask for super user access. Is there any way to install apk without super user and prompting to user?
The Groove Wallpaper in Google Pixel 3 Live Wallpaper APK dances to your music Android 6.0, 7.0 and 8.0 too. The Pixel 3's Live Wallpaper app is available for device running up to Android 6.0 Marshmallow. Jump to Install Pixel 3 Live Wallpaper APK - Compatibility: Should work fine on any Android 6.0+ device. Download the appropriate version according to.
Cœur22.7k1010 gold badges130130 silver badges187187 bronze badges
ManojManoj1,21433 gold badges2424 silver badges4545 bronze badges
4 Answers
Is there any way to install apk without super user and prompting to user?
Fortunately, no, for obvious security reasons.
UPDATE: One exception is on Android 5.0+ devices, if you are using the device owner system, I think there are some APIs for installing packages that are available to device owner apps. I haven't played with these yet, and it is unclear whether they would meet your needs anyway.
I am asking this becoz the user base that I have, have never used app or device before
Then either do not give them this technology or teach them how to use this technology.
CommonsWareCommonsWare813k145145 gold badges19691969 silver badges20132013 bronze badges
You can silently install apps starting Android Marshmallow (find info here). You would have to be a device owner in order to accomplish the task.
You can find more help about device owner here. Thanks to Florent Dupont.
kashkash39522 gold badges44 silver badges1818 bronze badges
Yes you can install the apk silently without rooting by signing your application with system signature.
tanmeettanmeet
You should first look into the Android's native Package Installer. I think you just need to extract the required functionality.
Specifially, if you look at this method and its OnClickListener:
Then you may notice the InstallAppProgress class on where the actual installer is located and the final thing to do is to call the
PackageManager
's installPackage(...) function.Next step is to inspect
PackageManager
which is an abstract class. You will find that installPackage(...) function there. The bad news is that this is marked with @hide
. This means it's not directly available to external developers.But you will be able to access the method with using reflection.
You will reflect it using
yourContext.getPackageManager()
. Then you may call the installPackage(...) function.The following code calls the installation:
For the whole thing to work you need to declare this to your manifest or the code will fail silently.
to get this permission you must install the APK as system which requires ROOT.
however after you have installed the APK as system it seem to work WITHOUT ROOT.
To do this, i created a signed APK and pushed it on:
with this i copied it to
/system/priv-app
which requires write access this is why the ROOT required.I tested it using the debug version and when i tried it, i got the
SecurityException
.You should use a rooted device to install that as an sytem priveligied app.
Hope this helps :)
user9370880
Not the answer you're looking for? Browse other questions tagged androidandroid-install-apk or ask your own question.
Make the most of your display with beautiful wallpapers and advanced features. Choose one of your own photos, an image from the Google Earth collection, a scenic landscape from Google+, and more. Change it as often as you like, so your phone always represents your style.
• Enjoy a collection that keeps on growing. Access images from Google Earth, Google+, and other partners.
• Double your fun. Show the world one wallpaper on your lock screen, and keep one for yourself on your home screen. (Requires Android™ 7.0, Nougat, and above.)
• Start each day fresh. Pick your favorite category and you’ll get a new wallpaper image each day.
Permissions Notice
Photos/Media/Files: Needed to allow you to use custom photos as wallpaper.
Storage: Needed to display the currently set wallpaper and to allow you to use custom photos as wallpaper.
• Enjoy a collection that keeps on growing. Access images from Google Earth, Google+, and other partners.
• Double your fun. Show the world one wallpaper on your lock screen, and keep one for yourself on your home screen. (Requires Android™ 7.0, Nougat, and above.)
• Start each day fresh. Pick your favorite category and you’ll get a new wallpaper image each day.
Permissions Notice
Photos/Media/Files: Needed to allow you to use custom photos as wallpaper.
Storage: Needed to display the currently set wallpaper and to allow you to use custom photos as wallpaper.
Collapse
93,479 total
4
2
Read more
100,000,000+
1.3.169416333
4.1 and up
Google LLC
1600 Amphitheatre Parkway, Mountain View 94043