[MOD] OnePlus One Unlocker: Reset Unlock & Tamper Bit

Search This thread

Mnt-XDA

Senior Member
Aug 6, 2013
357
405

Reset Unlock & Tamper Bit for OnePlus One



My Friend @Polarfuchs has confirmed that our unlocker zips are working fine, after new CM11S 30O OTA update.
see post -- http://forum.xda-developers.com/showpost.php?p=54827475&postcount=182

==================== IGONE THIS WARNING ==========================
!!! Warning !!!

In the NEW OTA CM11S XNPH30O, the bootloader (aboot) img size changed....

We request all not to apply the unlocker scripts on the new bootloader , until we confirm/find the new bit position.

It might brick your phone and corrupt bootloader...



Most of us know that we can flash custom roms or can root device only after UNLOCKING the bootloader from fastboot mode.
If you relock your bootloader, you will need to do a full backup-and-restore whenever you decide to unlock it again.

This mod will allow you to unlock the bootloader without wiping the userdata as oppose to fastboot oem unlock command.

============================================================================
Note:

Many users having trouble to UNLOCK their device for the FIRST TIME by using this script.
Let me clarify few things for this mod.

The main purpose of this script is not UNLOCK Bootloader without wiping data.
It's main purpose is to reset tamper bit, which can not be done by any other way.
UNLOCK Bootloader without wiping data -- is another outcome of this MOD.


If you have not unlocked your device before (atleast for 1 time) by using command "fastboot oem unlock", then the script might not work for you.

In case your device is locked and you want to install this script from custom recovery like TWRP/CWM,
it will be possible only if, you can boot temporarily using command -- fastboot boot <custom_recovery.img>.
If this command failed, you will not be able to run the unlocker script and hence device will not be unlocked without wiping data

In which condition the device can be booted to custom recovery by using command -- fastboot boot <custom_recovery.img>, is still not very clear.

before running the command , check your device status "fastboot oem device-info"
and report your error with the following points
1) Did you unlock your device before by any means ? (or by fastboot oem unlock) ?
2) What is the recovery already installed in your device ?
3) What is the status of your device ? "fastboot oem device-info"
4) What error msg you got when tried to run command
fastboot boot <custom_recovery.img>.
5) Steps you tried.

There are 4 possibilities of the the value set of the 2 bits ( unlock bit & tamper bit)
1) Unlock Bit - FALSE , Tamper Bit - FALSE
2) Unlock Bit - FALSE , Tamper Bit - TRUE
3) Unlock Bit - TRUE, Tamper Bit - FALSE
4) Unlock Bit - TRUE, Tamper Bit - TRUE


After getting proper error report from you , we can give confirmation about, in which of the above state,
fastboot boot <custom_recovery.img> will work and hence installing the unlocker script/mod/zip can help you to
UNLOCK your Bootloader without wiping DATA.

Kindly report your issues as I mentioned above...

Thanks

=================================================================================

There are generally 2 bits present on some partition of the phone for keeping track of unlocking.
1) lock / unlock bit
2) tamper bit


Both bits are initially FASLE. We can unlock bootloader by using command
Code:
fastboot oem unlock
and can see the device information by
Code:
fastboot oem device-info
like: 11.jpg

Once you unlock, both bits will come TRUE. This mod will write the 2 bits in aboot partition and can reset
both bits (TOGGLE Bcsically) without factory reset as opposed to fastboot command fastboot oem unlock

So for One Plus One...
Code:
Partition - aboot (bootloader)
Unlock Bit Position - 0x000FFE10 Hex - (1048080) Decimal   
Tamper Bit Position - 0x000FFE14 Hex - (1048084) Decimal
By @Polarfuchs

22.jpg



Credit to our Senior Member @Polarfuchs for finding out the partition & hex position that store the bits
Actually we both tested this concept and modified the script by @osm0sis and applied on our devices and got success.
We just added support for OnePlusOne (A0001)

You can check the following threads ...

1) http://forum.xda-developers.com/showthread.php?t=2796286
2) http://forum.xda-developers.com/showpost.php?p=54060253&postcount=11
3) http://forum.xda-developers.com/showpost.php?p=54060141&postcount=395

