[GUIDE] Fix wifi Mac address changing on reboot

Nimueh

Recognized Contributor
May 19, 2012
2,905
2,180
193
This is interesting... MAC issues without wiping the misc partition is new to me. Could you dump your misc partition and check the offsets to see if your Wifi and BT MAC are in your misc still?

Perhaps there is something tied to formatting /data as well.. like you both have mentioned doing.
I'll try looking into that as well.
Ermmmm ... that went so far over my head I'd need a space shuttle to get to it :laugh:

I don't even know how to get to my Misc partition, much less how to "dump" it or check any offsets :confused:
 

jeffsga88

Senior Member
Jan 5, 2016
835
655
113
Ermmmm ... that went so far over my head I'd need a space shuttle to get to it :laugh:

I don't even know how to get to my Misc partition, much less how to "dump" it or check any offsets :confused:
Look at the 10 step guide autoprime posted on previous page. All you need to do is step 1 and 2 and upload and autoprime could take a look at it. Just use adb, it's easier than doing it from TWRP.
 

Nimueh

Recognized Contributor
May 19, 2012
2,905
2,180
193
Look at the 10 step guide autoprime posted on previous page. All you need to do is step 1 and 2 and upload and autoprime could take a look at it. Just use adb, it's easier than doing it from TWRP.
That takes me right back to the space shuttle :laugh:

I've used ADB exactly 1 time - when unlocking this phone. Those were the longest 10 minutes of my life and I was sweating blood the whole time :angel:

I'll look at those commands again, but it's hard to use something when you have no idea wtf it is you're typing ;)

Couple of hours later:

This is interesting... MAC issues without wiping the misc partition is new to me. Could you dump your misc partition and check the offsets to see if your Wifi and BT MAC are in your misc still?

Perhaps there is something tied to formatting /data as well.. like you both have mentioned doing.
I'll try looking into that as well.
I finally managed to get that dump file and it looks like 32 MB of ... absolutely nothing?

I downloaded a hex editor and couldn't find anything at the 2 spots you mentioned, it's all just 00's :confused:

So either I suck at this or my MACs aren't in there :laugh:
 
Last edited:

jeffsga88

Senior Member
Jan 5, 2016
835
655
113
That takes me right back to the space shuttle :laugh:

I've used ADB exactly 1 time - when unlocking this phone. Those were the longest 10 minutes of my life and I was sweating blood the whole time :angel:

I'll look at those commands again, but it's hard to use something when you have no idea wtf it is you're typing ;)

Couple of hours later:



I finally managed to get that dump file and it looks like 32 MB of ... absolutely nothing?

I downloaded a hex editor and couldn't find anything at the 2 spots you mentioned, it's all just 00's :confused:

So either I suck at this or my MACs aren't in there :laugh:
Yeah I understand, but you did it :p At both locations mine were all 0's too, so you might be looking at it right. If you want you could always post it and let autoprime take a look at it. I even edited mine to have my Mac address and wrote it back to my misc partition but it didn't work, so not sure.
 

Nimueh

Recognized Contributor
May 19, 2012
2,905
2,180
193
Yeah I understand, but you did it :p At both locations mine were all 0's too, so you might be looking at it right. If you want you could always post it and let autoprime take a look at it. I even edited mine to have my Mac address and wrote it back to my misc partition but it didn't work, so not sure.
If @MZO hadn't helped me with those adb commands I'd still be pulling my hair out ... the post on the previous page is great for people that know how to get to the point of entering commands like that. I was absolutely clueless though and have now made a .txt file with the steps I took to get there :cool:

But yea - if we both have 0's it must've gotten wiped, in my case by formatting data after flashing TWRP. I'm not about to attempt to edit that misc dump and/or write anything back ... I'll just stick with your fix, it survives a dirty flash and I'll just have to remember to redo it if I do a clean flash :)
 

MZO

Senior Member
Jan 5, 2015
1,883
2,190
0
If @MZO hadn't helped me with those adb commands I'd still be pulling my hair out ... the post on the previous page is great for people that know how to get to the point of entering commands like that. I was absolutely clueless though and have now made a .txt file with the steps I took to get there :cool:

But yea - if we both have 0's it must've gotten wiped, in my case by formatting data after flashing TWRP. I'm not about to attempt to edit that misc dump and/or write anything back ... I'll just stick with your fix, it survives a dirty flash and I'll just have to remember to redo it if I do a clean flash :)
Ha ha ha good thing we got it :)
 

Icetea

Senior Member
Nov 8, 2014
1,683
494
113
i was affected from this problem too, because it seems, that this problem starts at the moment as i have formatted the wrong part of my system after a TWRP boot loop.

