yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] _ult:
Yeah, I should've expressed myself in more clear way - I've forgot to mention that TWRP is intended to be flashed only when needed: when I feel like flashing stuff/experimenting to leave an option to handle potential boot problems. At all other times stock recovery in meant to sit on device and with password set + account bound it should force potential thief to contemplate selling handset back to me for a spare parts price or at least make his attempts to use device painful. Does it make sense now?

Cool timing of the post, btw - I was just staring at the welcome screen after stock recovery wipe. It required me to enter account that was used to set up the device before, leaving no way to skip it - just as needed. Also, bootloader was UNLOCKED, but enable oem unlock (last byte of frp) was OFF. Still it worked.

And yeah, I've tested writing the sp partition locked (dumped in 5.0) over 6.0.1 - it worked - bootloader relocks! Surprisingly, while doing so, I've thought it over once again and the only way i can explain the reason why it's possible is the hypothesis, that the key that sp is (probably portion of it) encrypted with (K1) is encrypted with another key (K2) and stored in some persistent partition (TZ maybe?) - this way it survives reflash/reset. And while K1 is root-readable, the K2 is available only to KEYMASTER. This scheme may be an explanation why sp is reusable accross different versions of OS. But this is something between wild and educated guess :).

Some info on how bootloader *may* call TrustZone to write sp: source.codeaurora.org/quic/la/kernel/lk/tree/?h=LA.BR.1.3.3_rb1.3 (Quallcomm's reference implementation, logic is spread across aboot.c, qseecom_lk.c and smc.c). I didn't find any info on keys management done in TZ.

Does anyone have more info on this? [MENTION=4551856]segv11[/MENTION], [MENTION=4544860]osm0sis[/MENTION]?

P.S thx, [MENTION=1566190]efrant[/MENTION], I'd probably not risk bricking device without knowing someone did it before successfully. On a side note, iirc you was running N6 with encryption disabled for some time, do you know if performance suffers noticeably in terms of battery life/UI speed when encrypted?
[Samsung Galaxy Nexus] efrant:
To be honest, I don't know -- I had never used encryption at all. (I play around to much on my devices, so I'd rather have things easy to restore.) I believe others have said that there was a slight decrease in performance, but nothing that would impact how one would use it on a daily basis.
[Samsung Galaxy Nexus] osm0sis:
:fingers-crossed: Fingers crossed [MENTION=4551856]segv11[/MENTION]'s build PC is humming along nicely by now and he can get caught up on things. :)

Edit: @ mention me if you need anything. Unsubscribing again for now. :good:
[Samsung Galaxy Nexus] p1r473:
I would like to use Android Pay on my Pixel XL rooted running Nougat. I think I will need to temporarily stop root, but also relock bootloader temporarily.

Any chance of this app supporting Pixel XL Android 7+?

Thanks
[Samsung Galaxy Nexus] osm0sis:
No, unfortunately not. Google (and their partnered OEM) bootloader security for their flagship devices has gotten increasingly sophisticated, this is why we haven't been able to support anything after the Nexus 5 and Nexus 7 2013.

Most/all of OnePlus' devices still use the older LK bootloader security the last time I checked, so they could all be supported, hence my open Pull Request to [MENTION=4551856]segv11[/MENTION] on GitHub, still awaiting a test build..
[Samsung Galaxy Nexus] osm0sis:
BootUnlocker v1.6.2 Beta

Well, I finally got down to it on my list, and it was actually pretty easy importing my fork of [MENTION=4551856]segv11[/MENTION]'s project repo into Android Studio, so here we are, finally with a test build of my proposed BootUnlocker v1.6.2 adding OnePlus 2 and OnePlus X support! ;):cowboy:

Changes:

https://github.com/osm0sis/boot-unlocker/commits/master

I'll accept Pull Requests for new device support via my repo. Please look at my OnePlus 2 commit for an example/template of everything required for a complete app and documentation update for each new device. Please submit one device per commit in each Pull Request, and let me sort out bumping the app version numbering/changelog items.

