• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Disable app installation

Depends on the scenario. I'm assuming that this is an ordinary, unrooted device.

You can disable apk installation by either turning off the option to install from unknown sources in settings (older versions of Android) or not granting any app the permission to do this (newer versions of Android). But then if the user tries they will be told how to enable it. So that will protect against say a malicious ad tricking your browser into installing something (I personally think that granting a web browser the permission to install apps is an act of naivete bordering on idiocy), but won't stop the phone's user downloading an apk and then installing it.

If you want to stop the user from doing this, you need to also lock the Settings so that they can't grant this access (there are apps that can require a password to enter the Settings, though I've never used one). That obviously stops them from doing other things as well.
 
Upvote 0
Depends on the scenario. I'm assuming that this is an ordinary, unrooted device.

You can disable apk installation by either turning off the option to install from unknown sources in settings (older versions of Android) or not granting any app the permission to do this (newer versions of Android). But then if the user tries they will be told how to enable it. So that will protect against say a malicious ad tricking your browser into installing something (I personally think that granting a web browser the permission to install apps is an act of naivete bordering on idiocy), but won't stop the phone's user downloading an apk and then installing it.

If you want to stop the user from doing this, you need to also lock the Settings so that they can't grant this access (there are apps that can require a password to enter the Settings, though I've never used one). That obviously stops them from doing other things as well.
It is for a rooted device, so is there better ways?

Thanks
 
  • Like
Reactions: MrJavi
Upvote 0
As @Hadron stated, just leave that option disabled in your Settings menu. It's disabled by default so it is definitely an 'opt-in' setting that you have to intentionally enable. Instead of killing options in your Settings, you might be better off focusing on implementing a good lock screen so others cannot access your phone without your permission.
Or if you're in a situation where you do let others use your device, implement 'Guest Mode' (some phones refer to it a 'Privacy Mode'), which creates a temporary account that's isolated from your data and phone configuration:
https://lifehacker.com/how-to-set-up-guest-mode-on-your-android-1835913254
 
  • Like
Reactions: MrJavi
Upvote 0
Just found this on a other fourm can someone explain this to me

"Yes, remove the permission to install package to the target user by making the account a managed account, or hook system to intercept installation window and ask for a password or outright kill it. (What you are looking to intercept is probably com.android.packageinstaller.PackageInstallerActivity). Going to intercept route means you may need to block app stores the same way as they can bypass this if installed on system partition. It will still be possible to install over ADB or recovery if left unprotected."

Thanks
 
  • Like
Reactions: MrJavi
Upvote 0
Im not sure how you go about deleting systems apps/priv-apps but I recommend using root file manger

1 create a folder on you external sd or OTG flashdrive and two sub folders "system_app" and "system_priv-app.".

Screenshot_2020-02-04-03-02-16.jpg


2 Copy the system folders you plan on deleting to the appropriate folders or your external sd/flashdrive.

3. Go to phone settings and force stop, disable, clear cache and data. (Honestly, I get lazy about it and skip this step).

4. Go back to your root file manager/explorer to whatever system app/priv_app and delete the contents but leave the system folder. (Within reason, tread with caution).

Screenshot_2020-02-04-03-09-11.jpg


5. Go to system folder properties. They should look like the image below (original).

Screenshot_2020-02-04-03-12-22.png



6. change the system folders permissions en change the folders (modified)


Screenshot_2020-02-04-03-14-19.png


Screenshot_2020-02-04-03-14-40.jpg


7. In custom recovery, wipe dalvik/cache and reboot. This is suggested anytime changes are made to the system partition. (I often skip this step :)).


You'll need to know folder, file, dex, libs .... permissions in order to port them back.

Heres a guide

https://forum.xda-developers.com/showpost.php?p=60831252&postcount=3443
 
Last edited:
Upvote 0
Now don't expect to unistall the system.ui and expect this method to make your phone work. As the other members stated, alot of the system apps are intertwined with one another as a whole. They call out to each other (recievers) and they are programmed to get a response it could have an adverse affect. The worst are called "fatal".

