[GUIDE][SN_Writer]Restore IMEI, WiFi/Bluetooth Mac, Serial No.[Lenovo_K8_Note]

Search This thread

kk9999gada

Senior Member
If you flashed the Stock ROM using “Download All + Format” option in SP Flash Tool or you wiped NVRAM partition accidently then you probably lost IMEIs, WiFi/Bluetooth Mac Address and Serial No.

Disclaimer:
Code:
/*
*Your Warranty is now void. 
*Neither me nor the developers of tools are responsible.
*You are doing this at your own risk and will 
*solely be responsible if something happens to the device. 
*Make sure you only use the original “IMEI_1, IMEI_2, 
*WiFi/Bluetooth Address, Serial Number” that came with your phone.
*/

Note:
Although, I have tried to keep this guide as simple as possible, I am assuming that you have already flashed Stock ROM using this thread/guide:
https://xdaforums.com/k8-note/how-to/lenovo-k8-note-xt1902-3-fix-dead-hard-t3791839
Which also means the required drivers i.e. “MTK (USB DA COM, Preloader USB VCOM, USB Port, USB VCOM) Driver” and “Lenovo USB Driver” in the thread mentioned above are also installed.

Requirements:

  1. Lenovo K8 Note with Stock ROM.
  2. Original IMEI_1, IMEI_2, WiFi/Bluetooth Mac Address, Serial Number. (Find on Phone’s box)
  3. SN Write Tool (Download)
  4. Database Files
  5. ADB Tools (Inside SN_Write_Tool\Android)
  6. Basic ADB know-how.
  7. And a PC. (obviously)

USB Debugging:
Before we proceed, make sure “USB Debugging” is enabled on phone:

  1. Navigate to, Settings > System > About Phone > Build Number (Tap 7 times) to enable “Developer Options”.
  2. Now, Enable “USB Debugging” in Settings > System > Developer Options.

Flashing Procedure:
  1. Extract SN Write. (For Example, Location: “E:\ SN_Write_Tool_v1.1916.00”)
  2. Open SN Write Tool (SN_Writer.exe).
  3. Make sure all the Preliminary steps mentioned in below sections have been performed – Obtaining DB files, Configuring SN Write Tool, Understanding Barcode.
  4. Switch off the phone, while keeping the cable unplugged
  5. Click “Start”.
  6. Enter Original IMEI_1, IMEI_2, WiFi/Bluetooth Mac Address, Barcode and press “Ok”
  7. Connect your phone.
  8. Now your phone will automatically boot in Meta Mode.
  9. Wait for the Process to finish.
  10. Now you will see “Pass” message if everything completes successfully.
  11. Now it will again ask to enter the details. Click “Cancel
  12. The phone will now switch off. Then boot it manually.
  13. That’s it. Your phone is now back to normal. Now, you can see Serial No. in adb too.

Obtaining Database(DB) files:
In order to restore everything we need 2 Database files, which can be obtained by following the procedure below:

  1. Extract SN_Write Tool. (For Example, Location: “E:\ SN_Write_Tool_v1.1916.00”)
  2. Navigate to “Android” folder inside SN_Write_Tool folder.
  3. Keep Shift Key Pressed and Right Click inside the folder. Select “Open Command / PowerShell window here”.
  4. Type
    Code:
    adb devices
  5. You will receive a prompt on your phone. Select “Ok”. The device will appear in the list. (Something like “0123456 device”)
  6. Now, type these commands:
    Code:
    adb pull /vendor/etc/mddb Database
    adb pull /system/etc/apdb Database
  7. Now, navigate to “E:\ SN_Write_Tool_v1.1916.00\Android\Database”. There will be around 23 Files. We only Need 2 files from that.

    • APDB_MT6797_S01_alps-trunk-o0.tk_W19.10 (Approx. size 145kb)
    • MDDB_InfoCustomAppSrcP_MT6797_S00_MANNING_O_Vxx_x_ulwctg_n.EDB (Approx. size 59mb)
      Note: Name and size may slightly vary depending upon your firmware.
  8. Copy the above two files to some other destination (optional).
