How To Unbrick MTK Device In Linux

HISTORY:

I used a Micromax Unite 2 (A106), a MediaTek MTK6582 model. It was very popular in India around 2013.
At 2016, the device got old and I wanted to move from the stock Android Kitkat 4.4.2. So I flashed some ROM on it, but for some erroneous reason, the device got bricked. Not just any regular bricked which you can fix from the recovery – the device somehow managed to wipe out /system, /data, /cache and even recovery. It had nothing but the boot-loader. Hence it was stuck to the boot-screen forever (2-3 hrs until I plugged off the battery). It wasn’t even charging.
Moreover, I tried to install SP Flash-tool on Linux and I didn’t knew the process, and so I chose to format the whole device except boot-loader. Seeing nothing on the screen, I even interrupted that process. Even the Recovery mode Key combination did not work. My phone was beyond “just bricked”. I had only two option – Either I take it to the service centre and spend thousands as the warranty already expired in 2015, and they would definitely ask a lot of money as they would be servicing a device they don’t have any warranty for; or I could do a clean flash any ROM and build up from there. But all the tutorials available on the internet is about using Flash-Tool on Windows. I couldn’t afford a new phone and I didn’t have Windows. I had to find a way.
After days of studies, I found few ways to use the Flash-Tool on Linux, none of which worked. Only until I combined the methods and improvised. I found a detailed guide on XDA developers which says how to install the SP Flash-Tool on Linux. I followed that and every time it presented me with a “BROM ERROR:S_COM_PORT_OPEN Fail(1013)” Error. I found another tutorial but it was neither about a MTK device nor it worked with the current Flash-Tool.
So I had to combine them and I come up with a way which worked like magic!

So let’s get started.

Requirements:

  1. Ubuntu 16.04.1 (64bit) or higher (or Any other distro).
  2. Sp Flash-Tool v5.1640 (Linux, 64bit) or higher. (http://spflashtools.com/category/linux).
    Flashable ROM. (Any ROM will do). Kitkat is better as it is more stable than Lollipop.
  3. Tune up some music! Time for Action!

Procedure:

To avoid entering wrong commands, copy-paste from here.

  • 1. Boot up a Live version of *Ubuntu 16.04.1 64bit. Yes, that’s right! We will do nothing to mess up our original system installation. We will do nothing on an installed Ubuntu.
  • 2. Open System Settings> Software Sources & Updates> Ubuntu Softwares.
    Tick all the sources (main, universe, restricted and multiverse).
    Close window.
    Hit Ctrl+ALt+T and enter the following command and press Enter.
sudo apt update
  • 3. Wait until it updates the repository. Once done, enter:
sudo apt install default-jdk android-tools-adb android-tools-fastboot lib32ncurses5 lib32z1 libusb-dev
  • 4. After installation, change the downloaded zip file of the SP Flash-Tool to something simple like flashtool.zip and move it to the Home folder.
  • 5. Unzip the Sp Flash-Tool in Home directory. Remember, in Live-mode, your username is ubuntu and password is blank.
unzip ~/flashtool.zip
  • 6. Rename the extracted folder something simple similarly. I named it flashtool. You can make it even smaller like one letter.
  • 7. Navigate to the flashtool folder:
cd ~/flashtool
  • 8. Make two scripts executable:
chmod +x flash_tool
chmod +x flash_tool.sh

If you don’t want to run the scripts as root, read on Step 9. Otherwise, jump to Step 10

  • 9. According to a XDA-Deveoper’s tutorial, now you should add ubuntu (the Live user) in the usergroup dialout to avoid running the script as root, but that is not needed at all if you are cautious.
    I don’t know the consequences if you do that because I did not perform those tasks. So be sure what you are doing. If you still want to know – here is how:
sudo adduser ubuntu dialout
newgrp – dialout
For Arch:
gpasswd -a username uucp
newgrp – uucp

Moving on.

  • 10. We need to add some rules and permissions for the USB. Open a new terminal window without closing the old one.
sudo gedit /etc/udev/rules.d/80-persistent-usb.rules
Paste:
SUBSYSTEM=="usb", ACTION=="add", SYSFS{idVendor}=="0e8d", SYSFS{idProduct}=="*", MODE="0777"
0e8d is the Vendor ID for MTK devices. And mode 0777 means it should be readable, accessible and writable by anyone (rwxrwxrwx).  
Here is a full list: https://developer.android.com/studio/run/device.html
  • 11. Save and enter:
sudo service udev restart
sudo gedit /etc/udev/rules.d/20-mm-blacklist-mtk.rules
Paste:
ATTRS{idVendor}=="0e8d", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="6000", ENV{ID_MM_DEVICE_IGNORE}="1"
  • Save and enter:
sudo service udev restart
  • 12. Back to the old terminal window, without leaving the flashtool directory:
sudo su

(It won’t prompt for a password, since you are using Live usb.)

Run:
./flash_tool.sh
  • 13. The Flash-Tool will run.
  • 14. Click “Load scatter file” under the Download tab and select the appropriate scatter file found in your Custom/Stock ROM’s directory.
  • 15. It will load the rest of the files itself. The default mode is “Download Only”.
  • 16. After this part, I connected my phone (switch off, take battery off for a minute and then insert again but don’t turn on) and it presented me the same old “BROM ERROR:S_COM_PORT_OPEN Fail(1013)” error. Without being disheartened, I chose the option from the drop down list “Firmware upgrade” and hit Download button. Connect your phone via USB cable and voila!

1

  • 17. The progress bar will show red bar, and then puprle (very fast), after that green bar (format progress) and then finally you will see a yellow bar progressing called “Downloading *%”. Once done 100%, a tiny window with a green circle will appear with a white tick on it. Your flashing was succesful.
  • 18. Close the green-tick window and disconnect your phone from the computer. Boot it up with the power button. The first boot takes some time like 5-10 minutes depending on the ROM you flashed.
  • 19. Keep faith, breath and your phone will boot into your newly flashed ROM in no time.
  • 20. Cheers!

Aftermath:

In my case, I flashed a Lollipop ROM. The terrible 5.0 version. Full of bugs and ridiculous. I had to root it with kingroot, flash Lollipop recovery (From my experience: Other than, Philz Recovery for Lollipop, no other recovery works in lollipop).
But that touch-recovery was supersensitive to touch. I wanted to flash a recovery-flashable Kitkat ROM but ended up the old bootloop delelting the system. So againflashed Lollipop. Flashed Recovery. Flashed Kitkat from recovery. Booted into Kitkat and rooted it with Kingroot. Flashed TWRP for Kitkat with Flashify and then restored the entire system backup (I made a entire system backup by TWRP before my device bricked).
Finally I got back my old phone.

--END OF TEXT--

Creative Commons License

Advertisements
How To Unbrick MTK Device In Linux