0

How to reset android phone to original status by program?

or Can we use adb to trigger sth?

Many thanks for replying~

susantjs
  • 939
  • 2
  • 10
  • 19
  • Susantjs you are not describing your problem very good. Why do you want to reset an Android phone? What exactly do you mean with original status? – Janusz Nov 04 '11 at 10:26
  • take a look [here][1] [1]: http://stackoverflow.com/questions/4798788/android-factory-reset-programmatically – Blackbelt Nov 04 '11 at 10:29
  • http://stackoverflow.com/questions/4798788/android-factory-reset-programmatically – Sagar Limbani Jan 21 '15 at 03:57

2 Answers2

3

Apart from through the Device Administration API, you cannot simply invoke a call and completely factory reset a device, that I'm aware of.

There happens to be a android.permission.MASTER_CLEAR permission, but in order for the system to actually grant you that, your app will need to have 'signature' or 'signatureOrSystem' permissions, according to a Google Groups thread. The only way to get one of those is to sign the app against the same certificate as the system, which basically means you either have to work for a device manufacturer or compile and sign your own firmware.

MH.
  • 45,303
  • 10
  • 103
  • 116
0

I remember that on API8 (2.2) or later, through the DeviceAdmin API, you can perform a factory reset. But this is extremely dangerous to the users, isn't it?

Huang
  • 4,812
  • 3
  • 21
  • 20
  • Thanks Huang~!! You are right~~ We can reset it by the method wipeData(), according to http://developer.android.com/guide/topics/admin/device-admin.html You can use the DevicePolicyManager method wipeData() to reset the device to factory settings. This is useful if the device is lost or stolen. – susantjs Nov 08 '11 at 02:45