Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Wi-Fi MAC address changing

OP Adam77Root

9th September 2012, 07:52 PM   |  #1  
Adam77Root's Avatar
OP Recognized Developer
Flag My coordinates
Thanks Meter: 11,126
 
2,482 posts
Join Date:Joined: Jul 2012
Donate to Me
More
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, 6786 views)
Last edited by Adam77Root; 28th January 2013 at 08:37 PM.
The Following 28 Users Say Thank You to Adam77Root For This Useful Post: [ View ]
10th September 2012, 09:36 AM   |  #2  
ardatdat's Avatar
Senior Member
Travel around; but XDA x24
Thanks Meter: 1,672
 
783 posts
Join Date:Joined: Jun 2010
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
The Following User Says Thank You to ardatdat For This Useful Post: [ View ]
14th January 2013, 10:12 AM   |  #3  
Abuzzz's Avatar
Junior Member
Flag Pune
Thanks Meter: 0
 
8 posts
Join Date:Joined: Sep 2012
More
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!
14th January 2013, 10:41 AM   |  #4  
mj.vikram's Avatar
Recognized Contributor
Flag XDA 24 X 7
Thanks Meter: 2,407
 
2,721 posts
Join Date:Joined: Mar 2012
More
Quote:
Originally Posted by Abuzzz

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...
The Following User Says Thank You to mj.vikram For This Useful Post: [ View ]
28th January 2013, 06:53 PM   |  #5  
Member
Thanks Meter: 0
 
30 posts
Join Date:Joined: Jul 2012
Hello,

Is it possible on Samsung Galaxy SII GT-I9100 ?

thanks
28th January 2013, 07:33 PM   |  #6  
Adam77Root's Avatar
OP Recognized Developer
Flag My coordinates
Thanks Meter: 11,126
 
2,482 posts
Join Date:Joined: Jul 2012
Donate to Me
More
Quote:
Originally Posted by miradorid

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.
Last edited by Adam77Root; 28th January 2013 at 07:41 PM.
The Following User Says Thank You to Adam77Root For This Useful Post: [ View ]
29th January 2013, 10:27 PM   |  #7  
Member
Thanks Meter: 0
 
30 posts
Join Date:Joined: Jul 2012
thanks ! I hope anyone will do this
16th February 2013, 02:30 PM   |  #8  
Senior Member
Flag Home
Thanks Meter: 18
 
135 posts
Join Date:Joined: Apr 2012
More
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
16th February 2013, 05:05 PM   |  #9  
Adam77Root's Avatar
OP Recognized Developer
Flag My coordinates
Thanks Meter: 11,126
 
2,482 posts
Join Date:Joined: Jul 2012
Donate to Me
More
Quote:
Originally Posted by Deadfreak

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: [ View ]
21st February 2013, 12:57 PM   |  #10  
Abuzzz's Avatar
Junior Member
Flag Pune
Thanks Meter: 0
 
8 posts
Join Date:Joined: Sep 2012
More
Smile any suggestion...?
Quote:
Originally Posted by mj.vikram

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...

Post Reply Subscribe to Thread

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

Advanced Search
Display Modes