But it is in Beta State, may be more testing required, we will make an app for it like Nexus 5 Unlocker later...

Main Credit goes to our Recognized Contributor @osm0sis for his Nexus BootUnlocker script, flashable from recovery
http://forum.xda-developers.com/showthread.php?t=2239421

Thank you Sir - @osm0sis




Since this mod writes on aboot (bootloader) partition to reset the 2 flags, it may brick your phone.
Requesting developers to test it first, then give feedback here. After that any normal user can use it.
We will not be responsible for any damage or bricking of your phone. Install this zip at your own risk.


Edit:
Many users tried this and we can say that it is working , not beta anymore ...



This script can be installed from CWM / TWRP recovery

Another trick for installation is

Code:
[B]fastboot boot <path/name of the recovery twrp img>[/B]

It will boot your phone into recovery once from the recovery image
stored in your PC temporarily 
then you can flash the zip either by sideload or from sdcard...
Download Here : View attachment OnePlusOne-BootUnlocker.zip

Download Bootloader lock-unlock Toggle Only Script View attachment OnePlusOne-OnlyBootloaderToggle.zip (not tested yet)

Download Tamper Bit Toggle Only Script View attachment OnePlusOne-OnlyTamperBitToggle.zip (not tested yet)



If you like this MOD please hit thanks button :)
Thank you all...
 
Last edited:

Mnt-XDA

Senior Member
Aug 6, 2013
357
405
Awesome work, it solved this issue:
http://forum.xda-developers.com/oneplus-one/help/locked-bootloader-totally-locked-t2817735/page2

Thanks for implementing this and thanks to @Polarfuchs for finding out the flags location.

It worked for me as well, thanks!

Works great on my device. Problem solved :good:

Time to start flashing again and now i need not worry anymore cos if bootloader gets locked....the solution is right here :D

Thank you all friends...

Do you just need to flash thru custom recoveries?

Yes, But if you don't have custom recovery installed...
you can try
Code:
fastboot boot   <path/name of the recovery twrp img stored in your pc>
 

Polarfuchs

Senior Member
Apr 20, 2008
968
106
No since you can't flash unsigned zip I think. But you don't need to install a custom recovery. Instead you can boot into a custom recovery once with this command:"fastboot boot <name of custom recovery>"
 

manudroid19

Senior Member
Feb 23, 2013
368
839
Pls correct me if i am wrong:

This method is only usefull when you already have a recovery or root...
Because before the first unlocking you cant boot a custom recovery..
Or is possibly to boot a custom recovcery from fastboot when your device is locked??

Thank you

Enviado desde mi GT-S6500D usando Tapatalk 2
 

fabi280

Senior Member
Oct 20, 2010
347
365
Karlsruhe
Pls correct me if i am wrong:

This method is only usefull when you already have a recovery or root...
Because before the first unlocking you cant boot a custom recovery..
Or is possibly to boot a custom recovcery from fastboot when your device is locked??

Thank you

Enviado desde mi GT-S6500D usando Tapatalk 2
I've never tried to do this on a locked bootloader, but maybe you can "fastboot boot" the recovery image
 

Bierfreund

Senior Member
Jun 30, 2010
457
44
I want to reset my phone to factory state, because i want to sell it.
I flashed the latest original ROM (including recovery and everthing else) and afterwards i locked the bootloader with "fastboot oem lock".
Unfortunately the tampered is still true:
Code:
C:\cm-11.0-XNPH25R-bacon-signed-fastboot>fastboot oem device-info
...
(bootloader)    Device tampered: true
(bootloader)    Device unlocked: false
(bootloader)    Charger screen enabled: false
OKAY [  0.008s]
finished. total time: 0.011s

Can i set the tampered bit to false with this mod or is this not possible (yet)?
 
  • Like
Reactions: dthaha

