Lock bootloader and remove modified flag from ADB

jmanley69

Senior Member
Feb 21, 2009
923
11
0
With my M8, I could issue these commands to lock & unlock the bootloader and remove the "modified" flag, but the lock command doesn't seem to work on the A9 and the bootloader still says modified. Does anybody know the commands that will work?

Unlock bootloader
{removed - don't do these commands}

Lock bootloader
{removed - don't do these commands}

remove "modified" flag
{removed - don't do these commands}

Edit - I removed the commands that you would issue on previous HTC models. I don't know if they will screw up your phone or not, but they will absolutely NOT work on the A9 and should not be issued to your phone!
 
Last edited:

Ivanovic

Senior Member
Jun 6, 2010
944
306
93
Halkidiki
Are you sure that the flag is located within the mmcblk0p2 partition? I wanted to do the same but I m to lazy re-unlocking the bootloader, dumping the partitions and look for the flag.

Can you please dump the mmcblk0p2 or the p3 partitions and upload them somewhere? I will look for the flags

Στάλθηκε από το HTC One A9 μου χρησιμοποιώντας Tapatalk
 
  • Like
Reactions: jureca

JochenP

Senior Member
Nov 29, 2015
405
135
0
Cologne
i've tested that and location of these characters are still the same. "HTCU" for unlocked and "HTCL" for relocked. But it don't work. i've replaced p2 after setting "HTCU" to "00000000" but after reboot it is reset/restored to "HTCO"
 
Last edited:

JochenP

Senior Member
Nov 29, 2015
405
135
0
Cologne
it doesn't work for me:
List of devices attached
HT5B3BE06823 device

C:\Program Files\Minimal ADB and Fastboot>adb shell
[email protected]_hiaeuhl:/ $ su
echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
4+0 records in
4+0 records out
4 bytes transferred in 0.010 secs (400 bytes/sec)
[email protected]_hiaeuhl:/ # exit
[email protected]_hiaeuhl:/ $ exit

C:\Program Files\Minimal ADB and Fastboot>


all seems ok but when i look into the patched file then everything is unchanged :(

----------------------------

kernel: lk
product: htc_hiaeuhl
version: 1.0
imei:
version-main: 1.10.401.7
boot-mode: download
version-baseband: [email protected]
version-bootloader: 1.0.0.0000
mid: 2PQ910000
cid: 11111111

Software status: Official
*** UNLOCKED ***
*** S-OFF ***


copy-paste error correction
 
Last edited:

Ivanovic

Senior Member
Jun 6, 2010
944
306
93
Halkidiki
You said you also tried editing the partition with a hex editor and even uploading the edit file ?

Στάλθηκε από το HTC One A9 μου χρησιμοποιώντας Tapatalk
 

JochenP

Senior Member
Nov 29, 2015
405
135
0
Cologne
yes - after hex-patching i copied file (after erasing original file) to /dev/block with total commander.
after reboot data was restored!!! so what is going on?
i have SuperSu 2.62-3 but it is curious that adb-patching doesn't work - file is -rw-
fastboot-flashing to pg1fs fails also (sending ok but flashing stalls)
 

alray

Recognized Contributor
May 22, 2012
8,934
3,583
0
yes - after hex-patching i copied file (after erasing original file) to /dev/block with total commander.
after reboot data was restored!!! so what is going on?
i have SuperSu 2.62-3 but it is curious that adb-patching doesn't work - file is -rw-
fastboot-flashing to pg1fs fails also (sending ok but flashing stalls)
Are you doing it when booted in the OS? Try using an adb shell from custom recovery, maybe the pgfs partitions are now write protected by the stock kernel, shouldn't be an issue when in recovery since the kernel isn't booted yet.
Can you share your p6 too?
 
Last edited:

JochenP

Senior Member
Nov 29, 2015
405
135
0
Cologne
mmcblk0p2 userrights: -rw--- no problem to overwrite or delete

p6: http://www94.zippyshare.com/v/QIb5IVJy/file.html

good idea to adb from recovery - i will test soon

---------- Post added at 04:59 PM ---------- Previous post was at 04:44 PM ----------

adb from recovery - no success:

:\Program Files\Minimal ADB and Fastboot>adb shell
# ←[6nsu
sbin/sh: su: not found
# ←[6necho -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=8404
+0 records in
+0 records out
bytes (4B) copied, 0.047038 seconds, 85B/s
# ←[6nexit

please gimme a tipp

ups - i adressed with hex :( - (but that's not the reason for writing fails)

---------- Post added at 05:39 PM ---------- Previous post was at 04:59 PM ----------

okay: i used the revovery filemanager, copied file p2 to external-sd, hexedit this file ( overwites "HCTO" with 00000000) and recopy this file to dev/block.
all within recovery
NO success: i reboot to download (unlocked) - bootloader - recovery and copied file one more time to sd for editing - it contains again "HTCU" :crying:
 
Last edited:

goodman_east

Senior Member
Jan 13, 2013
258
94
0
Amoy
mmcblk0p2 userrights: -rw--- no problem to overwrite or delete

p6: http://www94.zippyshare.com/v/QIb5IVJy/file.html

good idea to adb from recovery - i will test soon

---------- Post added at 04:59 PM ---------- Previous post was at 04:44 PM ----------

adb from recovery - no success:

:\Program Files\Minimal ADB and Fastboot>adb shell
# ←[6nsu
sbin/sh: su: not found
# ←[6necho -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=8404
+0 records in
+0 records out
bytes (4B) copied, 0.047038 seconds, 85B/s
# ←[6nexit

please gimme a tipp

ups - i adressed with hex :( - (but that's not the reason for writing fails)

---------- Post added at 05:39 PM ---------- Previous post was at 04:59 PM ----------

okay: i used the revovery filemanager, copied file p2 to external-sd, hexedit this file ( overwites "HCTO" with 00000000) and recopy this file to dev/block.
all within recovery
NO success: i reboot to download (unlocked) - bootloader - recovery and copied file one more time to sd for editing - it contains again "HTCU" :crying:
I have did this a week ago.
It seems that partition has write protection.
I dumped files of this partition from both locked and unlocked A9. other difference was found.

java card id is there, i cannot share the original pictures.
if necessary, i can post the differences.
 
Last edited:
  • Like
Reactions: JochenP

JochenP

Senior Member
Nov 29, 2015
405
135
0
Cologne
yes i believe you are right but a further flag is also possible and hboot corrects this "HTCU" flag in p2 during boot...
rather not: from within recovery i have tried to MOVE p2 to SD-Card and i end's with: Error=1 (file cannot moved)

please post differences to dig deeper. how do i eliminate the write protection?
 
Last edited:

Ivanovic

Senior Member
Jun 6, 2010
944
306
93
Halkidiki
I believe that this has something to do with the extra write protection in p32 introduced in the M9 even on S-OFF phones

Στάλθηκε από το HTC One A9 μου χρησιμοποιώντας Tapatalk
 
Last edited:

jmanley69

Senior Member
Feb 21, 2009
923
11
0
Sorry.. I went out of town and was away from a computer after I posted the question.

I am indeed s-off and rooted.

I used http://forum.xda-developers.com/one-m9/general/how-to-disable-remaining-write-t3171735 method and entered
{removed - don't do these commands}
then rebooted.

After it came back up, I entered
{removed - don't do these commands}
to remove the modified flag, but when I went to bootloader it still says modified.

I also tried
{removed - don't do these commands}
to lock the bootloader, but when I booted into bootloader, it was still locked.

I'd be happy to upload anything that might help, just give me some direction to do so.
 
Last edited: