Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to protect my phone in case of stolen, so i want add an app which will install after factory reset. I have root acces. I want to that app be automatically installed, and factory reset won't remove it. What do i need to do?

share|improve this question
You don't mention the app you will install. Is it a homemade app? If it is something developed by someone else, even if the app were to be reinstalled, you would need a way to configure it. Of course, if you built the app, you could hardcode the phone-home address. – Stephen Schrauger Oct 1 '12 at 18:38
A factory reset removes all user data, so the app would start with a fresh slate even if it's on the system partition because it's data is stored on /data. You'd need an app that's written to survive this by including the user's data in the package file. – Richard Borcsik Oct 1 '12 at 18:40
The only downside is they could still flash another custom rom which would circumvent this – Bryan Denny Oct 1 '12 at 19:21
I used Avast! for this but the "rooted" installation of its anti theft function disappears when I install new ROMs and wipe, so I'm not sure I trust it. – pzkpfw Oct 2 '12 at 10:32

Basically what you need to do is to install a custom rom on your phone. Tweak the rom so that your app is included as a system app. If the user does a factory reset, the systems apps go back to their default state.

You'll want to test it out, though. I don't know if a factory reset wipes all the data for system apps (clean slate) or if it resets it to how the app was when the rom was installed.

On top of that, though, a user who steals your phone may install a rom of their own. In that case, you are out of luck. As far as I know, there does not exist a custom recovery that can be password protected (to keep people from installing another rom).

share|improve this answer
Even if there was a custom recovery with password protection for flashing ROMs, there is nothing preventing a knowledgeable thief from flashing a different recovery over it. – Chahk Oct 2 '12 at 13:31
I was assuming the rom would have some protection on it as well, like a password or pin. And you can set up the rom so that ADB is only enabled on demand. With that, I can't think of how a thief could overwrite either the rom or the recovery. – Stephen Schrauger Oct 2 '12 at 13:33
Reboot to recovery/fastboot and all ROM's protections are ignored since the ROM itself is not running. As a rule of thumb, when a device is physically in the hands of a determined thief, all bets are off. – Chahk Oct 2 '12 at 13:40
I was continuing the train of thought where the recovery would, in fact, be protected by a password - boot to recovery: password; boot to rom: password. True, you assume the thief could get control, but so many people brick their device because they lose access to the phone via recovery or rom (which would be the case with our hypothetical phone and thief). If the thief can unbrick using a serial cable or other method, then sure there is nothing you can do to stop them. – Stephen Schrauger Oct 2 '12 at 13:47
I agree that the passwords would be enough of a deterrent to a "regular" thief. However, a knowledgeable person can easily work around such restrictions. For example, most Samsung devices provide a "Download mode" which is separate from Recovery console and can be used to flash ROMs in their proprietary format. HTC and most other Android manufacturers have a "fastboot" mode that is again separate from Recovery and allow for flashing firmware over USB. – Chahk Oct 2 '12 at 13:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.