Yesterday i took another look at this mac changing and this time i tried it with my old galaxy s3 phone. So with googling and studying files in phone i found out that phone "loaded" mac address from /efs/wifi/.mac.info/ . At first i simply wrote new mac in file, but it automatically reload the original one. Then i start thinking if answer is in kernel, so i decided to try with different kernel and flashed googy kernel.
http://forum.xda-developers.com/galaxy-s3/orig-development/01-10-googy-kernel-2-6-sammy-jb-3-0-98-t2242325After that i again wrote new address in /.mac.info(wifi off) and this time change was persistent, even after reboot.
Next i start thinking how to make change automatic with generated mac address. As quick test solution i used this shell script:
macad=$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/00:\2:\3:\4:\5:\6/')
su -c "echo $macad > /efs/wifi/.mac.info"
And i used tasker+sl4a apps to run script everytime i connect to wifi, even tho the effect kind of comes one connection behind i had new mac address every time wifi restarts.
I know this is quit strictly binded to certain phone+kernel, because i haven't tested this with other ones. So this ain't tutorial. But maybe this can provide some info if someone is intrested to do something like this with his android phone. Probably with galaxy s4/s5 this could be used quit directly. And for example with nexus 5 that is my current phone, this might be doable with "/persist/wifi/.macaddr" file.
Reason i didn't test this with nexus 5 is that i really don't have any use for mac changing at moment in my phone and i didn't want to take chanche of bricking it.
Edit:
There where still some new things that i wanted to add. Even it seems that nobody has taken any intrest in this.
But anyway, as many of you know, first three parts of mac address(xx:xx:xx) is called Organizational Unique Identifier(OUI) and from OUI you can identify who manufactured or sold some device.
So once again i started to play with this mac changing on my s3 and instead of using random address i thought if i could make my Samsung device act as some other specific device.
So i found this site that has huge list of OUI's from different companies. I used those and test changed my mac address few times and made my Samsung phone "look" like Apple, ZTE, Cisco and other devices. I used Fing network scanner app, that shows device manufacturer in scan, to test that change has worked and it did everytime.
I know this isn't any new knowledge for most of you here, but now that i tested this and it worked it was kind of cool.. in my opinion at least.
Maybe this even might be useful in some cases. For example if you connect to some wireless network that you shouldn't be using or something and you know this network has multiple lenovo machines connected to it, then you could make your phone also look like lenovo machine by using one of their OUI. Then your phone's presence wouldn't be so easy noticed if someone scans the network or view logs.
Here is the website for those OUI addresses if someone is intrested:
https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob_plain;f=manuf;hb=HEAD