[MENTION=1566190]efrant[/MENTION], [MENTION=5301049]Titokhan[/MENTION] were there any outstanding devices we can add along with the PR I've already got for Yota Phone 2 in v1.6.3?

We still need [MENTION=470805]dinomight[/MENTION] or someone to help with OnePlus 3/T as well. Any users interested in helping can follow the directions I gave to [MENTION=470805]dinomight[/MENTION], here: https://xdaforums.com/galaxy-nexus/...r-nexus-devices-version-t1731993/post67720772

It'd be nice if for ~v1.7.0 we could also do a Material redesign, like how AdAway did, but we'll need someone with more app coding chops than myself to submit a Pull Request; I am brand new to app creation, but as always I hope to learn as I go along. :p:)
[Samsung Galaxy Nexus] segv11:
Thank you for picking up on that. I've been way too busy for a long time to maintain the app.

If you, or a team, decide to put this on Google Play, PM me, and I should be able to put a link on the old version pointing to yours...
[Samsung Galaxy Nexus] SkandaH:
[MENTION=4544860]osm0sis[/MENTION] [MENTION=4551856]segv11[/MENTION]

That's indeed a very good news - nice to see the reboot!

Regarding new devices, I've already covered the followings:

OnePlus X (already added in the supported list)

YU Yureka/Yureka Plus

YU Yuphoria

ZUK Z1

Asus ZenFone 2 Laser ZE550KL

I'll try to send PRs ASAP.

Regarding OnePlus 3/3T, I may get one in near future so that I can do some tests on my own.

:highfive:
[Samsung Galaxy Nexus] osm0sis:
Thanks for the blessing [MENTION=4551856]segv11[/MENTION]. For now, would you be okay to make this thread into an xda DevDB project and add me as a co-dev so that I can update the OP?

Awesome! I'll merge the Yotaphone 2 PR now to avoid any merge conflicts with yours. :D

Edit: Done! :good:
[Samsung Galaxy Nexus] segv11:
DevDB

This is now a DevDB project, in order to allow multiple contributors.
[Samsung Galaxy Nexus] efrant:
Here's what can be done for the HTC M9:

I got rid of my M9 last year, so I can't test at all. I did, however, unlocked my bootloader by using the first command I listed, so it certainly works. I have not tried the other three (i.e., lock the bootloader, disable write permissions, revert tamper flag).

I also believe that there are similar threads for the HTC One (M7) and the HTC One M8, but I don't know much more than that.

Sorry I can't be of further help.
[Samsung Galaxy Nexus] bigrammy:
I think the Infocus m810 and m812 uses this method for it's bootloader osm0sis.

https://xdaforums.com/showpost.php?p=64322817&postcount=201
[Samsung Galaxy Nexus] SkandaH:
Regarding OnePlus 3(T), I've got some interesting things. - please see my PM.
[Samsung Galaxy Nexus] FriendlyNeighborhoodShane:
Hey [MENTION=4544860]osm0sis[/MENTION] ! it's irritating old me again. I have a query about this script. What's it's deal? Does it need root or something? Cause i successfully used it from the terminal in my one phone (after calling su) but doesn't work on my other, unrooted one through even adb... Is it root or selinux or something? Both phones were nougats. (rooted 7.1.2 and non-rooted 7.0)
[Samsung Galaxy Nexus] osm0sis:
It's dumping all the low-level device partitions, needing root is a given. ;)
[Samsung Galaxy Nexus] FriendlyNeighborhoodShane:
ooookie-dookie... thanks
[Samsung Galaxy Nexus] osm0sis:
BootUnlocker v1.6.3 Beta

A new test build, now of my proposed BootUnlocker v1.6.3, adding support for Yota Phone 2, YU Yuphoria, YU Yureka, Lenovo Zuk Z1, InFocus M810, and InFocus M812! Thanks to @Crazyphil, [MENTION=5301049]Titokhan[/MENTION] and [MENTION=1611492]heineken78[/MENTION]. :highfive:

Changes:

https://github.com/osm0sis/boot-unlocker/commits/master

