0

How can i write a function that can remotely self-destruct it, ie delete that application from the phone?

Intent intent = new Intent(Intent.ACTION_DELETE);
intent.setData(Uri.parse("package:com.example.myapplication"));
startActivity(intent);

This code does not work on Android 10+

Philipp
  • 67,764
  • 9
  • 118
  • 153
Hayk
  • 1
  • Any errors or logs to show? Try to look at this question : https://stackoverflow.com/questions/60716057/uninstall-application-programmatically-android-10 – pix Jun 17 '22 at 08:11

1 Answers1

0

You can purge application files by enumerating app directory and deleting everything in there plus removing your application files on SD card. Uninstalling application itself is a different beast altogether. Non system apps cannot do that AFAIK (starting from android 2.0?).

  • 2
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 19 '22 at 11:17