Neha
Neha

Reputation: 27

How to obtain the last factory reset time for an Android device?

I am developing a security related app and would like to know when was the device previously factory reset? Is there any way to obtain this information?

I tried getting the last modified time for many files using the adb shell but some show 1970/1971/current date which is not consistent or accurate.

Upvotes: 1

Views: 7690

Answers (2)

adb shell "stat /cache | grep Modify"

Upvotes: 1

Carlo B.
Carlo B.

Reputation: 1243

I know you said you tried getting modification time for some files, but the specific one you need to query is /cache.

The /cache folder is wiped when you factory reset your phone.

The command you would use is adb shell "stat /cache | grep Modify". Which produces something like: Modify: 2016-01-27 15:57:38.000000000

Upvotes: 0

Related Questions