Good luck
 
Upvote 0
Im not sure how you go about deleting systems apps/priv-apps but I recommend using root file manger

1 create a folder on you external sd or OTG flashdrive and two sub folders "system_app" and "system_priv-app.".

View attachment 147450

2 Copy the system folders you plan on deleting to the appropriate folders or your external sd/flashdrive.

3. Go to phone settings and force stop, disable, clear cache and data. (Honestly, I get lazy about it and skip this step).

4. Go back to your root file manager/explorer to whatever system app/priv_app and delete the contents but leave the system folder. (Within reason, tread with caution).

View attachment 147451

5. Go to system folder properties. They should look like the image below (original).

View attachment 147452


6. change the system folders permissions en change the folders (modified)


View attachment 147453

View attachment 147454

7. In custom recovery, wipe dalvik/cache and reboot. This is suggested anytime changes are made to the system partition. (I often skip this step :)).


You'll need to know folder, file, dex, libs .... permissions in order to port them back.

Heres a guide

https://forum.xda-developers.com/showpost.php?p=60831252&postcount=3443
For what method is this?
 
Upvote 0
This method is for deleting system apps. You mentioned it in one of your posts. I wouldn't recommend deleting your package installer.
If you look at the screen shots, I deleted Facebook installer.
Thanks I wouldn't delete a system app just uninstall it with root, no?
And when I mean deleting package installer I mean the app "package installer" the app that has the ability to install or uninstall any APK.
 
  • Like
Reactions: MrJavi
Upvote 0
Thanks I wouldn't delete a system app just uninstall it with root, no?

Yes, the method I described is only possible with root and R/W access. If you mean "just uninstall it with root' , Im assumg you are referring to a "System Application Unistaller" app then yes you can.
I used to a "system application Unistaller'" app when I first started but I gave that up. After that , I decided to just delete the folder along with its contents. The method above (post#9) is something I noticed running various custom roms. In my case, I have a Samsung and Knox is part of the system which for the most part dosent play well with root and is deleted from the rom. However , the folder remains but permission are changed to what you see it the screen shot above. I use this method and Its provided me the best results by far.
If using an user application to unistall system app provides good results it certainly is less time consuming. ;)

And when I mean deleting package installer I mean the app "package installer" the app that has the ability to install or uninstall any APK.

You welcome,

Yes , that is correct, it will prevent normal installations if deleted. Although , suppose, you could still install apps in a and flash them via custom recovery but I can't be certain.
 
Upvote 0
You welcome,

Yes , that is correct, it will prevent normal installations if deleted. Although , suppose, you could still install apps in a and flash them via custom recovery but I can't be certain.
So basically you recommend deleting it manually not via System app remover.

Also will it affect of updating installed apps?
 
  • Like
Reactions: MrJavi
Upvote 0
Just found this on a other fourm can someone explain this to me

"Yes, remove the permission to install package to the target user by making the account a managed account, or hook system to intercept installation window and ask for a password or outright kill it. (What you are looking to intercept is probably com.android.packageinstaller.PackageInstallerActivity). Going to intercept route means you may need to block app stores the same way as they can bypass this if installed on system partition. It will still be possible to install over ADB or recovery if left unprotected."

Thanks
Anyone knows how to do this?
 
Upvote 0
So basically you recommend deleting it manually not via System app remover.

Also will it affect of updating installed apps?

Im not recommending deleting you system package installer. I know I wouldn't . I recommend making a copy and pasting it to external sd if you do decide to delete systems apps/pri-apps. I am not advising you to delete you system installer.
 
Upvote 0
Just found this on a other fourm can someone explain this to me

"Yes, remove the permission to install package to the target user by making the account a managed account, or hook system to intercept installation window and ask for a password or outright kill it. (What you are looking to intercept is probably com.android.packageinstaller.PackageInstallerActivity). Going to intercept route means you may need to block app stores the same way as they can bypass this if installed on system partition. It will still be possible to install over ADB or recovery if left unprotected."

Thanks
Anyone?
 
Upvote 0
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones