Wednesday 29 July 2015

Driver Sanity in Windows, Restoring IMEI to Lenovo A820

Driver Sanity in Windows, wrt Restoring IMEI

This guide contains a lot of pictures and checksums, but also a lot of text. If you can't understand something or have any doubts don't do it, I take no responsibility for relaying my experiences here.

I have countless drivers for my Lenovo A820. I collect them. At times I cull them, and keep what I need in 7zip archives.

When I get a new MTK phone, the instructions for that don't consider I might already have drivers installed. This can lead to driver conflicts. Another thing you should beware of before asking for help is that you don't have devices flagged in Device Manager. If your Device Manager looks as flat as this:


Then this isn't a problem for you and you can continue to the Out With the Old (Unseen Driver Conflicts) section.

Install Missing Manufacturer / OEM (eg Dell, HP, Acer etc) Drivers

For years I put up with an unidentified, but disabled "Simple PCI communication interface" or "Simple PCI communication controller". Only after struggling to connect my phone on a VCOM/COM port did I decide keeping this motherboard device deactivated might be a bad idea. I dug out my original factory "drivers and apps" disk and put it in the DVD drive. About 3 minutes later it loaded :)

It wasn't necessary to use the manufacturer's installer. I activated the offending hardware from device manager and either uninstalled it first or just showed it to my DVD drive (more on this process in just a moment, it is this process that is the crux of this document). Windows very efficiently installed just the driver and none of the bloat, it was a minor device I might have lived without.

Out With the Old (Unseen Driver Conflicts)

Infrared taught me a very important lesson in driver management, which essentially saved me having to reinstall Windows or find another, cleaner installation.

Consider the following:

 
The highlighted "Lenovo Composite ADB Interface" is not actually what Infrared used in his pdf tutorial, so obviously there is some flexibility, or his guide may, in my case, have been slightly off. Actually, for the purposes of restoring IMEI, I don't find this entry particularly useful; it only appears when Android is running and hence is not seen by low level tools like SN Station and "IMEI and SN Writer" that saved my IMEI.

I would not have been confident to delete all the drivers without Infrared's guidance and Windows would just install them again after each uninstallation.


Then delete the software which Windows will invariably have "kept safe" to "simplify" future installations.

 
You may have previous installations cached allowing Windows to automagikly reinstall the device. Every time this happens repeat the above procedure to arrive at a "clean" installation w.r.t. this particular driver. Awesome!

I stress this is only for third party drivers, things Windows or your OEM may have preinstalled, may be harder to find better/correct drivers for.

When Window's cache of drivers is empty it will either ask you for one or list it in Device Manager with an exclamation mark nest to it. Job done.

I can't tell you which driver you need for your procedure, its very likely device and possibly ROM specific.

Restoring IMEI

You'll notice in previous screenshots the "Ports (COM & LPT)" entry is displayed in Device Manager. This is because I had my modem in. It helped direct me where I needed to look to find the COM port for the phone. This was, for a long time, only visible fleetingly the instant a connection was made with the powered down phone. Device Manager would flicker once, display the entry for a second, then flicker twice more removing all mention of "Ports (COM & LPT)". You have just a second to right click an offending driver. Once right clicked the clock stops and you can carefully click uninstall. Then tab away and check the instructions. If you have to open the "Ports (COM & LPT)" you'll almost certainly miss it and get frustrated fast. If you have something else there, that's one less click you need in that second.

This driver is essential for META mode to connect your phone with the low level MTK tools. The correct driver will maintain an entry in "Ports (COM & LPT)" all the while the phone is connected in META mode. My driver, from previous ROM upgrades and subsequent phone purchases proved incorrect.



This is the correct one, the incorrect one could well appear identical (mine had a much lower COM number (about 6)). To be sure you must uninstall all previous drivers as outlined in the Out With the Old (Unseen Driver Conflicts) section above. To know when Windows is ready for the correct driver watch for an exclamation mark on the entry, in the case of this particular device the entry will read, "MT65xx Preloader".

At this point you can install the new driver(s). The file I was given (from dropbox) was DriverInstall_v5.14.53_WinXP_Win7.exe,
MD5: aefe6fc53400b8f9a313cbacd4a4f50b,
SHA1: 2f12e07f5785defb81e9f8ab7e501b5d951c8c0f
published my MediaTek. When I go to install it Windows warns that the publisher is unknown. Continue as any other installation. When you are asked (in red!) to install an unsigned driver, go for it, four times! I think this is just MediaTek being cheap not getting MicroSoft to sign and test their drivers. MicroSoft's high false positive rate causes users to blithely dismiss all sorts of security warnings. I don't guarantee these drivers, I use them as do many others.

I'd actually just dismissed exactly four of these warnings installing for my other phone's ROM, with an entirely different installer, a script, so I "knew" what was happening. It would install the unsigned drivers first then install the signed ones over the top. Often signed drivers don't work so I was happy  to try unsigned.

With just these drivers installed they should be sufficient to enter META mode. I'd never before been asked to install four consecutive unsigned drivers in a row, MLais publish a how-to telling me to do this, so now I do.

ADB Drivers

You may want to install an ADB driver just in case, while the phone is running. I have not attempted IMEI restoration without. In all likelihood it will never show up in device manager during the process.

Infrared has sp_drivers_v1.5_lenovo.zip:
MD5: 2e9d1ca627056703f471f2bbe1b199ea
SHA1: 79bbc822e6af5d394ccabe229a8a2640bf146848

I instead used SP_Drivers_EXE_v1.6 from Pakyto's "RESTAURAR IMEI.zip"
MD5: 0be4b2fb53c18d9bc392e5e4cc6f6972
SHA1: d483be492df8785efe00b4416e5f7ba9229895e8

Purely because the zip came with the apdb_modemdb_A820 folder which I could not find from infrared. This folder contains the AP Database and Modem Database essential to all good IMEI recovery tools. With these files there is no need for an image of NVRAM.img (5Mb) as convenient as it may be to rely on software for it.

It's likely in your search for SN_Station and IMEI tools you will be asked to download other drivers. YMMV and I can't provide an optimal solution for all cases, just my experience. Installing drivers by force is often expedient.

I don't see the necessity of these drivers but for completeness I will repeat what Infrared has said, and leave the proof as an exercise for later.

SN_Station / SN_Write_Station_Tool

Infrared's guide to using SN_Station / SN_Write_Station_Tool concurs with at least two other sources I have seen (by Pakyto and BalcanGSM). BalcanGSM lead me to another solution, which I present later.

For completeness I'll outline the process. I didn't ultimately use Pakyto's  apdb_modemdb_A820 because the name of his Modem Database differed to that in Infrared's screenshot.

(from Pakyto)
BPLGUInfoCustomAppSrcP_MT6589_S00_P780_V23
MD5: 0f244cd43a65b9aee65a31b73cbcc00c
SHA1: c6a5a4102c77fbb2493323bc7c9ae9f458a506a7

APDB_MT6589_S01_MAIN2.1_W10.24
MD5: 80a45a9bb5bd5416692901de6974d871
SHA1: 76638fb9cd4234437a5c64f149134b9cb81bcae8


(from https://yadi.sk/d/ylJyJbDjZWm7k, from http://www.mcrf.ru/forum/archive/index.php/t-36527.html)
apdb_modemdb_A820.7z
MD5: f770b3e08a5ec076b592493b38591d44
SHA1: 062578a596b90d05b1cf6a2c37bff324740cc3d6

BPLGUInfoCustomAppSrcP_MT6589_S00_A820_V16
MD5: f5a6a5a28ee227533ccb41c35e7155db
SHA1: 8d41e8d604cc9c4a750b7eb9305f641746d2691f

APDB_MT6589_S01_MAIN2.1_W10.24
MD5: 80a45a9bb5bd5416692901de6974d871
SHA1: 76638fb9cd4234437a5c64f149134b9cb81bcae8


I could not find Infrared's but they are specific to device and come with "original" / "stock" ROMs. I didn't find any with them but the stock S139 on NeedRom should contain them, many others don't. If Pakyto says BPLGUInfoCustomAppSrcP works on the A820, that's good enough for me, but I have only tested BPLGUInfoCustomAppSrcP_MT6589_S00_A820_V16 and am still readjusting to having my IMEI's back.

Pakyto said that the hardest part of using this tool was getting the right drivers. I hope this is clarified in the preceding sections. I found just getting it to install at all was hard, rather than click anything with "msi" in you must click the smaller "setup.exe".

The tool has a one page interface with a slightly strange UI after:





•    Power off disconnected phone.
•    Set everything up as above then click start. (In IMEI Options Pakyto advises using Check Sum, infrared says not, same with function select and 4in1 or IMEI).
•    You will be asked for your serial number, IMEI1, IMEI2 (probably first + 1), BT and WiFi numbers. Once an entry is made for each number the tool continues and can't be revised, which surprised me for a while.

When all data is entered and the log updates as shown below, connect phone:

>>Step: Meta Disconnect with target.
>>Step: Enter func_imei_meta_hdlr_smart_phone_modem();
Write IMEI to smartphone modem nvram
>>—————————————————<<
>>Step1: Start to Connect with target…
COM port searching and preloader handshake…
>>>>>>plug in here<<<<<
<<<<<<phone now shows meta mode>>>>>>
COM port searching and preloader handshake ok
COM port searching and Kernel handshake…
<<<<<<nothing for 5 mins>>>>>>>
<<<<<<eventually SN Station times out>>>>>>

If I connect when already in META mode I don't even pass the preloader handshake. If I connect when the phone is totally off I pass the preloader handshake but hang waiting for the kernel handshake, as shown above. I tried with "official" (quotes because I can't find them from Lenovo anymore) S139 and S147 ROMs, I know the S139 was rooted but I don't understand why the kernel handshake failed.

I used SN_Writer_2.1324.0:




 it was the highest version available and came bundled with Pakyto's "RESTAURAR IMEI.zip" described above. There are many options which may have needed tweaking.

Now, apparently your phone is fixed. I hear this is only a suitable restore procedure from extra virgin stock ROMs. (i.e. format, then downloaded with SP Flash Tools, then use SN_Station.) I'm not 100% convinced because it is long winded and I couldn't restore my IMEI at all using SN_Station. I've seen more concise guides neglecting to mention the formatting and stock ROM download, I suspect it is superfluous caution but often that setup can at least bring phones to a common state.

From links at http://en.miui.com/thread-10061-1-1.html I also picked up
SN_Write_tool_exe_v2.1132.0.rar
MD5: a79a4f4296ce6c3f807180ebed5ea0ff
SHA1: 0aaa640af00d3a663d42f68f88422bfddb88562c

and

SN_Write_tool_exe_v2.1228.0 as part of
Android imei tool.rar
MD5: 15840d67eb37b1ac67aa92d21228887e
SHA1: 6aa6746f6fb8cc26db50cd4a13575d3c67f6d9d3

but that wouldn't install because it was missing "DistFile.cab".

From androidurdu.net I found

SN_Write_tool_v2.1124.1.zip
MD5: 3d51ba55e724ce5e9a5dd908fce63b81
SHA1: 7d49de3cdfd2f3626d157c550193813cd0d9cf10

After many hours I gave up and from somewhere I found

imei&sn writer v1.5.3.rar
MD5: 52f43ae9e73b2279493977ad4f9b68ac
SHA1: f15224419dd9bc440bc006ff53d5efef53fefed5

which contains the 2012 tool IMEI&SN Writer.exe

IMEI&SN Writer

This uses exactly the same files as SN_Station above. I don't know why it doesn't get more love, it saved my phone.

It reported a success when I just flashed the IMEI, far more success than I had with SN_Station.



Success, but I was too tired to remember to what extent. In any case it wasn't acceptable so I repeated with all the fields filled in and it fixed it.




For step 3, Select DB, use exactly the same database files described in the section on SN_Station, or google "apdb_modemdb_A820" and see my checksums. Or try the following (verified).

IMEI&SN Writer V1.5.3.7z (3.25Mb)
MD5: 955fc522fd47376e6f7e3c6e3b1b9fc0
SHA1: dd6e0c0a80a57502c6d8fe2436dd6fc6a19e8798

apdb_modemdb_A820_20150729.7z (5.34Mb)
MD5: 6e6ee6541b5800e8386da1ba7436a9da
SHA1: e80700159bc31ba2d94cdfbfeb351b023e581e2f

No comments:

Post a Comment