I'll accept Pull Requests for new device support via my repo. Please look at my YU Yuphoria commit for an example/template of everything required for a complete app and documentation update for each new device. Please submit one device per commit in each Pull Request, and let me sort out bumping the app version numbering/changelog items.

[MENTION=6211994]sziraqui[/MENTION]'s ASUS Zenfone 2 Laser (ZE550KL + ZE600KL) procedure is one-way (unlock) only, so unfortunately cannot be supported. I'm also still on the fence about [MENTION=3437245]scotty1223[/MENTION]'s HTC One M9 unlock, since it requires S-OFF, and then there are further write protections to circumvent to revert the tamper flag. [MENTION=1566190]efrant[/MENTION], would it be worth doing with only the unlock?

I'll cut-and-paste from the previous beta post: It'd be nice if for ~v1.7.0 we could also do a Material redesign, like how AdAway did, but we'll need someone with more app coding chops than myself to submit a Pull Request; I am brand new to app creation, but as always I hope to learn as I go along. :)
[Samsung Galaxy Nexus] efrant:
The more I think about it, the more I'd say it's not worth it. Since S-OFF is needed to begin with, I guess it's kind of pointless to have the ability to lock and unlock the bootloader because once you have S-OFF, locking the bootloader doesn't give any additional protection really.
[Samsung Galaxy Nexus] sziraqui:
[MENTION=4544860]osm0sis[/MENTION] I just forked your repo to help you with material design. The app is built with target sdk 21 even though it uses built tools 26.0.2. Any specific reason for this? I think its safe to migrate to api 26.

Also, your gitignore file needed changes. I have made those changes, kindly merge pull request. This merge will also act as an indication of your willingness to accept future pull requests for material design
[Samsung Galaxy Nexus] osm0sis:
You didn't make a pull request. Kindly make one and I'll merge it. ;)
[Samsung Galaxy Nexus] sziraqui:
Sorry, was delayed. Check now. Meanwhile I am working on the UI, everyone will love it :)
[Samsung Galaxy Nexus] osm0sis:
For anyone wondering about adding support for newer OnePlus devices like the 3/T or 5/T, it's not looking so good..

Here's all that I found in my dump comparison: https://pastebin.com/zJXqBxtW

[MENTION=6211994]sziraqui[/MENTION] can you take a look at your changes again?

I built a 1.6.4 alpha and it seems to detect the current lock state correctly, but the buttons to change it do nothing on the Nexus 7 (flo) I tested it on. I rebooted in between and made sure the state is actually not changing. Downgraded to my 1.6.3 release APK and all works fine.
[Samsung Galaxy Nexus] sziraqui:
I will get some time for this tomorrow.
[Samsung Galaxy Nexus] osm0sis:
Thanks, I split it into a different branch for now until it's in a working state. :)
[Samsung Galaxy Nexus] osm0sis:
Yeah, you're still rooted with a custom recovery.
[Samsung Galaxy Nexus] osm0sis:
I'd suggest you read the OP. Seems like you haven't.
[Samsung Galaxy Nexus] osm0sis:
No my reading comprehension is quite good, thanks. I suggest you reread the 3 paragraphs in the OP above the License, since they explain "the point" very well.
[Samsung Galaxy Nexus] osm0sis:
You're welcome! Glad reading the OP answered all your questions. :)
[Samsung Galaxy Nexus] osm0sis:
BootUnlocker v1.6.4 Alpha

Probably not much interest anymore, but, at least for posterity, here's the 1.6.4 Alpha from the material-design branch [MENTION=6211994]sziraqui[/MENTION] was working on.

The light theme is pretty nice! Dark theme is decent, but I still personally probably prefer my 1.6.3 build for a darker theme though.

Use it if you like, functionality and device support remains the same. :good:
[Samsung Galaxy Nexus] dl200010:
Curious if any newer devices could use this. I know it stopped working for "fastboot flashing unlock" devices, like the Nexus 6P, but what about the OnePlus 6T which still uses "fastboot OEM unlock". Or was it the "allow OEM unlock" setting in developer options that caused the change?
[Samsung Galaxy Nexus] osm0sis:
Nah, it also has flashing unlock, and unlock critical. Can't be supported.
[Samsung Galaxy Nexus] osm0sis:
@segv11 any chance you can push a final 1.6.3 build to the Play Store built from my master branch? Would be good to officially support all the extra devices I added for posterity.

