Can a package uninstall itself? Can a package uninstall another package if they share the same userId and signature?
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.
Use AppLock In this manner, users will need to use the authentication method you previously set to open the Settings app. If you want to block users from uninstalling specific apps, scroll down to General. Then, simply lock the respective app(s). Once the app locked, users won't be able to launch it or uninstall it.
To remove the app go into your Android device's shell by running adb shell . Once there, run pm uninstall -k --user 0 package.name (replacing package.name with the name of the package you searched for earlier). You can also run adb shell pm uninstall -k --user 0 package.name if you choose.
Since Package Installer is built into the Android OS, it is not possible for a normal user to remove the package installer from the device. One also cannot uninstall the Package Installer from Android.
Uri packageURI = Uri.parse("package:"+"your.packagename.here"); Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); startActivity(uninstallIntent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With