2

I want to change device's serial number. I have researched and finding some places that android stores prop file:

/default.prop
/system/build.prop
/system/default.prop
/vendor/build.prop
/data/local.prop
/factory/factory.prop

On my device, there are just 2 places for storing prop file:

/default.prop
/system/build.prop

But I view those two files and don't see serial number storing here. I also see that serial number is storing at: /data/property/. But as I researched, this directory is just a memory mapping. So I have tried modify and reset device, all values come back to normal value.

Please tell me where android store imei/serial number ...

Thanks

2

Device Serial

I have several devices sharing the same serial (namely the phantastic 0123456789ABCDEF), so I've been looking for a solution as well a few years ago, and found it. Of course, it requires a rooted device.

adb shell
su
mount -o remount,rw /system
vi /system/etc/install-recovery.sh
# edit, save and exit
mount -o reount, ro /system

And here comes the line to add to /system/etc/install-recovery.sh to make the magic happen:

echo -n NEWSERIAL123 > /sys/class/android_usb/android0/iSerial

Of course, replace NEWSERIAL123 by the serial you want the device to use. After the next reboot, this should be in effect.


Device IMEI

As for the IMEI, you'd better not touch that. Legal issues – apart from the fact that different brands deal with it differently.

  • thanks. about serial number, I have updated as you said but no effect. I use some APIs such as get value from BUILD.SERIAL or ro.serialno ril.serialnumber sys.serialnumber ... so it returns my original serial number. Which API do you use to get above value? About IMEI, it's more important in my case. Can you give some detail about changing those or teach me your method to find out those things. thanks :D – hqt Feb 5 '17 at 8:17
  • I've tried via setprop as well as by adding it to one of the *.prop files without success. The only way it worked for me is what I described in my answer. And sorry, I cannot give any advice towards IMEI, never played with that (no need). – Izzy Feb 5 '17 at 11:26
1

sn is stored in same private partion(such as misc). And it's read by bootloader and passed to kernel by boot cmd(ro.boot.serialno). Then init will set it to prop ro.serialno.

See this: http://androidxref.com/5.1.1_r6/xref/system/core/init/init.c#752

0

I don't think that changing IMEI is done like that. It's not stored in any .prop file. Maybe even if you change it you'll screw your phone badly. If you still want to change it you have xposed module called 'IMEI changer. I'm curios why do you want to change it?

  • I have read source code of IMEI changer. I change only Build.SERIAL and hooking some methods and it is not enough. In other word, if the real value of serial number (ro.boot.serialno) doesn't really change, always have a non-rooted method for getting real value. – hqt Feb 4 '17 at 21:14
  • about your last question, you can find out why IMEI changer (and other apps for chaning imei, serial number ..) have many downloads. You will answer that by yourself. In my case, I need to change for hiding some information. – hqt Feb 4 '17 at 21:15
  • @hqt so you want to change a serial number? I guess that isn't stored in system files because manufacturer determinates s/n and imei. Well I know that IMEI has relationship with SIM card so every network provider have all imei's of phones in which that sim card was. And also know how many sim's was in particular phone. So however is someone have resources to look up on you with IMEI - changing will not help you too much. – Једноруки Крстивоје Feb 4 '17 at 21:25
  • @Izzy he asked "where android store imei/serial number" in the end. But however you are right, I have missed the point. – Једноруки Крстивоје Feb 4 '17 at 23:51

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.