Note: If you are using PowerShell then, instead of “adb” type “./adb”

Configuring SN Writer Tool:

    • Open “SN_Writer.exe” inside “E:\ SN_Write_Tool_v1.1916.00”.
    • Now Click “System Config”.
    • Check “Dual IMEI” (Do not check “Dual IMEI Same” under that).
    • In Write options select Barcode, IMEI, BT Address, WiFi Address. (If you don’t have WiFi/BT Address then don’t check/select them).
    • Check “Load AP DP from DUT” and “Load Modem DB from DUT”.
    • Click “MD1_DB” and select the file that you pulled using ADB i.e.
      MDDB_InfoCustomAppSrcP_MT6797_S00_MANNING_O_Vxx_x_ulwctg_n.EDB
    • Click “AP_DB” and select the file that you pulled using ADB i.e.
      APDB_MT6797_S01_alps-trunk-o0.tk_W19.10
    • Now click “Save”.

attachment.php

Understanding Barcode:
It took me lots n lots of trial & error and googling before finding the correct (probably) Barcode format that we need to use in SN Writer. Trust me, it was not an easy task. Below are three iterations of barcode, use any:

First Iteration (recommended):

The Barcode field consists if two parts, call them Spaces and Serial No.


Total Length(33 Characters) = (25 Spaces) + SN(8)


For Example,

If my SN written on the box is “XYZ1223W”, my barcode will be (without quotes):

Code:
“                         XYZ1223W”


or

Second Iteration (recommended 2):

In this iteration, we'll assume that the Barcode field in SN Write Tool is a combination of three parts. Lets call it First (PN), Second and Third Part (SN). You can find PN & SN on the box of phone. I am not sure about the second part with 15 characters. You can leave the second part, just give 15 Spaces.


Total Length(33 Characters) = PN(10) + (15 Spaces) + SN(8)


For Example,

If my PN written on the box is “AB1D1112IN” and SN is “XYZ1223W”, my barcode will be (without quotes):

Code:
“AB1D1112IN               XYZ1223W”

or

Third Iteration:

There can also be a third iteration for barcode, though I am not sure about this and is completely based on my assumption. In the second part, as mentioned above we are leaving 15 spaces, but in this, we will use the product barcode of 13 characters (Refer Barcode No. 2 in the attached image below) instead of 15 spaces

attachment.php


For Example,

If my barcode (no. 2 in image above) of 13 charcters is “0123456789012”, then in SN Writer we will write (without quotes):


Total Length(33 Characters) = PN(10) + (Space) + (13) + (Space)+ SN(8)


Code:
“AB1D1112IN 0123456789012 XYZ1223W”

Note the space after each part, which makes up for two characters that we require.

As you can see in the Screenshot attached in this post, “Lenovo Help” app recognizes the device as it is meant to be recognized.


attachment.php


WiFi/Bluetooth Mac Address:
Though, it is not a big deal if you lost WiFi/Bluetooth Mac Addresses. They will still work fine even without it.
If you didn’t backup nvram before or didn’t note down WiFi/Bluetooth Mac address then you can’t get it back. But, if you did TWRP backup of nvram then you can restore it and get back both the original Mac addresses.

FAQs:
SN Writer not booting phone into Meta Mode automatically.

Make sure drivers are installed

or

Boot Manually in Meta Mode using Power Button + Volume Down. Check Already in Meta Mode.

Screenshot_(1).jpg

Do I need to be on Stock ROM?
Yes.
 

Attachments

  • SN_Write_Tool_v1.1916.00.zip
    8.2 MB · Views: 1,712
  • Barcode.jpg
    Barcode.jpg
    50.4 KB · Views: 3,751
  • SN_Writer_Home.jpg
    SN_Writer_Home.jpg
    35.7 KB · Views: 404
  • SN_Fields.jpg
    SN_Fields.jpg
    23 KB · Views: 401
  • SN_Writer_System_Config_Database_Loaded.jpg
    SN_Writer_System_Config_Database_Loaded.jpg
    100.5 KB · Views: 4,273
  • Lenovo_App.png
    Lenovo_App.png
    54.9 KB · Views: 2,351