Edit: Nov. 26 2021: It's been a couple years, unsubscribing. @ me if anyone needs anything.
[Samsung Galaxy Nexus] alximiktik:
I have device(smart wallet) with android 5.1, mtk 6580. I want to unlock bootloder. But as that the device are not have display, after fastboot oem unlock , i cannt choose on device yes or no. I can rooting my device by Kingo root. But this application dont support my device. Can you help me. Can unlock bootloader using this method?
[Samsung Galaxy Nexus] Bardok84:
Hi

I have a Xperia 10 , Android 9.0 , it is Root through Magisk and everything is fine but Google pay does not work.., I hid root with xposed+rootcloak to hide it, but Google pay does not still work , now because the bootloader is unlocked.... so I definitely want to Lock it again.

In many devices if you lock the bootloader again you wont be able to modify your phone but the root will be activated at least.

HOWEVER, in Xperia devices ( bq and xiaomi seem to be the same) elimitate everything when you lock the bootloader..., the phone reset everything erasing all .... and loosing the root as well....

So , Is there any chance to lock my xperia 10 without loosing root???? How Could I do it????

Many thanks in advance.
[Samsung Galaxy Nexus] efrant:
I guess it makes sense. Coming from the Nexus One, there were significant differences between that and the Galaxy Nexus in terms of partitions and the boot chain. And the lock flag was contained in the radio NVRAM which was not even accessible, unless you had a special SIM (or SIM emulator).

I guess each manufacturer has its own way if implementing it for each SoC.
[Samsung Galaxy Nexus] exzacklyright:
sad i have a nexus 7 too. haha
[Samsung Galaxy Nexus] chrone:
thanks for this amazing apps without ads. :)
[Samsung Galaxy Nexus] segv11:
I don't like ads in other people's apps, so I won't put them in mine.

Sent from my Jelly Beaned "toro" Galaxy Nexus.
[Samsung Galaxy Nexus] Mach3.2:
Not to mention that you are targeting the very same group of people that most likely have AdFree installed, so having ads are pointless anyway.

Pressed from my Maguro
[Samsung Galaxy Nexus] segv11:
LOL

Sent from my Jelly Beaned "toro" Galaxy Nexus.
[Samsung Galaxy Nexus] rockingondrums:
Wow, I can't wait to try this app out. I've always wondered about the possibility of truly securing a lost device (like when I go out drinking). I have Cerberus (which is pretty awesome), but I've always wondered what would happen if an Android hacker found my lost phone. Thought about keeping my files safe by relocking the bootloader but of course that leaves me screwed when I want to modify the device again.

I currently have the latest CWM Touch installed though.. I'm assuming that this recovery can be connected to with ADB? So if I plan on having a really wild night out, I should flash the stock recovery and use this app to relock the bootloader? Because if they know how to get to the recovery, and it's CWM, and CWM presumably allows them to use ADB on the device, then I'm no better off... Correct?
[Samsung Galaxy Nexus] segv11:
Yes, to be truly secure you should flash stock recovery. Otherwise locking the bootloader doesn't count for much. That feature is in my long term plans for the app... but don't hold your breath. Now that it's stable and supports all three G-Nex variants, I have been too busy to add new features for the last couple of months.

Sent from my Jelly Beaned "toro" Galaxy Nexus.
[Samsung Galaxy Nexus] efrant:
Just to add to what segv11 said, you would also have to disable USB Debugging. If you have it enabled, you can easily gain root, despite having a locked bootloader and a stock recovery.
[Samsung Galaxy Nexus] rockingondrums:
Yeah, that much I knew. I've just been disabling Developer Options lately whenever I go out.

