After "Factory Resetting" my tablet I realized that the serial Number was changed (it is now a weird number 0123456789ABCDEF).

Edit March 17 2019

This is the number that shows when I do adb devices. As far as I know this is the serial number and not the Android ID.

End Edit

Why did this happen? How do I go about returning it to its original SN? How do I prevent it from happening again?

I have seen some options of changing the SN number but I'm reluctant to try them since the programs they use doesn't look like official (safe) programs.


Your serial # is provided by the Linux Gadget driver. Depending on your kernel version it's either in

  • /config/usb_gadget/g1/strings/0x40*/serialnumber


  • /sys/class/android_usb/android0/iSerial

Since you're rooted, you can easily change the number by writing to this "file" - which is really just a parameter that the driver will digest and export accordingly.

While you're at it, there are other cool strings there, like Manufacturer and Product , which you can mess with, and similar "files" containing USB identification, and controlling the device persona (Mass storage, MTP, PTP, etc)

  • The second option is on my device but the file is named iSerial
    – Sruly
    Jun 9 '20 at 22:33

I assume you are talking about the "Android ID". This Android ID is a 15 or 16 characters long ID exactly like the example in your question.

The Android ID is not device specific and is stored in the user data section. It is a random number, usually generated the device boots the first time. This also applies to the first time the device is booted after a factory reset because the factory reset has deleted all user data including the old Android ID.

Why did this happen?

You did a factory reset.

How do I go about returning it to its original SN?

The Android ID can not be changed on a regular non-rooted device. With root permissions it is easy, as it is stored in an SQLite database file on your system. - assuming you know the old Android ID. See also this question: How to back up my current Android ID?.

How do I prevent it from happening again?

Do not perform a factory reset.

  • You can change the Android ID using adb. adb shell settings put secure android_id "YOUR_ID". Content command can also be used for this. BTW, I am quite certain OP is talking about ro.serialno (which you get to see when running adb devices on a USB connected Android to PC). OP is using an MTK device, and given their earlier question about the same device I am assuming OP flashed the firmware. I once flashed the firmware of an MTK device and ended up with the same serial number. It doesn't hurts, just looks weird. :)
    – Firelord
    Mar 16 '19 at 2:08
  • I am talking about the number that shows when I run adb devices. I have done a factory reset on this device as well as other devices and never had a problem with this serial number changing. @Firelord Is there a way to repair this number to its original number? I do know the original number and my device is rooted. I would prefer to be able to do it on the device itself if at all possible.
    – Sruly
    Mar 17 '19 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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