Last edited:

softmaster3

Member
Feb 2, 2019
34
2
thanks alot man
I managed to get apdb files but when i try your command to get mddb i get that error
adb: error: failed to copy '/etc/mddb' to 'Database\mddb': read failed: Is a directory
any help?
and how to know if my bluetooth or wifi mac address is missing and where to find them because nothing of that is written on the phone box
 
Last edited:

kk9999gada

Senior Member
thanks alot man
I managed to get apdb files but when i try your command to get mddb i get that error
adb: error: failed to copy '/etc/mddb' to 'Database\mddb': read failed: Is a directory
any help?
and how to know if my bluetooth or wifi mac address is missing and where to find them because nothing of that is written on the phone box

Edit: Solved

Android will automatically generate Wi-Fi / Bluetooth address if not found. No need to worry about that. Thats why I I have mentioned in the post that it will still work fine even without it.
 
Last edited:

M.A.P

Senior Member
You mentioned wrong paths, /etc/apdb is fine but /etc/mddb doesn't exist(empty folder was created in latest update but still no contents in it). mddb is under /vendor/etc/mddb. Just to avoid confusion and even to make this guide suitable for users who pull the file from TWRP make the /etc/apdb to /system/etc/apdb

---------- Post added at 01:03 PM ---------- Previous post was at 01:00 PM ----------

thanks alot man
I managed to get apdb files but when i try your command to get mddb i get that error
adb: error: failed to copy '/etc/mddb' to 'Database\mddb': read failed: Is a directory
any help?
and how to know if my bluetooth or wifi mac address is missing and where to find them because nothing of that is written on the phone box
instead of "adb pull /etc/mddb" use "adb pull /vendor/etc/mddb"
 

softmaster3

Member
Feb 2, 2019
34
2
You mentioned wrong paths, /etc/apdb is fine but /etc/mddb doesn't exist(empty folder was created in latest update but still no contents in it). mddb is under /vendor/etc/mddb. Just to avoid confusion and even to make this guide suitable for users who pull the file from TWRP make the /etc/apdb to /system/etc/apdb

---------- Post added at 01:03 PM ---------- Previous post was at 01:00 PM ----------


instead of "adb pull /etc/mddb" use "adb pull /vendor/etc/mddb"
thanks a lot guys
u two just made my day
and M.A.P u r a life saver i cant thank you enough for ur work on treble for k8 note and ur help here
 

kk9999gada

Senior Member
You mentioned wrong paths, /etc/apdb is fine but /etc/mddb doesn't exist(empty folder was created in latest update but still no contents in it). mddb is under /vendor/etc/mddb. Just to avoid confusion and even to make this guide suitable for users who pull the file from TWRP make the /etc/apdb to /system/etc/apdb

Done. Thanks for suggestion.
 
  • Like
Reactions: softmaster3

softmaster3

Member
Feb 2, 2019
34
2
i did write the serial, check warranty and its good
but noticed that the serial written on phone box is 12 Character long not just 8 and sn writer did write 8 only not the whole 12
is that correct??
 

psbtheone

New member
Oct 16, 2008
2
0
Hi, with the help of your guide, i have recovered my phone. But the problem is still same as it restarts repeatedly,sometimes it worked for 1 day but then again rewstarting. Is there any permanent solution for this?
 

0xf0rd

Member
Jun 16, 2011
42
0
Ottawa
WP7 Barcode

Hi,

I was wondering how did you find the correct Barcode format? I have spent 2 days trying with different combinations and I still have not succeeded in restoring the serial number in my Oukitel WP7. It still gives me the generic serial number 123456789ABCDEF.
 
Last edited:

kk9999gada

Senior Member
Hi,

I was wondering how did you find the correct Barcode format? I have spent 2 days trying with different combinations and I still have not succeeded in restoring the serial number in my Oukitel WP7. It still gives me the generic serial number 123456789ABCDEF.

Did some Trial and Error to figure out correct (probably) barcode format. In addition to this, you'll also need specific database files for your phone in order restore it.
 

0xf0rd

Member
Jun 16, 2011
42
0
Ottawa
Did some Trial and Error to figure out correct (probably) barcode format. In addition to this, you'll also need specific database files for your phone in order restore it.

Man this thing is driving me crazy. I have tried every single combinations and did so many googling and there are not a lot of information about this. The other problem is that the Oukitel WP7 does not have a Product Number written on the box or on the back of the device, there is only a serial number and a barcode with 13 numbers under it. I even tried the FCC ID that is written at the top. I have been spending few days trying. I think the only way to know the correct format is to ask someone who has the same device to view it using Maui Meta by viewing the hex format or exporting the NVRAM to an ini file. I doubt anyone would help me with this though. I have the database files from the stock image. Anyways thanks man
 

kk9999gada

Senior Member
Man this thing is driving me crazy. I have tried every single combinations and did so many googling and there are not a lot of information about this. The other problem is that the Oukitel WP7 does not have a Product Number written on the box or on the back of the device, there is only a serial number and a barcode with 13 numbers under it. I even tried the FCC ID that is written at the top. I have been spending few days trying. I think the only way to know the correct format is to ask someone who has the same device to view it using Maui Meta by viewing the hex format or exporting the NVRAM to an ini file. I doubt anyone would help me with this though. I have the database files from the stock image. Anyways thanks man

That would be better.

There is no need for Part No. or Barcode (both can be replaced with spaces). The only thing required is Serial No.
 

0xf0rd

Member
Jun 16, 2011
42
0
Ottawa
That would be better.

There is no need for Part No. or Barcode (both can be replaced with spaces). The only thing required is Serial No.

I tried that as well with so many different ways and with spaces and without. I guess the length also matters. I even filled all 63 characters to see if anything changed in settings but it still showed the generic serial number. I am starting to wonder if sn tool is writing the data in the correct location. I am sure I am using the correct database files because I got them from the factory image from the official website and I am able to write the IMEIs correctly.

I am thinking now to go through the serial number which is 16 characters from left to right. Each time I add a space on the left and no spaces after the serial so first try would be only the serial then a 1 space before it then two spaces before it until I reach the 63 characters. This is like 50 restarts and if that does not work I will try in a same manner but this time full up spaces after the serial and do the same by adding one space on the left each time so first try would be the serial number and the remaining will be spaces up to 63 characters the second time will be one space before the serial and remaining spaces after it up to 63 and so one. I know it's crazy but if all that does not work I am not sure what else to do.
 

Gomeman

