FORUMS
Remove All Ads from XDA

How to lock bootloader after it was unlocked

500 posts
Thanks Meter: 140
 
By sergsinger, Senior Member on 12th December 2017, 08:40 AM
Post Reply Email Thread
This method was tested on P2a42 4/32 and P2c72 4/64 (both smartphones has 251 firmware installed).

Please, pay attention and read carefully:
You have a risk that P2 will go from EDL (9008) mode to 900E while you make a reconnect of connected to PC phone.
If you haven't successfully returned it by yourself into 9008 state - the only way is repair service. See details on 4Th step below the short instruction.
ADB and EDL (9008) drivers have to be pre-installed on your PC.

For those, who faced with flashing firmware, gaining root, working with ADB and Fastboot commands, EDL mode on P2 and so on, here is the short instruction:
1. Wipe sp if you have root: dd if=/dev/zero of=/dev/block/bootdevice/by-name/sp .
2. Wipe secinfo via Fastboot: fastboot erase secinfo .
3. Wipe userdata via Fastboot: fastboot erase userdata .
4. P2 is connected to PC in EDL (9008) mode, make a reset via launching blank-flash.bat from blankflash folder.
5. Flash 251 firmware as for unlocked device using START script .
6. Choose region ( ####682# ) and then make a reset ( ####7777# ).
7. That's all folks! Now you have locked P2 with a region that you want. So you can set the phone as you always do.


Below there is the same instruction, but detailed and with pictures.

From Unlocked to Locked state on P2.
1. Wipe sp if you have root: dd if=/dev/zero of=/dev/block/bootdevice/by-name/sp .
On this step you can use Total Commander with ADB plugin (YouTube will help you, there are tons of videos about it).
I prefer not to use PC, if there is another way.
What I've done:
Android Terminal Emulator installed and launched.
Gave it permission to root access.
In Emulator typed su and pressed Enter.
Sign $ will turned to # , which means that further commands will be under root access.
Type command: dd if=/dev/zero of=/dev/block/bootdevice/by-name/sp and press Enter.
If all done right, so you will see: Screenshot 1.
Click image for larger version

Name:	Screenshot 1.jpeg
Views:	1634
Size:	117.9 KB
ID:	4358523

2. Wipe secinfo via Fastboot: fastboot erase secinfo .
Turn off P2.
Boot it into Fastboot mode - press and hold two buttons (Power And Volume -), on P2 screen you will see Fastboot mode: Screenshot 2.
Click image for larger version

Name:	Screenshot 2.jpg
Views:	1480
Size:	260.2 KB
ID:	4358524

Connect P2 to PC (it is recommended not to use card readers; connect to USB which are situated on motherboard for PC, there is an exception for notebook (laptop)).
Press right mouse button and hold Shift on ADB folder, which is placed in the root of Disc C (С:\), choose "Open command line" - a CMD window will appear on the screen of PC.
In CMD window type fastboot erase secinfo and press Enter.
If all done properly, all drivers set properly, on the screen of your PC you will see: Screenshot 3.
Click image for larger version

Name:	Screenshot 3.jpg
Views:	1432
Size:	108.4 KB
ID:	4358525

3. Wipe userdata via Fastboot: fastboot erase userdata .
Continue in CMD window. Type fastboot erase userdata and press Enter.
On the screen of your PC you will see: Screenshot 4.
Click image for larger version

Name:	Screenshot 4.jpg
Views:	1232
Size:	116.8 KB
ID:	4358526

Close CMD window on PC.

4. P2 connected to PC in EDL (9008) mode, make a reset via launching blank-flash.bat from blankflash folder.
blankflash folder must be placed in the root of Disc C (С:\).
On PC you must hold opened window of "Device manager" with opened string "Ports (COM and LPT)".
Your P2 must be connected to PC in EDL (9008) mode.
Use P2 very carefully without further re-connections, because there is a high risk, that P2 can go to 900E mode.
P2 connected to PC, press and hold all three buttons (Power and both Volume).
Hold buttons (phone will be rebooted twice) until you will see "Qualcomm HS-USB QDLoader9008 (COM12)" in opened window of device manager in string "Ports (COM and LPT)".
You might get another number of port (not only 12Th), it doesn't matter.
The main aim is "Qualcomm HS-USB QDLoader9008..." string in device manager.
Please, be very careful, because even little re-press of button or re-connect of cable will send your P2 to 900E mode with constant vibration and blue LED.
Try to restore phone to EDL (9008) mode by pressing and holding three buttons.
If you have no luck (from 900E to EDL) - congrats, you've got a brick.
From this point you should ask for help in repair service.
Going further, if all is going right and P2 connected to PC in EDL (9008) mode.
In device manager window on PC you will see this: Screenshot 5.
Click image for larger version

Name:	Screenshot 5.jpg
Views:	1252
Size:	83.4 KB
ID:	4358527

From blankflash folder launch (double click of left mouse button) blank-flash.bat: Screenshot 6.
Click image for larger version

Name:	Screenshot 6.jpg
Views:	1172
Size:	72.5 KB
ID:	4358528

You will see a CMD window which shows you a reset process of your P2.
If all done properly (without any "ERROR False"), you will see: Screenshot 7.
Click image for larger version

Name:	Screenshot 7.jpg
Views:	1260
Size:	165.3 KB
ID:	4358529

In the end of reset your P2 will automatically boots from EDL (9008) mode to Fastboot mode: Screenshot 8.
Click image for larger version

Name:	Screenshot 8.jpg
Views:	1266
Size:	257.3 KB
ID:	4358530

I suppose that there is no need to speak about 5Th and 6Th steps, because it is a basic knowledge, that you should know, when you are going to lock bootloader on P2.


Important notice.
You have to use original or other cable that has been already successfully used in Fastboot mode with your Р2.
The simple way to check cable is to type fastboot oem config in CMD and look what info it will give to you.

For those, who have already locked bootloader, it is strictly recommended not to flash stock ROM via flashall.bat.
For flashing stock you should use method for unlocked device, so you need to use START script.
All will go right if you will flash via flashall.bat after bootloader was locked, without any errors, Р2 will be booted as usual - Wi-Fi, SIM-cards (with names of operators), IMEI's and Serial number - all will be OK ...
But!
Calling, SMS and Mobile data will not work, you will see crosses on antenna icons in Status bar (in the string of modem firmware in "About" you will see "X" instead of "R" (Screenshot 9, 10) as it was, modems region will be defective).
Click image for larger version

Name:	Screenshot 9.jpeg
Views:	1302
Size:	190.1 KB
ID:	4358708Click image for larger version

Name:	Screenshot 10.jpeg
Views:	1244
Size:	189.8 KB
ID:	4358709

You can switch on/of Mobile data from Notification drawer, but there will be no connection, only Wi-Fi will work.
I am searching for solution of this problem.
As soon as it will be ready, it will be posted here. See post #2.


ADB folder (download, unzip) - ADB.rar
blankflash folder (download, unzip) - blankflash.rar

All thanks addresses to https://forum.xda-developers.com/member.php?u=279908.
I've just translated it from Russian to English from 4PDA site

Good luck and have a nice day!
Remember ...backup rules.
The Following 10 Users Say Thank You to sergsinger For This Useful Post: [ View ] Gift sergsinger Ad-Free
 
 
12th December 2017, 08:40 AM |#2  
sergsinger's Avatar
OP Senior Member
Thanks Meter: 140
 
More
Info 2 Solution.
Your phone must be unlocked and you must already have TWRP-backups of modem (NON-HLOS) and EFS from Р2.

1. Unlock bootloader.
2. Install TWRP.
3. Restore modem (NON-HLOS) and EFS in TWRP - you will get working modem, but there might be no sound in telephony.
4. You should install modem image via TWRP for Android 6 or 7 to get back to a working telephony (for additional instructions see post #3).

Later, if there will be a method which will work without TWRP-backups and possibly without unlock of bootloader, it will be posted here.

Modem download links:
Android 6 (062): http://lenovo-forums.ru/applications...t.php?id=75313
Android 7 (244): http://lenovo-forums.ru/applications...t.php?id=75314
The Following 4 Users Say Thank You to sergsinger For This Useful Post: [ View ] Gift sergsinger Ad-Free
12th December 2017, 08:58 AM |#3  
sergsinger's Avatar
OP Senior Member
Thanks Meter: 140
 
More
Info 2 How to restore a modem.
Important notice - you need to use modem with the same OS version which is installed on your phone.

Look here:
Firmware 062 - this is Android 6.
Firmware 233 and higher - this is Android 7.

Flash this:
For Android 6 - Modem_P2_062_ROW.zip
For Android 7 - Modem_P2_244_ROW.zip

Flash modem via TWRP:
1. Download zip for OS that you need (do not unzip it, rename or choose extension).
2. Copy to the phone memory (or to external micro-SD card).
3. Boot to TWRP and act as it is shown on the screenshots ...
Click image for larger version

Name:	Screenshot 1.png
Views:	504
Size:	110.5 KB
ID:	4358546Click image for larger version

Name:	Screenshot 2.png
Views:	506
Size:	128.0 KB
ID:	4358547Click image for larger version

Name:	Screenshot 3.png
Views:	510
Size:	168.7 KB
ID:	4358548Click image for larger version

Name:	Screenshot 4.png
Views:	494
Size:	137.2 KB
ID:	4358549Click image for larger version

Name:	Screenshot 5.png
Views:	502
Size:	133.2 KB
ID:	4358550
The Following 4 Users Say Thank You to sergsinger For This Useful Post: [ View ] Gift sergsinger Ad-Free
13th December 2017, 03:22 PM |#4  
Senior Member
Flag Reggio Emilia
Thanks Meter: 117
 
More
EDIT: did the first step wrong, now it's Locked
13th December 2017, 09:49 PM |#5  
Senior Member
Thanks Meter: 383
 
More
Do you have data and calls working?

Enviado desde mi Lenovo P2a42 mediante Tapatalk
14th December 2017, 06:51 PM |#6  
Senior Member
Thanks Meter: 26
 
More
Is the warranty back if the bootloader is relocked?
14th December 2017, 07:44 PM |#7  
sergsinger's Avatar
OP Senior Member
Thanks Meter: 140
 
More
Quote:
Originally Posted by Danoz88

Is the warranty back if the bootloader is relocked?

It is a difficult question.
I suppose, that official repair service can detect it.
Remember how you unlocked P2 at first time: you asked for unlock with internet connection and Lenovo ID, there is a possibility, that some data about it stored and can be used for different purposes.
15th December 2017, 10:40 AM |#8  
Senior Member
Thanks Meter: 26
 
More
Quote:
Originally Posted by sergsinger

It is a difficult question.
I suppose, that official repair service can detect it.
Remember how you unlocked P2 at first time: you asked for unlock with internet connection and Lenovo ID, there is a possibility, that some data about it stored and can be used for different purposes.

Thanks I thought the same. But in this case why should we go back to locked bootloader
15th December 2017, 10:49 AM |#9  
sergsinger's Avatar
OP Senior Member
Thanks Meter: 140
 
More
Quote:
Originally Posted by Danoz88

why should we go back to locked bootloader

It is personal decision. May be someone don't like to see "UNLOCKED" state.
15th December 2017, 01:14 PM |#10  
Senior Member
Flag Thiruvananthapuram
Thanks Meter: 122
 
More
Quote:
Originally Posted by sergsinger

It is a difficult question.
I suppose, that official repair service can detect it.
Remember how you unlocked P2 at first time: you asked for unlock with internet connection and Lenovo ID, there is a possibility, that some data about it stored and can be used for different purposes.

I agree... But there are some reports on this forum suggesting otherwise.
One common report is the replacement of motherboard for bricked devices, that too for unlocked devices.
31st December 2017, 08:29 AM |#11  
Senior Member
Flag New Delhi
Thanks Meter: 228
 
More
Locked Boot-loader with just (3) steps:
1. Wipe sp if you have root: dd if=/dev/zero of=/dev/block/bootdevice/by-name/sp .
2. Wipe secinfo via Fastboot: fastboot erase secinfo .
3. Flash fastboot images(Stock files).

* I was using Cardinal AOSP 8.0.0

*Blankflash not used

Thanks Locked
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes