I want to make an APK that will uninstall a certain android package when installed on a phone? I know how to do this with ADB, but I don't know how to put this into a compiled APK. Thanks!
Asked
Active
Viewed 281 times
0
-
Does this answer your question? [Is it possible to execute adb commands through my android app?](https://stackoverflow.com/questions/13381828/is-it-possible-to-execute-adb-commands-through-my-android-app) – Srikar Reddy Jan 23 '22 at 04:02
-
@SrikarReddy That looks more like how to run the command, but I want to have a compiled apk that can uninstall an android package. – Kovy Jacob Jan 23 '22 at 04:05
-
Try running the uninstall adb command `pm uninstall -k --user 0 NameOfPackage` to uninstall android packages using the above approach. Won't that suffice your use case? – Srikar Reddy Jan 23 '22 at 04:13
-
Running or Executing commands as soon as the app is installed is not possible (at least for non-rooted devices.). – Srikar Reddy Jan 23 '22 at 04:13
-
The applications will be in a stopped state and the Android system won't let any service of the app run unless the user first interacts with it. – Srikar Reddy Jan 23 '22 at 04:13
-
https://stackoverflow.com/a/8535062 – Srikar Reddy Jan 23 '22 at 04:13
-
@SrikarReddy I am trying to figure out how to have an APK uninstall an android package when it is opened. Not with ADB, just the APK would be able to uninstall a package by itself. – Kovy Jacob Jan 23 '22 at 04:20
-
https://stackoverflow.com/questions/6813322/install-uninstall-apks-programmatically-packagemanager-vs-intents – Srikar Reddy Jan 23 '22 at 04:21
-
@SrikarReddy thanks – Kovy Jacob Jan 23 '22 at 04:22