Senior Member
Aug 31, 2020
53
16
Hi
This happened to me with this dangerous spflash tool. WIPED everything. I followed this guide , It PASSES without any errors but doesnt write anything to my phone. Box has a code bar like this 6 970502 270581 then MEID code of 14 characters , than IMEI1 code and a IMEI2 code and finaly a S/N code of 15 characters.
As i said it PASS but doesnt show IMEI, version base band , bluetooth address, Serial number ,
Thank you very much spflash tool. Had to get another phone.
Phone is a MEDIATEK mt6763T.
Only thing that i dont understand from guide is how to enter Serial number in sn writer. Did it many ways. 33 characters and 64 characters with spaces.
If anyone has any idea , please show me the way. thx.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    If you flashed the Stock ROM using “Download All + Format” option in SP Flash Tool or you wiped NVRAM partition accidently then you probably lost IMEIs, WiFi/Bluetooth Mac Address and Serial No.

    Disclaimer:
    Code:
    /*
    *Your Warranty is now void. 
    *Neither me nor the developers of tools are responsible.
    *You are doing this at your own risk and will 
    *solely be responsible if something happens to the device. 
    *Make sure you only use the original “IMEI_1, IMEI_2, 
    *WiFi/Bluetooth Address, Serial Number” that came with your phone.
    */

    Note:
    Although, I have tried to keep this guide as simple as possible, I am assuming that you have already flashed Stock ROM using this thread/guide:
    https://xdaforums.com/k8-note/how-to/lenovo-k8-note-xt1902-3-fix-dead-hard-t3791839
    Which also means the required drivers i.e. “MTK (USB DA COM, Preloader USB VCOM, USB Port, USB VCOM) Driver” and “Lenovo USB Driver” in the thread mentioned above are also installed.

    Requirements:

    1. Lenovo K8 Note with Stock ROM.
    2. Original IMEI_1, IMEI_2, WiFi/Bluetooth Mac Address, Serial Number. (Find on Phone’s box)
    3. SN Write Tool (Download)
    4. Database Files
    5. ADB Tools (Inside SN_Write_Tool\Android)
    6. Basic ADB know-how.
    7. And a PC. (obviously)

    USB Debugging:
    Before we proceed, make sure “USB Debugging” is enabled on phone:

    1. Navigate to, Settings > System > About Phone > Build Number (Tap 7 times) to enable “Developer Options”.
    2. Now, Enable “USB Debugging” in Settings > System > Developer Options.

    Flashing Procedure:
    1. Extract SN Write. (For Example, Location: “E:\ SN_Write_Tool_v1.1916.00”)
    2. Open SN Write Tool (SN_Writer.exe).
    3. Make sure all the Preliminary steps mentioned in below sections have been performed – Obtaining DB files, Configuring SN Write Tool, Understanding Barcode.
    4. Switch off the phone, while keeping the cable unplugged
    5. Click “Start”.
    6. Enter Original IMEI_1, IMEI_2, WiFi/Bluetooth Mac Address, Barcode and press “Ok”
    7. Connect your phone.
    8. Now your phone will automatically boot in Meta Mode.
    9. Wait for the Process to finish.
    10. Now you will see “Pass” message if everything completes successfully.
    11. Now it will again ask to enter the details. Click “Cancel
    12. The phone will now switch off. Then boot it manually.
    13. That’s it. Your phone is now back to normal. Now, you can see Serial No. in adb too.

    Obtaining Database(DB) files:
    In order to restore everything we need 2 Database files, which can be obtained by following the procedure below:

    1. Extract SN_Write Tool. (For Example, Location: “E:\ SN_Write_Tool_v1.1916.00”)
    2. Navigate to “Android” folder inside SN_Write_Tool folder.
    3. Keep Shift Key Pressed and Right Click inside the folder. Select “Open Command / PowerShell window here”.
    4. Type
      Code:
      adb devices
    5. You will receive a prompt on your phone. Select “Ok”. The device will appear in the list. (Something like “0123456 device”)
    6. Now, type these commands:
      Code:
      adb pull /vendor/etc/mddb Database
      adb pull /system/etc/apdb Database
    7. Now, navigate to “E:\ SN_Write_Tool_v1.1916.00\Android\Database”. There will be around 23 Files. We only Need 2 files from that.

      • APDB_MT6797_S01_alps-trunk-o0.tk_W19.10 (Approx. size 145kb)
      • MDDB_InfoCustomAppSrcP_MT6797_S00_MANNING_O_Vxx_x_ulwctg_n.EDB (Approx. size 59mb)
        Note: Name and size may slightly vary depending upon your firmware.
    8. Copy the above two files to some other destination (optional).
    Note: If you are using PowerShell then, instead of “adb” type “./adb”

    Configuring SN Writer Tool:

      • Open “SN_Writer.exe” inside “E:\ SN_Write_Tool_v1.1916.00”.
      • Now Click “System Config”.
      • Check “Dual IMEI” (Do not check “Dual IMEI Same” under that).
      • In Write options select Barcode, IMEI, BT Address, WiFi Address. (If you don’t have WiFi/BT Address then don’t check/select them).
      • Check “Load AP DP from DUT” and “Load Modem DB from DUT”.
      • Click “MD1_DB” and select the file that you pulled using ADB i.e.
        MDDB_InfoCustomAppSrcP_MT6797_S00_MANNING_O_Vxx_x_ulwctg_n.EDB
      • Click “AP_DB” and select the file that you pulled using ADB i.e.
        APDB_MT6797_S01_alps-trunk-o0.tk_W19.10
      • Now click “Save”.

    attachment.php

    Understanding Barcode:
    It took me lots n lots of trial & error and googling before finding the correct (probably) Barcode format that we need to use in SN Writer. Trust me, it was not an easy task. Below are three iterations of barcode, use any:

    First Iteration (recommended):

    The Barcode field consists if two parts, call them Spaces and Serial No.


    Total Length(33 Characters) = (25 Spaces) + SN(8)


    For Example,

    If my SN written on the box is “XYZ1223W”, my barcode will be (without quotes):

    Code:
    “                         XYZ1223W”


    or

    Second Iteration (recommended 2):

    In this iteration, we'll assume that the Barcode field in SN Write Tool is a combination of three parts. Lets call it First (PN), Second and Third Part (SN). You can find PN & SN on the box of phone. I am not sure about the second part with 15 characters. You can leave the second part, just give 15 Spaces.


    Total Length(33 Characters) = PN(10) + (15 Spaces) + SN(8)


    For Example,

    If my PN written on the box is “AB1D1112IN” and SN is “XYZ1223W”, my barcode will be (without quotes):

    Code:
    “AB1D1112IN               XYZ1223W”

    or

    Third Iteration:

    There can also be a third iteration for barcode, though I am not sure about this and is completely based on my assumption. In the second part, as mentioned above we are leaving 15 spaces, but in this, we will use the product barcode of 13 characters (Refer Barcode No. 2 in the attached image below) instead of 15 spaces

    attachment.php


    For Example,

    If my barcode (no. 2 in image above) of 13 charcters is “0123456789012”, then in SN Writer we will write (without quotes):


    Total Length(33 Characters) = PN(10) + (Space) + (13) + (Space)+ SN(8)


    Code:
    “AB1D1112IN 0123456789012 XYZ1223W”

    Note the space after each part, which makes up for two characters that we require.

    As you can see in the Screenshot attached in this post, “Lenovo Help” app recognizes the device as it is meant to be recognized.


    attachment.php


    WiFi/Bluetooth Mac Address:
    Though, it is not a big deal if you lost WiFi/Bluetooth Mac Addresses. They will still work fine even without it.
    If you didn’t backup nvram before or didn’t note down WiFi/Bluetooth Mac address then you can’t get it back. But, if you did TWRP backup of nvram then you can restore it and get back both the original Mac addresses.

    FAQs:
    SN Writer not booting phone into Meta Mode automatically.

    Make sure drivers are installed

    or

    Boot Manually in Meta Mode using Power Button + Volume Down. Check Already in Meta Mode.

    Screenshot_(1).jpg

    Do I need to be on Stock ROM?
    Yes.
    2
    You mentioned wrong paths, /etc/apdb is fine but /etc/mddb doesn't exist(empty folder was created in latest update but still no contents in it). mddb is under /vendor/etc/mddb. Just to avoid confusion and even to make this guide suitable for users who pull the file from TWRP make the /etc/apdb to /system/etc/apdb

    ---------- Post added at 01:03 PM ---------- Previous post was at 01:00 PM ----------

    thanks alot man
    I managed to get apdb files but when i try your command to get mddb i get that error
    adb: error: failed to copy '/etc/mddb' to 'Database\mddb': read failed: Is a directory
    any help?
    and how to know if my bluetooth or wifi mac address is missing and where to find them because nothing of that is written on the phone box
    instead of "adb pull /etc/mddb" use "adb pull /vendor/etc/mddb"
    1
    You mentioned wrong paths, /etc/apdb is fine but /etc/mddb doesn't exist(empty folder was created in latest update but still no contents in it). mddb is under /vendor/etc/mddb. Just to avoid confusion and even to make this guide suitable for users who pull the file from TWRP make the /etc/apdb to /system/etc/apdb

    Done. Thanks for suggestion.