Take your time on the features. Flashing the recovery.img myself will be easy. :good: Maybe tedious, but not if I think it's worth doing. :D
[Samsung Galaxy Nexus] segv11:
I guess you know your app is gaining popularity when it gets its first 1-star review. :p

It would be nice to know what exactly this person is complaining about, however.

승훈 on Saturday, September 29, 2012 at 15:14 Samsung Galaxy Nexus (maguro) Version 1.1 Korean
'	It is not formal application. Developers Sorry Please down application.
[Samsung Galaxy Nexus] Mach3.2:
I'm guessing he used Google translation.

Will the next nexus have a longer screen?
[Samsung Galaxy Nexus] chrone:
still working like a charm on miui official english rom build 2.9.28 running aosp jelly bean 4.1.1 r6. thanks for this great app segv11! :)
[Samsung Galaxy Nexus] Petrovski80:
Thanks for this tool. Must have for security minded people who also like to tinker with their phone. :D
[Samsung Galaxy Nexus] a1exus:
is there any other app similar to this that works w/ N7?
[Samsung Galaxy Nexus] segv11:
I don't have a grouper (Nexus 7), but I tired to bring this app to that device with the help of a volunteer that was willing to hack around in his device's partitions.

Unfortunately, I could not figure out how the bootloader stores the lock state. This seems to be a difference between Samsung and Asus bootloaders; if I ever get myself a grouper, I'll try again.

I would be interested to try bringing the app to the Nexus S (crespo and crespo4g), since these are Samsung Nexus devices and may use similar bootloaders.

Sent from my 4.1.2 toro Bugless Beast.
[Samsung Galaxy Nexus] Mach3.2:
Got myself one, if you need help PM me.

