3

I found this service https://admin.appjolt.com/ but I don't know how it works. They are opening browser intent with their ad/cross promo when user decided to uninstall our application. Intent is opening when confirmation dialog shows.

Anybody knows the method? Receiver don't works, they are using some service and listening if some object exist or not. I don't know what they are listening actualy.

ramzixp
  • 17,390
  • 3
  • 18
  • 22

3 Answers3

8

This topic has already been discussed several times. You can find a detailed collections of partial solutions, examples and related limitations here.

The short answer is that there's no 100% working solutions without using root or acting as system app.

Community
  • 1
  • 1
bonnyz
  • 13,458
  • 5
  • 46
  • 70
1

Another option for detecting app uninstall is using native code - You need to monitor for Your directory using inotify framework in forked process. When it's deleted You run am command that starts Intent

PoC here: https://github.com/pelotasplus/ActionAfterUninstall/blob/master/app/src/main/jni/hello-jni.c

pixel
  • 24,905
  • 36
  • 149
  • 251
  • Note that this no longer works as of Android 5.0: https://github.com/pelotasplus/ActionAfterUninstall/issues/1 – Sam Oct 29 '18 at 11:12
0

I used this several times. Your app has to be installed as a Device administrator. Then you can be notified for different kind of events. Then you can easily create an Intent. I was personnaly sending a push notification.

Have a look at this : http://developer.android.com/guide/topics/admin/device-admin.html

Jejefcgb
  • 390
  • 3
  • 14
  • Nope, this appjolt is not using device admin. – ramzixp Mar 05 '15 at 09:17
  • Well, there is another solution which is more battery consuming, but enables to know if other apps have been installed or uninstalled. Thanks to the package manager, you can get the a list of the packages (so apps) installed. So with a service, you can easily see if a package has been added or removed and trigger an event. http://www.androidsnippets.com/get-installed-applications-with-name-package-name-version-and-icon – Jejefcgb Mar 05 '15 at 09:20
  • 1
    how? If app is coming to be uninstalled, package is reset. I want to detect this uninstall intent in just moment before user clicks "ok" in uninstall dialog. It demands service but still I don't know how to capture this event ;) I think this thread needs a bounty – ramzixp Mar 05 '15 at 10:16
  • With the package manager, you can get the list of all the packages installed. So basically, I think that you just have to store this list first and then compare the new list of installed package to the list saved. If you don't want your service to consume the whole battery, it won't be immediate but it will work. – Jejefcgb Mar 05 '15 at 10:20
  • 1
    You don't understand. After package deinstalation, I can't make any action from the same package because code is not exist any more! Application have to detect intent if user wants to uninstall it. How I can to compare list from service if system deleted service? :) – ramzixp Mar 05 '15 at 10:26
  • 1
    Yeah sorry, I'm really tired. I tought that there was an appjolt app monitoring the installed apps. I didn't realized that it was a sdk. Sorry :) – Jejefcgb Mar 05 '15 at 10:30