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?
1 Answer
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).
-
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.– ChahkCommented Oct 2, 2012 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. Commented Oct 2, 2012 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.– ChahkCommented Oct 2, 2012 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. Commented Oct 2, 2012 at 13:47
-
1I 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.– ChahkCommented Oct 2, 2012 at 13:53
/data
. You'd need an app that's written to survive this by including the user's data in the package file.