for me, it has fix the problem to insert line: "cur_etheraddr=5c:00:00:00:00:00" at the end of the "config" file in folder: "/data/misc/wifi". (don’t forget to set the file attributes to "664" after saving the file! The added mac address could be the one you want. I have used the "totalcommander" app for it.

Thanks to all users in this tread for the suggestion!!!:good:
 
Last edited:

CM-Tester

Senior Member
Oct 20, 2016
345
160
0
Düsseldorf
SOLVED

This guide will fix the issue of the wifi MAC address changing on every reboot that multiple people were having. I've tested this on T-Mobile, although it should work on the h850 as well. I've seen multiple people posting about this issue and I had the issue as well, do I decided to figure out how to fix it and wanted to share.

Step 1) Use root browser and go-to /data/misc/wifi/ folder.
Step 2) If you have a folder called config, delete it (it needs to be a file not a folder)
Step 3) Using a root browser go-to root of your sdcard (internal storage) and create a file called config (no extension), or use file I attached.
Step 4) Open the new file and put the following:
Code:
cur_etheraddr=5c:00:00:00:00:00
This will be your MAC address, change it to what you want your MAC address to be and save the file. If you downloaded attached file, put in root of your sdcard, open it and edit MAC address to what you want and save it without any file extension, I had to put as .Txt to upload it, just make sure to change to no file extension or it won't work.
Step 5) Open a terminal emulator (install one if you don't have one already) and run the following command:
Code:
su -c "cat  /sdcard/config > /data/misc/wifi/config"
(and no you can't just copy the file to that location, it won't write)
Step 6) Reboot

This will give you a set MAC address even after reboot. Again fully tested on T-Mobile h830, but should work on h850 as well.
Hello @all...

i have a LG V20 us996 unlocked with the latest lineageos nightly...

So i did exactly what the OP said in his post, but when i push the terminal emulator to execute the command, it always shows "sush: cat: /sdcard/config: Permission denied" but it already asked for root rights in supersu...
i deledet the terminal emulator in supersu to test it again, but it is still the same...

I have supersu installed and now "root browser" with root rights ("mk-file-explorer root" seems to have not enough root rights, becaus in the new "root browser" (from playstore) i can see that data/misc/wifi/config was a file and i can delete it too)...
i downloaded the terminal emulator from playstore (jack palevich)...

What can i do to make it successfully ?

Anyone an idea ?

Thanks in advance !!!

EDIT:
Folks.... finally it works... i did change the properties/permissions of the wifi-folder for owner, group and others to R,R,R,W,W,W... after that i can just copy the edited file with my mac-address to that folder...
Reboot, and WOOOOOOOW... i have the mac-address i want (my original hardware mac-address... found it in my router-protocoll and set it into the file here)...
I do not need the terminal emulator :)

Hope this will help someone too ;)
 
Last edited:
  • Like
Reactions: C D

Icetea

Senior Member
Nov 8, 2014
1,683
494
113
@CM-Tester

but after next factory reset all this fixes are gone!

BTW: this will do the same
~ copy /data/misc/wifi config file to internal SD with totalcommander app
~ edit this config file with totalcommander build in editor and add line cur_etheraddr=xx:xx:xx:xx:xx:xx
(xxxx.. the MAC adress you want to set)
~ save file and set it to 644 with totalcommander "propperties"
~ copy config file back to /data/misc/wifi folder and reboot

but this help only to fix problem until the next factory reset!
 
Last edited:
  • Like
Reactions: C D and CM-Tester

Nimueh

Recognized Contributor
May 19, 2012
2,905
2,180
193
@CM-Tester

but after next factory reset all this fixes are gone!

BTW: this will do the same
~ copy /data/misc/wifi config file to internal SD with totalcommander app
~ edit this config file with totalcommander build in editor and add line cur_etheraddr=xx:xx:xx:xx:xx:xx
(xxxx.. the MAC adress you want to set)
~ save file and set it to 644 with totalcommander "propperties"
~ copy config file back to /data/misc/wifi folder and reboot

but this help only to fix problem until the next factory reset!
Yes of course it's only until you wipe the device.

As long as you dirty flash rom updates it sticks, but if you wipe all/factory reset and flash a (different) rom then you just do it again. Only takes a minute, so no big deal :)
 
  • Like
Reactions: C D and CM-Tester

CM-Tester

Senior Member
Oct 20, 2016
345
160
0
Düsseldorf
Yes of course it's only until you wipe the device.

As long as you dirty flash rom updates it sticks, but if you wipe all/factory reset and flash a (different) rom then you just do it again. Only takes a minute, so no big deal :)
@CM-Tester

