It's not the first time this problem is listed. Suddenly connecting to any wireless networks fails by getting stuck on obtaining IP address. This happened after I enabled airplane mode for the first time. I enabled wifi while in airplane mode (shouldn't be possible right?), realised I was still in airplane mode and disabled it. This broke the wifi, I'd guess the DHCP.
A workaround is using a static IP, this still works. A solution is a factory reset, this solves the problem. I backed up before this, restoring the backup also restores the problem. I'd like to find an actual fix and not install and configure everything again.
So I made a backup of a fresh factory reset system and I have the backup of my own system. By using this:
dd if=userdata_xxxxxxxx_yyyyyy.backup bs=512 skip=1 | gunzip -c | tar xv
from here How to extract .backup files created by android stock recovery? I can read the content of the backup of my broken system.
So to solve the issue I need this:
- to find the files responsible for the wifi mess and replace them
- reverse the extraction process
I can make resonable guesses about both but help is needed. For the first I would guess this:
find . | grep dhcp
./misc/dhcp
./misc/dhcp/dhcpcd-wlan0.pid
./misc/dhcp/dhcpcd-wlan0.lease
./misc/dhcp/dhcp6c_duid
As per here: https://thealarmclocksixam.com/2013/10/26/dhcp-failure-on-android-wifi-stuck-on-obtaining-ip-address-how-i-solved-it/
And maybe these
find . | grep wifi
./data/com.asus.wifidirect
./data/com.asus.wifidirect/cache
./data/com.asus.wifidirect/cache/com.android.renderscript.cache
./data/com.asus.wifidirect/shared_prefs
./data/com.asus.wifidirect/shared_prefs/wifidirect_SharedPreferences.xml
./data/com.asus.wifidirect/lib
./misc/wifi
./misc/wifi/sockets
./misc/wifi/softap.conf
./misc/wifi/p2p_supplicant.conf
./misc/wifi/wpa_supplicant.conf
./misc/wifi/entropy.bin
./misc/wifi/ipconfig.txt
Simply replacing those directories would be worth a try
The second problem: first creating a tar, applying gunzip in the correct way and then using dd or cat to add the first 512 bytes header. I'm no hero with shell commands, I nearly always understand what I'm doing but coming up with them is different. I'd guess something like
tar -czvf userdata.tar.gz *
Should do the complete trick for the packing.
dd if=userdata_20161009_165440.backup bs=512 count=1 of=userdata_header
Should give me a header out of the original file
cat userdata_header userdata.tar.gz > userdata.backup
Should finish the process
If this works it may be a solution to a common problem that doesn't require rooting the device or living with a static ip workaround. All went well so far but when I tried to restore my home made backup file I get:
error: checksum compare failed
Which makes be suspect the header is actually a checksum, but I have no experience with those. Can anyone give me suggestions? If I can determine how the header is a valid checksum I can then try to make my own for my custom backup