Beamed from my Grouper.
[Samsung Galaxy Nexus] Raijin:
Working perfectly in my Galaxy Nexus. Thank you.
[Samsung Galaxy Nexus] ezeuba:
Works like a charm... Great app. I got tired of seeing that unlocked icon during boot, was afraid to do wipe just to get rid of it. One question, it may have been asked and answered. Can I still use my CWM recovery in the locked state, like flash stuff and all without unlocking again?
[Samsung Galaxy Nexus] dvcdvc:
Hi, I have a Nexus S that I recently rooted without unlocking using the /data/local.prop method. I would love to be able to unlock without wiping before taking the 4.1.2 update. If there's anything I can do to help, let me know!
[Samsung Galaxy Nexus] segv11:
If your bootloader is still locked, you can help, but a wipe will probably be involved. :(

Sent from my 4.1.2 toro Bugless Beast.
[Samsung Galaxy Nexus] segv11:
How to help bring BootUnlocker to new Nexus devices

I have moved these instructions to post #5 in this thread, for ease of reference.
[Samsung Galaxy Nexus] dvcdvc:
Right ... well, for now I got to 4.1.2 with OTA RootKeeper successfully. I might be able to find someone w/ a Nexus S that doesn't mind wiping, if I do I'll be happy to help the cause.
[Samsung Galaxy Nexus] segv11:
It's official: Nexus 4 from LG and Nexus 10 from Samsung.

If anybody gets one, roots it, and would like to do a little bootloader hacking let me know. Nexus 10 will have a Sammy bootloader, so it might just use param like three G-Nex.

Also, they will have a 3G Nexus 7. The bootchain on that will be different on that than on the WiFi Nexus 7, so we might be able to figure that one out too.

Sent from my 4.1.2 toro Bugless Beast.
[Samsung Galaxy Nexus] efrant:
I'll probably pick up a Nexus 4 when it becomes available in a couple of weeks (although I'm hesitant because it has no LTE for AT&T/Rogers.... :( ). I'll let you know, and maybe you can start a thread in the yet-to-be-created Nexus 4 forum.
[Samsung Galaxy Nexus] osm0sis:
segv11 have you tried the N7 again since they updated the bootloader to 3.41? JBQ made it sound like it wouldn't be backwards compatible for the newer hardware revisions of the device, so perhaps things changed for the better and it might be easier now?
[Samsung Galaxy Nexus] segv11:
No, I've not. I don't have a Nexus 7, and don't plan to get one... I'm getting the Nexus 10 instead.

I imagine that the new N7 bootloader will store the lockstate in the same way, otherwise updating the bootloader on your device could cause it to change lockstate which is a side effect Google wouldn't want. But if someone has an N7 with the newer bootloader, I would be willing to try it.

The 3G N7 is likely to be an entirely different bootloader, since the bootchain of devices with cell radios often starts in the radio firmware. I'd like to try that device too.

Sent from my 4.1.2 toro Bugless Beast.
[Samsung Galaxy Nexus] osm0sis:
I have the new bootloader version. Do I just follow your method above? You could also compare it to the dumps from the older bootloader versions to help narrow down the location perhaps.
[Samsung Galaxy Nexus] segv11:
I'll be away from my computer for a few hours. When I get back I'll see if I still have the dumps from the last time I tried the N7.

Yes, you would follow the above, with up to date nandroids copied off-device. MD5s will tell us which partitions changed when you (un)lock the bootloader, but we'll still need to diff around in the hexdumps to see where the changes lie.

Sent from my 4.1.2 toro Bugless Beast.
[Samsung Galaxy Nexus] osm0sis:
Awesome. Doing it now. :good:

Here's the list (attached). You want them all dumped, right? How do you want them named?

Edit: I'm just going to dump everything in /dev/block/platform/sdhci-tegra.3 to make sure I get the boot blks too.

Doing it as follows, let me know if there's another way you'd prefer and I'll do it again. :)

for block in $(ls /dev/block/platform/sdhci-tegra.3/ | grep mmc)
do
dd if=/dev/block/platform/sdhci-tegra.3/${block} of=/sdcard/${block}.img &
done

[Attachment removed, now also on my SkyDrive for you.]
[Samsung Galaxy Nexus] osm0sis:
Done pulling the blocks for unlocked. mmcblk0 and mmcblk0p9 seem linked in that neither would stop dumping and were feeding back to make each larger, so I killed those proccesses. Hopefully you don't need either of those.

Doing locked now.

Edit:

bc902985ac8fe44666445e1ab22b5abb *locked\mmcblk0boot0.img

9aa24e123ae88a7e0bf3bf665c95215a *locked\mmcblk0boot1.img
6e03ce046b147c453574af6e01830775 *locked\mmcblk0p1.img
01241544cbad3b2fd3a48626baaa07b1 *locked\mmcblk0p2.img

b4e8fa25cbf9e95c59bedb8ae9dce382 *locked\mmcblk0p3.img
98160db7cb054fe77ce9c4328124cd59 *locked\mmcblk0p4.img

59071590099d21dd439896592338bf95 *locked\mmcblk0p5.img
f1c9645dbc14efddc7d8a322685f26eb *locked\mmcblk0p6.img
42543044d18fa7770729d0884d7029a2 *locked\mmcblk0p7.img
59071590099d21dd439896592338bf95 *locked\mmcblk0p8.img

94bad103a85306dc4610605ca7a077c5 *unlocked\mmcblk0boot0.img

9aa24e123ae88a7e0bf3bf665c95215a *unlocked\mmcblk0boot1.img
6e03ce046b147c453574af6e01830775 *unlocked\mmcblk0p1.img
01241544cbad3b2fd3a48626baaa07b1 *unlocked\mmcblk0p2.img

d44f409ab8da2c58705ce6beb587fd0e *unlocked\mmcblk0p3.img
088a50e89659b1d44c1cd84a703e0e85 *unlocked\mmcblk0p4.img

59071590099d21dd439896592338bf95 *unlocked\mmcblk0p5.img
f1c9645dbc14efddc7d8a322685f26eb *unlocked\mmcblk0p6.img
42543044d18fa7770729d0884d7029a2 *unlocked\mmcblk0p7.img
59071590099d21dd439896592338bf95 *unlocked\mmcblk0p8.img

Alright looks like boot0 and partition blocks 3+4. p3 and p4 correspond to APP and CAC in by-name, respectively.

Uploading to my SkyDrive now:

[Link removed. Served its purpose.]