New idea Bootloader relock and unlock (for people who can't do this using LG method)

Search This thread

Gryff302

Senior Member
Jan 13, 2013
62
25
Well I'm not sure if that's the case of the nv partition. Just a guess and a possible problem.

Sent from my LG-P769 using XDA Free mobile app
 

er.davinder

Senior Member
Jun 14, 2011
288
175
Looking for GPS location
LeEco Le 2
relock bootloader

root and install busybox
install 2 init recovery
make back on ext sdcard. and keep to safe place

(unlock the boot loader
flash whatever rom you like.
play with it for couple of days )

restore backup of rooted stock rom

this should also lock the bootloader again.
remove recovery
unroot the device
get your warranty back.
 

adamo1139

Member
Jul 30, 2014
46
3
i dont think that gonna work...

Napisane używając SwiftKey, zaszyfrowane Enigmą i wysłane kablem Ethernet
 

JulianJenner

Senior Member
Apr 17, 2013
4,796
1,936
Arnhem
???

relock bootloader

root and install busybox
install 2 init recovery
make back on ext sdcard. and keep to safe place

(unlock the boot loader
flash whatever rom you like.
play with it for couple of days )

restore backup of rooted stock rom

this should also lock the bootloader again.
remove recovery
unroot the device
get your warranty back.
@er.davinder
Is this an idea?
Or that you even tried it and does it work?
 

afronoia

Member
Oct 9, 2013
45
9
I doubt it will work.
I still have CWM backup of stockROM on my SDcard and have been switching back-and-forth from some customROMs to stockROM and vise-versa.
If restoring backup of stockROM re-lock the bootloader, that would mean I can't use customROM anymore. But in fact; I can.
The only annoying thing after gets back from stockROM is my recovery got reverted to an older version.

I also installed busybox on stockROM, but no 2nd-init recovery.
 
Last edited:
  • Like
Reactions: JulianJenner

er.davinder

Senior Member
Jun 14, 2011
288
175
Looking for GPS location
LeEco Le 2
@afronoia, @JulianJenner

I tried it thats why i am saying it .. it worked for me.

while making backup your device should have locked BL and stock recovery. Make sure you only backup using 2 init recovery for locked BL by artas.

after that you can unlock BL and install custom Roms.


and to relock it again you just need to restore the stock backup (w locked BL).
it should flash stock recovery and stock boot imgs and lock the BL again. Everytime I restore this backup it locks my bootloader.

it works I have tested it.
 
Last edited:
  • Like
Reactions: JulianJenner

matthewstice

Senior Member
Apr 3, 2008
209
34
Read the very first post
Dunno if you know but the hidden menu doesn't work
It has always said bootloader status locked for me when its unlocked.
Software upgrade mode shows the true status bootloader unlocked.
What's with that

Sent from my LG-P769 using XDA Free mobile app
 
  • Like
Reactions: er.davinder

JulianJenner

Senior Member
Apr 17, 2013
4,796
1,936
Arnhem
Yes. It is correct. S/W mode displays really BL status.

LGE-P760 / CM11 Android 4.4.4 build 4.10.11 by artas182x / Tapatalk Pro 4.6.2
 

er.davinder

Senior Member
Jun 14, 2011
288
175
Looking for GPS location
LeEco Le 2

Attachments

  • 2015-10-31-15-03-56.jpg
    2015-10-31-15-03-56.jpg
    147.4 KB · Views: 135

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Hello. Last time I was thinking about locking bootloader for Optimus L9. I decompiled Hidden Menu app and checked how bootloader status is checked. I found that everything is on NV partition. When i dumped nv using dd commad i was searching using hex editor and i found that 4 characters are stored on 00004800 and 00004801 (h) offset. If bootloader is unlocked there should be: 1101 (4353 DEC). This magic numer i found when i decompiled hidden menu app.

    Now I need people who can't unlock bootloader and people who can unlock, but don't want to do this. I need also some people who have unlocked bootloader to confim if this string is correct. You need only to dump this 4 characters using my little script. You only must have root. Download zip in attachments and do this using 2 ways:

    If you have adb working correctly
    1. Extract zip
    2. Run dump.cmd
    3. Follow instruction
    4. If you have done everything correctly you should have OUTPUT.txt
    5. Check if this file is not empty and if it is ok send here on XDA

    If you have problems with above method:
    1. Download and run Terminal Emulator from Google Play
    2. Type su and accept poup-up
    3. Type dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/nv of=/sdcard/nv.img
    4. Using computer type copy nv.img to the directory where you extracted zip
    5. Open manual.cmd
    6. Follow instructions
    7. Check if OUTPUT.txt is not empty and send there it here

    DON'T SEND US NV.IMG, BECAUSE IT INCLUDES IMEI. I ONLY WANT THIS ONE TXT FILE WHICH INCLUDES YOUR BOOTLOADER STATE.

    IT WILL HELP US TO FIND METHOD TO LOCK BOOTLOADER AGAIN AND UNLOCK BOOTLOADER FOR SOME PEOPLE.

    Decompiled bootloader check code:
    Code:
    package com.lge.hiddenmenu.bootloadunlock;
    
    import android.app.ListActivity;
    import android.os.Bundle;
    import android.util.Log;
    import android.view.*;
    import android.widget.ArrayAdapter;
    import android.widget.ListView;
    import java.io.File;
    import java.io.RandomAccessFile;
    
    public class BootLoader_Unlock extends ListActivity
    {
    
        public BootLoader_Unlock()
        {
            String as[] = new String[1];
            as[0] = "BootLoader Unlock Check";
            mTopMenu = as;
        }
    
        private void showResult(int i)
        {
            android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(this);
            Log.e("BootLoader Unlock", (new StringBuilder()).append("readNV(36): ").append(i).toString());
            if(i == 4353)
                builder.setMessage("Unlock");
            else
                builder.setMessage("Lock");
            builder.setPositiveButton(0x104000a, null);
            builder.setTitle("BootLoader Unlock Check");
            builder.show();
        }
    
        public int device_unlock_flag_read()
        {
            short word0;
            boolean flag;
            File file;
            RandomAccessFile randomaccessfile;
            word0 = 0;
            flag = true;
            file = new File("/dev/block/platform/omap/omap_hsmmc.1/by-name/nv");
            randomaccessfile = null;
            RandomAccessFile randomaccessfile1 = new RandomAccessFile(file, "r");
            randomaccessfile1.seek(18432L);
            word0 = randomaccessfile1.readShort();
            Log.e("BootLoader Unlock", (new StringBuilder()).append("swrv_fused_status=").append(word0).toString());
            Exception exception;
            Exception exception1;
            try
            {
                randomaccessfile1.close();
            }
            catch(Exception exception4) { }
            if(!flag)
                word0 = -1;
            return word0;
            exception;
    _L4:
            Log.e("BootLoader Unlock", (new StringBuilder()).append("readNV(36): exception occurs: ").append(exception).toString());
            flag = false;
            try
            {
                randomaccessfile.close();
            }
            catch(Exception exception3) { }
            break MISSING_BLOCK_LABEL_73;
            exception1;
    _L2:
            try
            {
                randomaccessfile.close();
            }
            catch(Exception exception2) { }
            throw exception1;
            exception1;
            randomaccessfile = randomaccessfile1;
            if(true) goto _L2; else goto _L1
    _L1:
            exception;
            randomaccessfile = randomaccessfile1;
            if(true) goto _L4; else goto _L3
    _L3:
        }
    
        public void onCreate(Bundle bundle)
        {
            super.onCreate(bundle);
            setTitle("BootLoader Unlock Check");
            setListAdapter(new ArrayAdapter(this, 0x1090003, mTopMenu));
        }
    
        public boolean onKeyDown(int i, KeyEvent keyevent)
        {
            i;
            JVM INSTR tableswitch 3 4: default 24
        //                   3 31
        //                   4 31;
               goto _L1 _L2 _L2
    _L1:
            return super.onKeyDown(i, keyevent);
    _L2:
            getWindow().clearFlags(128);
            finish();
            if(true) goto _L1; else goto _L3
    _L3:
        }
    
        protected void onListItemClick(ListView listview, View view, int i, long l)
        {
            if(i == 0)
                showResult(device_unlock_flag_read());
        }
    
        protected void onPause()
        {
            getWindow().clearFlags(128);
            super.onPause();
        }
    
        protected void onResume()
        {
            getWindow().addFlags(128);
            super.onResume();
        }
    
        private static final int NV_IDX_SWRV_FUSED_STATUS = 36;
        private static final String NV_PATH = "/dev/block/platform/omap/omap_hsmmc.1/by-name/nv";
        private static final int UNLOCK_VALUE = 4353;
        private final String TAG = "BootLoader Unlock";
        private String mTopMenu[];
    }

    Other resources in attachments.
    1
    ok, here, you have my output file. I had lock bootloader, I hope that this file help you. thanks :)



    Sorry for my english :p
    1
    here is some more information.But its for LG L7 .We were trying to unlock boot using IDA Pro.And we did it.
    More information you can read here and screen shoots also here.
    Link.

    I hope it will help you.Good luck!
    1
    Here's a mirror of the L9BootloaderHack.rar. The original file was deleted

    http://xdaforums.com/showpost.php?p=38595867&postcount=5&nocache=1&z=9775460686068982

    Here it is for L9disassm.rar

    http://xdaforums.com/showpost.php?p=38615382&postcount=14

    Original XDA thread: http://xdaforums.com/showthread.php?t=2162267

    ---------- Post added at 02:03 PM ---------- Previous post was at 01:54 PM ----------

    So it seems like they gave up right after flashing the hacked X-loader and U-boot. Those were made for the L7 so of course it would have bricked your phone if you tried to flash it. However we should be able to duplicate their modifications in our U-boot and X-loader

    ---------- Post added at 02:09 PM ---------- Previous post was at 02:03 PM ----------

    There's this too: http://xdaforums.com/showthread.php?t=2160394
    1
    I doubt it will work.
    I still have CWM backup of stockROM on my SDcard and have been switching back-and-forth from some customROMs to stockROM and vise-versa.
    If restoring backup of stockROM re-lock the bootloader, that would mean I can't use customROM anymore. But in fact; I can.
    The only annoying thing after gets back from stockROM is my recovery got reverted to an older version.

    I also installed busybox on stockROM, but no 2nd-init recovery.