[LG G5 Guides, News, & Discussion] totalnoob34:
Hi there people.

If you remember, I had fixed my /misc partition and wrote about it, all happy and grateful. Fast forward a couple months, I decided to update to Oreo, and my /misc partition was wiped again. I don't seem able to fix it this time, however, and my addresses seem to not stick at all, even though they are in the correct spot. So here I am again: has anyone successifully ran stock after wiping and fixing their /misc partition?

Also, is anyone willing to dump and share their untouched /misc partition? I don't believe that partition contains any sensitive information, since IMEI is preserved after wiping it. That would be the perfect solution for every fool like myself.

Thanks in advance.

EDIT: I forgot to report that both ip link and /data/misc/wifi/config report the MAC I set in the image file. I don't know what to think.

EDIT2: I kept researching this whole drama, and found several things out. I'll report my whole thought process here, in case anybody needs it.

The drama

I had mistakenly wiped the /misc partition in ill-advised attempt to get my phone out of TWRP. Not only that didn't fix it, but also removed BT and WiFi MAC addresses.

autoprime's fix

I initially applied autoprime's fix to my misc partition, that is pulling the image back from the phone, editing addresses 6000 and 8000 with some random MACs for WiFi and BT respectively and dd'ing it back to /misc. At that time I was on 20s stock, and did the process in TWRP. The result was that BT address was now set to my random one, while WiFi was still 'unavailable' (you check both in Settings> Information> Hardware information, depending on Android version).

At that time, I gave up and flashed back to Lineage OS, which to my surprise detected both BT and WiFi's MAC addresses I set.

Oreo drama

Some months passed, and LG decided to finally release Oreo for the H850. I hoped this would fix the issues I had, since Lineage OS 15.1 was detecting both addresses. I proceeded to grab a flashable zip for release 30f and installed it. Upon reboot, both BT and WiFi MAC addresses were reported as 'unavailable' in the settings.

autoprime's fix, again

Oreo or the flashable zip must have wiped /misc, I thought, and confirmed that by pulling /misc image. Both 6000 and 8000 locations were now empty, therefore I inserted new values there and dd'ed the image back. Again, same thing as Nougat, BT is reported and WiFi is not. I should point out that both ip link and cat /data/misc/wifi/config contained the address I set.

Investigating

At this point, I was determined to stay stock and unable to turn on wifi, since no MAC address was being detected. Therefore, I went and downloaded 'WiFi MAC Changer' from the play store, which is supposed to be able to change the WiFi MAC address. The application was showing 02:00:00:00:00:00 as the 'real address' and the address I set in /misc as its 'fake address', all without being able to change the MAC.

I then googled '02:00:00:00:00:00 issue', and learned that this issue is very widespread across android devices, and is due to improper configuration of the WiFi MAC. One solution suggested to edit location 3000 of /misc partition with the MAC address to be set, so I tried that and it didn't work.

I then googled some more, and found that perhaps inserting the WiFi MAC in /persist/wifi/.macaddr like so:

echo -ne '\x11\x22\x33\x44\x55\x66' > /persist/wifi/.macaddr
chown root:root /persist/wifi
chmod 755 /persist/wifi
chown wifi:wifi /persist/wifi/.macaddr
chmod 660 /persist/wifi/.macaddr

could fix the issue, but it didn't. I was still unable to turn on wifi, and therefore use it entirely.

I then had a look in the logcat, and found these lines:

01-19 15:18:54.918 1086 1286 I ActivityManager: Displayed com.wireless.macchanger/.savedlist: +218ms
01-19 15:18:54.944 11521 11521 I WIFIFTM : [wififtmd] Call wifi_initialize_config
01-19 15:18:54.945 11521 11521 I LGFTMITEM: [GET_FTM][id=6], offset=24576
01-19 15:18:54.949 11521 11521 E WIFIFTM : Wifi MAC Address = 02:aa:5c:01:6c:e2
01-19 15:18:54.949 11521 11521 E WIFIFTM : wifi_check_config compare "cur_etheraddr=02:aa:5c:01:6c:e2
01-19 15:18:54.949 11521 11521 E WIFIFTM : ": cur_etheraddr=02:aa:5c:01:6c:e2
01-19 15:18:54.949 11521 11521 I WIFIFTM : [wififtmd] wifi_check_optinfo enter
01-19 15:18:54.949 11521 11521 I WIFIFTM : [wififtmd] is_otp_written = 1

Googling parts of this led me to a post by x86cpu , the current mantainer of Lineage OS for H850, reporting that deting /data/misc/wifi/config and creating a folder in its place would randomize the WiFi MAC address at every reboot. In code:

rm /data/misc/wifi/config
mkdir /data/misc/wifi/config

The aftermath

I have no idea why, but it worked, and now my MAC address is randomized at every reboot, which is a shame, but at least I have working WiFi. This also explains why Lineage OS doesn't have this issue, since x86cpu fixed it having the MAC address set from /misc partition.

[MENTION=2881807]x86cpu[/MENTION], did you make any further research on the topic? I didn't find any more information on the V20 LOS 14.1 thread I linked. Sorry for the long post.