Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,732,479 Members 49,045 Now Online
XDA Developers Android and Mobile Development Forum

Wi-Fi MAC address changing

Tip us?
 
Adam77Root
Old
(Last edited by Adam77Root; 28th January 2013 at 07:37 PM.)
#1  
Adam77Root's Avatar
Recognized Developer - OP
Thanks Meter 10955
Posts: 2,370
Join Date: Jul 2012
Location: My coordinates

 
DONATE TO ME
Default Wi-Fi MAC address changing

Hello everybody!

I have managed to change the Wi-Fi MAC address of my device and now I share this technique with you. With this method, you can change your address permanently!

What is a MAC address?
A Media Access Control address (MAC address) is a unique identifier assigned to network interfaces for communications on the physical network segment. It may also be known as a burned-in address, an Ethernet hardware address (EHA), hardware address or physical address. (Source: Wikipedia)

Why would somebody change his/her MAC address?
- To access the internet where it is restricted to particular addresses.
- To hide his/her illegal activity. (Though this is not effective enough since the Android system sends product information and a lot of other things to the Google servers and I'm sure that previous IP addresses could be searched for if somebody does something really nasty.)

Is it legal to change the MAC address?
As far as I know, it is. However, I firmly discourage you on doing anything illegal with changed/unchanged MAC.

Let's do it!
What do you need?
- A rooted device.
- A kernel with MAC address changing support. (I include my ICS kernel (version 3.1.10) for those who want to try it out and the method of implementing it into other custom kernels.)
- A file manager that can explore the root filesystem.

How does this exactly work?
Normally, the Wi-Fi driver gets the MAC address from the built-in chip then it writes the address to '/efs/wifi/.mac.info' and '/data/.mac.info'. This is the original burned-in address. This cannot be changed with software modifications, but only by soldering off the chip from the motherboard and rewriting its contents. Our Wi-Fi device is a Broadcom BCM4330. It has very good built-in features and the open source driver can be found in our kernel sources.

There are two different options in the driver (READ_MACADDR and RDWR_MACADDR (actually, there is a WRITE_MACADDR option too, which stands for creating the two files I have mentioned before)), which enable us changing the address. I tested both and found READ_MACADDR better. By enabling it in the kernel, you get some options regarding MAC changing.

Before you change your MAC address in any way, turn off Wi-Fi! I recommend writing down your original address somewhere (just to be extra secured). You can always return to your original one using the second method (read further) or by flashing a kernel that doesn't have the patch.

- If you flash a patched kernel and delete the '/efs/wifi/.mac.info' file, the driver will generate (!!) a custom MAC address based on some predefined rules (The first 24 bits are common in all generated addresses.).
- Of course you can set your own custom MAC address. Do this by editing the '/efs/wifi/.mac.info' file with a file manager. If you change it to an incorrect address, the system will automatically use the original (burned-in) MAC.

For kernel developers who want to enable this:
Find '#define WRITE_MACADDR' after '#ifdef CONFIG_MACH_N1' in 'drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_sec_feature.h' and insert '#define READ_MACADDR' after that line. This is for ICS kernels (version 3.1.10), but the patch must work on GB ones too. You just have to insert the define somewhere else (I didn't look into this.).
(I count on you guys in implementing this! )

I attach my prebuilt (secure, MMC_ERASE_CAP disabled) kernel for trying out this feature. It is an ICS kernel (version 3.1.10).

Every custom modification to devices have risks. Use this at your own risk!

Have fun and enjoy!
Attached Files
File Type: zip Kernel_MAC_changing.zip - [Click for QR Code] (6.98 MB, 5582 views)
The Following 27 Users Say Thank You to Adam77Root For This Useful Post: [ Click to Expand ]
 
ardatdat
Old
#2  
ardatdat's Avatar
Senior Member
Thanks Meter 1671
Posts: 783
Join Date: Jun 2010
Location: Travel around; but XDA x24

 
DONATE TO ME
Thanks!

Just tried patching the kernel, it works! So, this feature will be included in my next kernel.

Before flashing the patched kernel, when I turn off wifi, delete .mac.info file, re-enable wifi, the MAC address is not changed.

However, after flashing the patched kernel, after I turn off wifi, delete .mac.info file and re-enable wifi, the MAC address is changed!

Thanks very much for the useful guideline from Adam77Root


Feel free to buy me a beer by clicking the 'donate' button

My github: https://github.com/ardatdat/

My kernels in dropbox: Dropbox

Google Nexus 5
Android 4.4.2 + TWRP

Galaxy Note 2

Galaxy R (i9103)
My OC kernel (1.3G) + CWM
My kernel: http://forum.xda-developers.com/show....php?t=1848677


Nexus One
ROM: My custom Gingerbread ROM
Kernel: PureGinger Kernel
The Following User Says Thank You to ardatdat For This Useful Post: [ Click to Expand ]
 
Abuzzz
Old
#3  
Abuzzz's Avatar
Junior Member
Thanks Meter 0
Posts: 8
Join Date: Sep 2012
Location: Pune
Hey bro can u explain this in a more simpler manner...I'm a newbie here and i need this! bcuz my brother alwayz blocks my wifi mac address so i cannot access wifi. I hav a rooted Samsung galaxy ace s5830 using cm 10.1 rc4......thanks in advance!
 
mj.vikram
Old
#4  
mj.vikram's Avatar
Recognized Contributor
Thanks Meter 2397
Posts: 2,707
Join Date: Mar 2012
Location: XDA 24 X 7
Quote:
Originally Posted by Abuzzz View Post
Hey bro can u explain this in a more simpler manner...I'm a newbie here and i need this! bcuz my brother alwayz blocks my wifi mac address so i cannot access wifi. I hav a rooted Samsung galaxy ace s5830 using cm 10.1 rc4......thanks in advance!
If kernel supports only we change the WIFI MAC Address, we can not use it on all the kernels...

Don't say thanks, Press it ....
The Following User Says Thank You to mj.vikram For This Useful Post: [ Click to Expand ]
 
miradorid
Old
#5  
Junior Member
Thanks Meter 0
Posts: 29
Join Date: Jul 2012
Hello,

Is it possible on Samsung Galaxy SII GT-I9100 ?

thanks
 
Adam77Root
Old
(Last edited by Adam77Root; 28th January 2013 at 06:41 PM.)
#6  
Adam77Root's Avatar
Recognized Developer - OP
Thanks Meter 10955
Posts: 2,370
Join Date: Jul 2012
Location: My coordinates

 
DONATE TO ME
Quote:
Originally Posted by miradorid View Post
Hello,

Is it possible on Samsung Galaxy SII GT-I9100 ?

thanks
Just have taken a look into your kernel sources and it seems it is.

Check this thread: http://forum.xda-developers.com/show...php?p=37299543
Somebody will surely compile a kernel for you.
The Following User Says Thank You to Adam77Root For This Useful Post: [ Click to Expand ]
 
miradorid
Old
#7  
Junior Member
Thanks Meter 0
Posts: 29
Join Date: Jul 2012
thanks ! I hope anyone will do this
 
Deadfreak
Old
#8  
Senior Member
Thanks Meter 18
Posts: 134
Join Date: Apr 2012
Location: Home
Default Re: Wi-Fi MAC address changing

Is it possible to port this to nexus 7 wifi edition with Dirty Aokp rom?
I already have this on my r with cm10.1 kernel
Sent from my GT-I9103 using Tapatalk 2
Phone: Samsung Galaxy S4 i9505 Running Gummy Rom 4.4.2
Tab: Asus Nexus 7 running Dirty Root Box
 
Adam77Root
Old
#9  
Adam77Root's Avatar
Recognized Developer - OP
Thanks Meter 10955
Posts: 2,370
Join Date: Jul 2012
Location: My coordinates

 
DONATE TO ME
Quote:
Originally Posted by Deadfreak View Post
Is it possible to port this to nexus 7 wifi edition with Dirty Aokp rom?
I already have this on my r with cm10.1 kernel
Sent from my GT-I9103 using Tapatalk 2
I have looked into the sources of your Wi-Fi driver (the same BCMDHD) and it seems it doesn't support it. Maybe this is a Samsung-only feature.
The Following 2 Users Say Thank You to Adam77Root For This Useful Post: [ Click to Expand ]
 
Abuzzz
Old
#10  
Abuzzz's Avatar
Junior Member
Thanks Meter 0
Posts: 8
Join Date: Sep 2012
Location: Pune
Smile any suggestion...?

Quote:
Originally Posted by mj.vikram View Post
If kernel supports only we change the WIFI MAC Address, we can not use it on all the kernels...
Can you suggest me a ROM with the suitable kernel to change the mac address of my Samsung Galaxy Ace S5830 please?? It would be of great help...

Tags
address, change, mac, wifi, wireless
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes