2

After a lot of research, I got to a conclusion that uninstalls can't be tracked as "Package Removed" action is not broadcasted to all the apps except the one getting uninstalled.

And then I found a way of tracking uninstalls. I saved all uninstall user information by Sending a GCM and getting "Not Registered" error in the response(GCM gives "Not Registered" error for devices with the app uninstalled).

So now, when I installed Opera Max app and uninstalled it, it opened a webpage asking for "Uninstall Survey". How could they have done that?

Seshu Vinay
  • 13,560
  • 9
  • 60
  • 109
  • This isn't a good question for SO. I suggest you contact the Opera Max devs and ask them. – Squonk Aug 19 '15 at 09:57
  • 1
    PACKAGE_REMOVED doesn't get broadcasted to the same app which is being uninstalled. And I don't know why is it not a good question when it is specifically related to programming. – Seshu Vinay Aug 19 '15 at 10:05
  • I know you might have gone through this but still check this link bcoz answer and comment gives a bit idea http://stackoverflow.com/questions/10219328/how-to-show-an-activity-before-my-app-is-uninstalled-android – Shadow Droid Aug 19 '15 at 10:31
  • @ShadowDroid I guess I have come already come across this but not sure when. I read Mark's answer before. – Seshu Vinay Aug 19 '15 at 10:45

2 Answers2

2

See these slides from Droidcon 2015 where some guys reverse-engineered how Opera Max is doing that, and see this GitHub repository for some example code.

sschuberth
  • 28,386
  • 6
  • 101
  • 146
0

I can't repro this behaviour when I uninstall Opera Max, but I believe their technique is along the following lines:

  • they somehow register an event handler that will send an Intent if and when the directory that the app was installed to disappears
  • that event handler survives the uninstallation of the app
  • when the directory disappears the intent fires - of course they can't run their own code now (since it has been uninstalled), but they can direct you to a webpage in whatever browser is in place

I didn't have any other Opera apps installed when I tried this - if you have a second app that you also control that has not been uninstalled, then it's easy for each app to monitor the uninstallation of the other one.

I was running on Lollipop - perhaps recent versions of Android have closed what certainly feels like a security hole.

zmarties
  • 4,809
  • 22
  • 39