but after next factory reset all this fixes are gone!

BTW: this will do the same
~ copy /data/misc/wifi config file to internal SD with totalcommander app
~ edit this config file with totalcommander build in editor and add line cur_etheraddr=xx:xx:xx:xx:xx:xx
(xxxx.. the MAC adress you want to set)
~ save file and set it to 644 with totalcommander "propperties"
~ copy config file back to /data/misc/wifi folder and reboot

but this help only to fix problem until the next factory reset!
Yes, thank you guys, as i got worried about that, i did made a backup-copy of the file and a little txt-file with a self-made-guide to remember me in the future (my little private ".txt-wiki" is rising everytime LOL) ;)

Well, i hope that it would be fixed in lineageos nightlies in the future... we will see
 

Nimueh

Recognized Contributor
May 19, 2012
2,905
2,180
193
Yes, thank you guys, as i got worried about that, i did made a backup-copy of the file and a little txt-file with a self-made-guide to remember me in the future (my little private ".txt-wiki" is rising everytime LOL) ;)

Well, i hope that it would be fixed in lineageos nightlies in the future... we will see
They can't fix it, it's our device. Doesn't matter which rom you use, IF it happens to you it'll be on ALL of them - when I first noticed it I was still on (rooted) stock. Something to do with the first wipe ... even though the explanation given earlier in the thread doesn't apply to me.

It just happens ... same like it (my device at least) refuses to use the local IP that my router assigned to it, I HAVE to set it to static and give it the IP in the local settings if I want it to stick. Never had that issue with my old phones or tablet, but oh well ... once you know all that you can apply the fixes and all's good :good: :angel: :cool:
 
Last edited:

CM-Tester

Senior Member
Oct 20, 2016
345
160
0
Düsseldorf
They can't fix it, it's our device. Doesn't matter which rom you use, IF it happens to you it'll be on ALL of them - when I first noticed it I was still on (rooted) stock. Something to do with the first wipe ... even though the explanation given earlier in the thread doesn't apply to me.

It just happens ... same like it (my device at least) refuses to use the local IP that my router assigned to it, I HAVE to set it to static and give it the IP in the local settings if I want it to stick. Never had that issue with my old phones or tablet, but oh well ... once you know all that you can apply the fixes and all's good :good: :angel: :cool:
It can't be fixed by rom? Well ok... Then we have to fix it manually every time we need it... That stuff remembered me to the Windows 95/98 times (self configuration of autoexec.bat and system.ini) :D
 

Nimueh

Recognized Contributor
May 19, 2012
2,905
2,180
193
this is really bad if you plan to sell the phone because the new owner doesn’t know that!
Well honestly ... what does the MAC addy really matter? I used the phone for months before I even noticed + found this thread and had no issues at all. The IP changing and not using the one the router assigned to it was actually more annoying. :eek:

Only reason I use the MAC fix now is for my OCD, but normal daily use isn't affected by it at all imho. :)
 

tymestopm

Senior Member
Jun 9, 2017
81
49
0
Well honestly ... what does the MAC addy really matter? I used the phone for months before I even noticed + found this thread and had no issues at all. The IP changing and not using the one the router assigned to it was actually more annoying. :eek:

Only reason I use the MAC fix now is for my OCD, but normal daily use isn't affected by it at all imho. :)
Static IPs with MAC filtering on your internal network for heightened security.
 

Nimueh

Recognized Contributor
May 19, 2012
2,905
2,180
193
Static IPs with MAC filtering on your internal network for heightened security.
MACs can easily be spoofed which is why I've never used filtering. Well that and the fact that people in this small town barely know how to set up wifi, much less connect to that of other people :laugh:

But sure, there are some cases where you'd want it ... but for normal Joe Shmoe it's not really THAT important :) :cool:
 

sjcali566

Senior Member
Jan 28, 2014
126
23
0
Arizona
I use the app Wifi Mac Changer from the Play Store and you can save a mac address in the app to use after every reboot. This has been my only solution, nothing else has worked.
 

Fild5x

Senior Member
Feb 2, 2016
1,187
191
63
I have installed hades rom on my galaxy a500h and the rom changes my mac to 00:0A:F5:03:81:54. This makes it impossible for me to connect to my free wifi. I have tried this method but it seems this rom gets the wifi mac number from a diferent file and not config. I have also tried to change numbers in the. efs/wifi/.mac.info and the other one to no avail. I would like to get back to my mac in this rom.
I have tried to use wifi mac changer but I cant select the correct mac vendor since it is missing.
I am looking for help. Anyone?
 
Last edited: