In the past, I bricked my tablet during some experiments on firmware. After a long and deep search on the internet, I found the manufacturer’s site and then I downloaded the firmware to reflash. You can read here how I unbricked Allwinner tablet AD701. Everything was working except for the WiFi. The WiFi toggle button on settings would just show “Turning On” and then turn off automatically. This means a problem in the driver or firmware. After a lot of searches, I also found a way to solve such driver issues. So here is my guide to help you solve driver issues in Android using an example of WiFi driver.
Many people face similar problems with their devices. Some face issues with G-sensors, Bluetooth, NFC, while some with the camera. There can be many issues due to such problematic firmware. Basically, we are trying to fix issues that are in the firmware. The drivers in the firmware of the device can sometimes be faulty. They are easy to fix if we know the right code and steps.
Sometimes we can fix some issues with just small patch files. All we may need to do is copy the patch file into the SD card and flash them. However most of the time, solving may require reflashing the firmware. This means we have to edit the software, repack and reflash. This is advanced level work but with correct guidance, it can be easy. I have read many sources and successfully done this. This is why I have made this guide to help.
Starting the Android Device Unbrick Process
My guide showcases how I fixed the issues. This means the process I used to solve the driver issues of the old Allwinner Tablet. I tried many things to solve the problem. This includes trying various apps, fixing via “Terminal Emulator“, and patching. It turns out the main problem was drivers not loading properly. In order to fix this, we needed to edit the core system files. I tried to solve this without root but it turns out it couldn’t be done without rooting.
I would advise all of you to root your devices if you need to fix your drivers. Rooting gives deeper and unrestricted access. Magisk provides a great way of gaining root access nowadays. Some manufacturers may not provide the kernel source code, firmware, and even option to unlock the bootloader. These things can be an issue. However, if you have found a way around these, follow the below-given steps. This is just a temporary fix.
1) Root the device
2) Install Terminal Emulator App
3) Use the following codes:
su(Enter)
insmod /vendor/modules/8188eu.ko(Enter)
4) Now go to settings and turn on WiFi. Sometimes it may get stuck but a restart will do the trick.
Note: (8188eu.ko) is the driver module for the Android device.
Finding the Correct Driver
I used the above-given process for around 7 months, and it was frustrating. So I found the final solution, and that was to edit the kernel files. This process can be used to fix broken drivers for any Android device. First of all, you must have a good idea about drivers and their names. See the below list to confirm and find which drivers you need. This is a shortlist of drivers and there are many out there. So please do a good study and identify them properly.
WiFi drivers |
8818eu, bcm4330 |
Audio driver |
sndi2s |
Camera drivers |
gt2005, hi253, hi704, mt9d112, mt9m112, mt9m113, ov2643, ov2655, ov5640 |
ov7670, sp0838 |
G-sensor drivers |
dmard06, bma250, mxc622x |
Ts drivers |
ft5x_ts, mma7660, goodix_touch, gt818_ts, zt8031, goodix811, gt2005 |
After figuring out the needed driver, we can proceed further. In our case, we need 8188eu.ko for WiFi. The main and basic problem is with the script that orders the device to load drivers. The required drivers were not loading. The device is not getting the command to load the required driver. Therefore, all we need to do is add that code. And push the updated image.
Permanently Fix Broken Android Drivers: WiFi Driver Example
I tried pushing the script using file explorer and editors but it doesn’t work. It can only be edited by pulling the file out. Then the only way of installing is flashing. If you can edit the firmware file given by the manufacturer then the pulling process won’t be necessary. Otherwise, you can follow the below-given steps.
- Install the Android SDK and run the ADB shell. Also, enable USB Debugging on Android device before connecting it to the computer. Make sure you are charged above 50%.
Install ADB and run ADB shell:
1) Download from Android Studio and install it in an easier location like shown above. You can also extract zip files available online. They are light and have all the necessary files. Our step uses location as shown in our installation directory image.
2) To make it easy copy the folder into root C:
3) Run adb shell from command.
4) Find the folder named “platform-tools”.
Suppose that the folder containing folder “platform-tools” is “sdk” and it is in “adb” which is in C:\.
5) Run Command (CMD) in your Windows OS while your device is connected.
Type “cd..” as many times required to get to root directory such as “C:”
Follow these commands to start the shell.
cd..
cd..
cd adb
cd sdk
cd platform-tools
adb
adb shell
su(If required for super user permission)
Now let us pull the boot.img file by using new commands.
adb shell
cat /dev/block/nandc > /sdcard/dump/boot.img
(Control+C)
adb pull /sdcard/dump/boot.img *Local Directory*
6) Copy the boot.img to your computer
Extracting and Editing
7) Install Boot Repacker in your PC.
8) Extract the contents of boot.img.
9) Edit “init.sun5i.rc” or “init.sun4i.rc” or “init.sun.rc” whichever you have. These files will include instructions such as “insmod /system/vendor/modules/8188eu.ko” under network.
10) Edit the file using Notepad++ and add the new line “insmod /system/vendor/modules/8188eu.ko” and save it. This is for fixing the issue with WiFi. Other issues require loading commands for different files.
11) Repack the boot.img and copy it to SD Card root directory.
12) Reflash the boot.img file using below given command.
cat /sdcard/boot.img > /dev/block/nandc
Finishing and Starting Again
This method should do the work. It should fix the driver issues permanently. Do a restart after the whole process and check if everything is working or not. Also, make a full backup of your data before doing any of the work. Do a full hard reset and clean the cache to start clean again. It is always smart to do a clean start to make sure everything is working fine. This process helped me to fix my tablet. I hope it does work for you as well. If you have any suggestions to improve this then do share them with us.
Original Published: 2014/12/25