Top Liked Posts

  • There are no posts matching your filters.
  • 126

    Reset Unlock & Tamper Bit for OnePlus One



    My Friend @Polarfuchs has confirmed that our unlocker zips are working fine, after new CM11S 30O OTA update.
    see post -- http://forum.xda-developers.com/showpost.php?p=54827475&postcount=182

    ==================== IGONE THIS WARNING ==========================
    !!! Warning !!!

    In the NEW OTA CM11S XNPH30O, the bootloader (aboot) img size changed....

    We request all not to apply the unlocker scripts on the new bootloader , until we confirm/find the new bit position.

    It might brick your phone and corrupt bootloader...



    Most of us know that we can flash custom roms or can root device only after UNLOCKING the bootloader from fastboot mode.
    If you relock your bootloader, you will need to do a full backup-and-restore whenever you decide to unlock it again.

    This mod will allow you to unlock the bootloader without wiping the userdata as oppose to fastboot oem unlock command.

    ============================================================================
    Note:

    Many users having trouble to UNLOCK their device for the FIRST TIME by using this script.
    Let me clarify few things for this mod.

    The main purpose of this script is not UNLOCK Bootloader without wiping data.
    It's main purpose is to reset tamper bit, which can not be done by any other way.
    UNLOCK Bootloader without wiping data -- is another outcome of this MOD.


    If you have not unlocked your device before (atleast for 1 time) by using command "fastboot oem unlock", then the script might not work for you.

    In case your device is locked and you want to install this script from custom recovery like TWRP/CWM,
    it will be possible only if, you can boot temporarily using command -- fastboot boot <custom_recovery.img>.
    If this command failed, you will not be able to run the unlocker script and hence device will not be unlocked without wiping data

    In which condition the device can be booted to custom recovery by using command -- fastboot boot <custom_recovery.img>, is still not very clear.

    before running the command , check your device status "fastboot oem device-info"
    and report your error with the following points
    1) Did you unlock your device before by any means ? (or by fastboot oem unlock) ?
    2) What is the recovery already installed in your device ?
    3) What is the status of your device ? "fastboot oem device-info"
    4) What error msg you got when tried to run command
    fastboot boot <custom_recovery.img>.
    5) Steps you tried.

    There are 4 possibilities of the the value set of the 2 bits ( unlock bit & tamper bit)
    1) Unlock Bit - FALSE , Tamper Bit - FALSE
    2) Unlock Bit - FALSE , Tamper Bit - TRUE
    3) Unlock Bit - TRUE, Tamper Bit - FALSE
    4) Unlock Bit - TRUE, Tamper Bit - TRUE


    After getting proper error report from you , we can give confirmation about, in which of the above state,
    fastboot boot <custom_recovery.img> will work and hence installing the unlocker script/mod/zip can help you to
    UNLOCK your Bootloader without wiping DATA.

    Kindly report your issues as I mentioned above...

    Thanks

    =================================================================================

    There are generally 2 bits present on some partition of the phone for keeping track of unlocking.
    1) lock / unlock bit
    2) tamper bit


    Both bits are initially FASLE. We can unlock bootloader by using command
    Code:
    fastboot oem unlock
    and can see the device information by
    Code:
    fastboot oem device-info
    like: 11.jpg

    Once you unlock, both bits will come TRUE. This mod will write the 2 bits in aboot partition and can reset
    both bits (TOGGLE Bcsically) without factory reset as opposed to fastboot command fastboot oem unlock

    So for One Plus One...
    Code:
    Partition - aboot (bootloader)
    Unlock Bit Position - 0x000FFE10 Hex - (1048080) Decimal   
    Tamper Bit Position - 0x000FFE14 Hex - (1048084) Decimal
    By @Polarfuchs

    22.jpg



    Credit to our Senior Member @Polarfuchs for finding out the partition & hex position that store the bits
    Actually we both tested this concept and modified the script by @osm0sis and applied on our devices and got success.
    We just added support for OnePlusOne (A0001)

    You can check the following threads ...

    1) http://forum.xda-developers.com/showthread.php?t=2796286
    2) http://forum.xda-developers.com/showpost.php?p=54060253&postcount=11
    3) http://forum.xda-developers.com/showpost.php?p=54060141&postcount=395

    But it is in Beta State, may be more testing required, we will make an app for it like Nexus 5 Unlocker later...

    Main Credit goes to our Recognized Contributor @osm0sis for his Nexus BootUnlocker script, flashable from recovery
    http://forum.xda-developers.com/showthread.php?t=2239421

    Thank you Sir - @osm0sis




    Since this mod writes on aboot (bootloader) partition to reset the 2 flags, it may brick your phone.
    Requesting developers to test it first, then give feedback here. After that any normal user can use it.
    We will not be responsible for any damage or bricking of your phone. Install this zip at your own risk.


    Edit:
    Many users tried this and we can say that it is working , not beta anymore ...



    This script can be installed from CWM / TWRP recovery

    Another trick for installation is

    Code:
    [B]fastboot boot <path/name of the recovery twrp img>[/B]
    
    It will boot your phone into recovery once from the recovery image
    stored in your PC temporarily 
    then you can flash the zip either by sideload or from sdcard...
    Download Here : View attachment OnePlusOne-BootUnlocker.zip

    Download Bootloader lock-unlock Toggle Only Script View attachment OnePlusOne-OnlyBootloaderToggle.zip (not tested yet)

    Download Tamper Bit Toggle Only Script View attachment OnePlusOne-OnlyTamperBitToggle.zip (not tested yet)



    If you like this MOD please hit thanks button :)
    Thank you all...
    6
    OP Updated , with the following note....

    ========================================================
    Note:

    Many users having trouble to UNLOCK their device for the FIRST TIME by using this script.
    Let me clarify few things for this mod.

    The main purpose of this script is not UNLOCK Bootloader without wiping data.
    It's main purpose is to reset tamper bit, which can not be done by any other way.
    UNLOCK Bootloader without wiping data -- is another outcome of this MOD.


    If you have not unlocked your device before (atleast for 1 time) by using command "fastboot oem unlock", then the script might not work for you.

    In case your device is locked and you want to install this script from custom recovery like TWRP/CWM,
    it will be possible only if, you can boot temporarily using command -- fastboot boot <custom_recovery.img>.
    If this command failed, you will not be able to run the unlocker script and hence device will not be unlocked without wiping data

    In which condition the device can be booted to custom recovery by using command -- fastboot boot <custom_recovery.img>, is still not very clear.

    before running the command , check your device status "fastboot oem device-info"
    and report your error with the following points
    1) Did you unlock your device before by any means ? (or by fastboot oem unlock) ?
    2) What is the recovery already installed in your device ?
    3) What is the status of your device ? "fastboot oem device-info"
    4) What error msg you got when tried to run command -- fastboot boot <custom_recovery.img>.
    5) Steps you tried.

    There are 4 possibilities of the the value set of the 2 bits ( unlock bit & tamper bit)
    1) Unlock Bit - FALSE , Tamper Bit - FALSE
    2) Unlock Bit - FALSE , Tamper Bit - TRUE
    3) Unlock Bit - TRUE, Tamper Bit - FALSE
    4) Unlock Bit - TRUE, Tamper Bit - TRUE


    After getting proper error report from you , we can give confirmation about, in which of the above state,
    fastboot boot <custom_recovery.img> will work and hence installing the unlocker script/mod/zip can help you to
    UNLOCK your Bootloader without wiping DATA.

    Kindly report your issues as I mentioned above...

    Thanks


    :fingers-crossed:
    6
    OP Updated..

    To avoid confusions and make things easier , I created 2 NEW Flash-able scripts

    1) OnePlusOne-OnlyBootloaderToggle.zip

    2) OnePlusOne-OnlyTamperBitToggle.zip

    Whoever facing issue with the main unlocker script ... please try above scripts and please confirm me that it works or not...

    :) Enjoy!!!
    4
    !!! Warning !!!

    In the NEW OTA CM11S XNPH30O, the bootloader (aboot) img size changed....

    We request all not to apply the unlocker scripts on the new bootloader , until we confirm/find the new bit position.

    It might brick your phone and corrupt bootloader...
    3
    Not if your running XNPH30O.

    Only flash if your still on XNPH25R