[DISCUSSION][S7-SNAPDRAGON]Unlock Bootloader - R&D

Search This thread
I'm glad to see a lot of R&D I've been able to do with @droidvoider on the Note 5 also seems to be applying here as well.

If you would please look over our thread at: https://xdaforums.com/android/help/injecting-root-setting-selinux-stages-t3573036

Check out the last few pages regarding the progress we've made using the dirtycow exploit. We've actually gotten our console to run within the INIT context. All that is needed now, is proper manual setup of the SU binaries. Most of what I saw on Page 1 of this thread I have written about as well.

I believe there is still a way to make this happen guys.
 

XCnathan32

Senior Member
May 30, 2013
445
1,012
Texas
Psa: for anyone still looking at the DD/Flashfire Chinese bootloader method, DO NOT TRY IT, I'm no developer by any means, but by looking at some threads, it appears many people think that the hard bricked device is caused by incorrect partition sizes, and while that may be a part of it. The (most likely) reason that the device is hard bricked is this: "We build our chain of trust according to this definition, starting with the first piece of immutable software running out of read-only-memory (ROM). This first ROM bootloader cryptographically verifies the signature of the next bootloader in the chain, then that bootloader cryptographically verifies the signature of the next software image or images, and so on." source So it looks like when the first bootloader running out of read only memory detects that the chinese flashed bootloader that was flashed has the wrong signature, it doesn't let that bootloader load, which results in no DL mode, no recovery, and an expensive paperweight. Any dev feel free to correct me if i'm wrong.

So, would it be possible to somehow copy the sig from the US S7 to the Chinese S7 BL and then flash it?
Or would it be possible to somehow mod the US BL to check for a flag (like the chinese BL) and unlock the BL if it detects the flag.
Also, how is it not possible to flash a boot.img that was repacked, even if it wasn't modded? How does the phone check for that, because the signature shouldn't be modified just by unpacking and repacking it, right?
The S7 active (which i have) still runs on the V2 BL, so if anyone knows if that could help active users achieve unlock in any way, please let me know.

Once again, i'm not a dev, but i'm willing to learn and help as much as I can, so if anyone could point me into the right direction, that would be greatly appreciated :)
 
  • Like
Reactions: Delgoth

miniminus

Senior Member
Feb 20, 2012
353
198
i was going to post that exact thing about us active user's having bootloader version 2 like the Chinese models
and they talk of the CROM app that unlocks it ? but this is not discussed at length anywhere ?
did i read right that CROM, app was how they unlocked the S5 as thats still on v2 as well ?
is there 'much' risk invovled trying the CROM method ?

UPDATE
just reread the info from OP..
CROM app (Chinese phones have this app to unlock their phones):
Result: This app communicates to Samsung servers and ends up writing a flag (kiwibird?) to STEADY partition. US phones dont have this partition so this currently wont work.
as active is a US based phone, i presume' it doesnt have such a partition either ?? how would we check ? in flashfire ?

UPDATE 2
well reading this post
https://xdaforums.com/s7-edge/samsu...ecovery-official-twrp-galaxy-s7-edge-t3458589
""You will need to unlock your bootloader now. To do this, download the app "CROM Service By Samsung Electronics Co., Ltd." from the Galaxy Apps store and run it.
Follow the instructions in the CROM Service app to allow your device to accept custom images in download mode.""
kinda shows that this WILL unlock the bootloader, so probably WILL work on our actives..
but then it will also trip KNOX too presumably...

UPDATE 3
what i really want to know, is how the TMO (t-mobile) boot.mg files seems to allow you to alter system files, but RETAIN DM-Verity !
 
Last edited:

XCnathan32

Senior Member
May 30, 2013
445
1,012
Texas
i was going to post that exact thing about us active user's having bootloader version 2 like the Chinese models
and they talk of the CROM app that unlocks it ? but this is not discussed at length anywhere ?
did i read right that CROM, app was how they unlocked the S5 as thats still on v2 as well ?
is there 'much' risk invovled trying the CROM method ?

UPDATE
just reread the info from OP..
CROM app (Chinese phones have this app to unlock their phones):
Result: This app communicates to Samsung servers and ends up writing a flag (kiwibird?) to STEADY partition. US phones dont have this partition so this currently wont work.
as active is a US based phone, i presume' it doesnt have such a partition either ?? how would we check ? in flashfire ?

UPDATE 2
well reading this post
https://xdaforums.com/s7-edge/samsu...ecovery-official-twrp-galaxy-s7-edge-t3458589
""You will need to unlock your bootloader now. To do this, download the app "CROM Service By Samsung Electronics Co., Ltd." from the Galaxy Apps store and run it.
Follow the instructions in the CROM Service app to allow your device to accept custom images in download mode.""
kinda shows that this WILL unlock the bootloader, so probably WILL work on our actives..
but then it will also trip KNOX too presumably...

UPDATE 3
what i really want to know, is how the TMO (t-mobile) boot.mg files seems to allow you to alter system files, but RETAIN DM-Verity !

US phones don't have a STEADY partition, but that's not the only problem. The Chinese bootloader checks for the kiwibird flag, the US versions don't. So even if you could add a steady partition with the flag kiwibird, the US bootloader would ignore that and continue as normal. Not sure if the active's bootloader ignores the flag too, but I would assume so.
EDIT: compared the emmc_appsboot.mbn in HxD and the Chinese file contains multiple entries with KIWIBIRD and the S7 active's file doesn't contain any. I've already tried replacing the active's emmc_appsboot.bin with the chinese one and flashing it, but it fails verification.

I haven't heard about Tmobile phones allowing you edit system files, but I do know that smaller carriers like Tmo and sprint typically allow phones to have unlocked bootloader, while bigger carriers almost always lock their devices (ATT & Verizon) So that may be the reason why Tmo users can change system files.
 
Last edited:

miniminus

Senior Member
Feb 20, 2012
353
198
yes it seems even thou hardware wise the chinese, and the US are the same, software wise they seem to differ, and are not compatible due to the chain of trust ! ...
i did try the CROM app, but it doesnt load properly, not sure if its suppose to have a menu system atall ??

yes it seems the tmobile boot.img, doesnt check system folder for dm-verity from what i can gather...
after WAY to many hours, as im still learning myself, found its that at the source ! as making a custom one for the active... sadly i cannot get to the specific place where this vulnerability/check is
but it is the source of all the 'roms' ,custom flashfire scripts, for debloating, adblocking via host file, custom roms, and differing system apps ..

sadly it seems its not something we can replicate for the active :( we can only customize the engineering.boot.img !
not sure how much we can mess with it ? could we some how edit it to behave the same as original ? is the whole boot.img hash checked ?
what i REALLY wanna find out is how they blocked the Gear VR on the active!!! its how i got to this point !
 

XCnathan32

Senior Member
May 30, 2013
445
1,012
Texas
yes it seems even thou hardware wise the chinese, and the US are the same, software wise they seem to differ, and are not compatible due to the chain of trust ! ...
i did try the CROM app, but it doesnt load properly, not sure if its suppose to have a menu system atall ??

yes it seems the tmobile boot.img, doesnt check system folder for dm-verity from what i can gather...
after WAY to many hours, as im still learning myself, found its that at the source ! as making a custom one for the active... sadly i cannot get to the specific place where this vulnerability/check is
but it is the source of all the 'roms' ,custom flashfire scripts, for debloating, adblocking via host file, custom roms, and differing system apps ..

sadly it seems its not something we can replicate for the active :( we can only customize the engineering.boot.img !
not sure how much we can mess with it ? could we some how edit it to behave the same as original ? is the whole boot.img hash checked ?
what i REALLY wanna find out is how they blocked the Gear VR on the active!!! its how i got to this point !

We can customize the engineering boot.img?? If we really can this could mean great things like overclocking and better performance, maybe even aosp... Are you sure we can edit the boot.img?
 

miniminus

Senior Member
Feb 20, 2012
353
198
we can already overclock etc and alter CPU/GPU/Temps, thats what the engineering boot interferes with and either gives loads of lag, or pants battery life..
why i was thinking as it lets system wide mods, could we use stock kernel? inside the eng. one so feels like stock, but with root, and dm-verity like s7.t-mobile boot.img ... so make our own hybride one ?
but i expect its hashed up and checked !
 

XCnathan32

Senior Member
May 30, 2013
445
1,012
Texas
we can already overclock etc and alter CPU/GPU/Temps, thats what the engineering boot interferes with and either gives loads of lag, or pants battery life..
why i was thinking as it lets system wide mods, could we use stock kernel? inside the eng. one so feels like stock, but with root, and dm-verity like s7.t-mobile boot.img ... so make our own hybride one ?
but i expect its hashed up and checked !

How'd you overclock yours? I couldn't figure out how to OC mine. I tried modifying the stock boot.img for root, but somehow the phone can tell it has been modified and it fails a security check.
 

miniminus

Senior Member
Feb 20, 2012
353
198
would have more luck 'trying' to modifying engboot.img, as that has less restriction imposed on it.....
messing around with clock, and governors, can be done by numerous apps, or maunually via scripts, like what is included in the 2.82 superSU installer root
 
nabears101 said:
Psa: for anyone still looking at the DD/Flashfire Chinese bootloader method, DO NOT TRY IT, I'm no developer by any means, but by looking at some threads, it appears many people think that the hard bricked device is caused by incorrect partition sizes, and while that may be a part of it. The (most likely) reason that the device is hard bricked is this: "We build our chain of trust according to this definition, starting with the first piece of immutable software running out of read-only-memory (ROM). This first ROM bootloader cryptographically verifies the signature of the next bootloader in the chain, then that bootloader cryptographically verifies the signature of the next software image or images, and so on." source So it looks like when the first bootloader running out of read only memory detects that the chinese flashed bootloader that was flashed has the wrong signature, it doesn't let that bootloader load, which results in no DL mode, no recovery, and an expensive paperweight. Any dev feel free to correct me if i'm wrong.

So, would it be possible to somehow copy the sig from the US S7 to the Chinese S7 BL and then flash it?
Or would it be possible to somehow mod the US BL to check for a flag (like the chinese BL) and unlock the BL if it detects the flag.
Also, how is it not possible to flash a boot.img that was repacked, even if it wasn't modded? How does the phone check for that, because the signature shouldn't be modified just by unpacking and repacking it, right?
The S7 active (which i have) still runs on the V2 BL, so if anyone knows if that could help active users achieve unlock in any way, please let me know.

Once again, i'm not a dev, but i'm willing to learn and help as much as I can, so if anyone could point me into the right direction, that would be greatly appreciated

What you can see quite quickly, The SM-G935F still runs on builds using the SW Rev 1 Bootloader. Hence the 1A, or 1B tag before the final build number. That is why that phone is fully rooted, and exactly how the carriers keep their branded phones from being transferred from carrier to carrier in the US. Our current Nougat and late MM bootloaders utilize the SW Revision 4 bootloader.

Through these different bootloader binary revisions, they change/update the master keystore partition on the Snapdragon S7/Edge devices. The Engineering Kernel (Read: Eng boot.img) does not enforce DM-Verity checking, in the same way that Passive SELinux does not enforce root permissions. So if the DM-Verity check fails at the AP/Rom/System level the bootloader has still maintained its integrity and will allow the modified system to boot using the "clean" bootloader.

That chain of trust you referred to, or the keystore of acceptable & flashable signatures, is kept in most likely in the "tzdata", "persistent", or "recovery" partition of the SD S7. We do not have a "STEADY" partition correct, but we do have a "persistent" partition that communicates with the Modem & RIL during boot. It also helps coordinate operations in DL Mode. I don't know how to dive deeper into the dumps of data that I do have with those.
Copying the signature from one boot.img to another one, is actually theoretically possible. But I have a strong feeling the Device Serial Number that is burned into the device, (the number you see when you press the home button instead of the volume up button at the first DL Mode screen.), Is somehow a part of the equation to verifying the bootloaders trust zone. But that has to be done using a customized build of the "mkbootimg" command line tool. If you want to repack the kernel you have to make sure your "mkbootimg" program is actually appending the signature when it compiles all the blobs.

The signature itself is appended on as the extra payload data that 7-Zip tells you about when extracting the ODIN .tar Package Files. Literally just extra bits of data added to the end of the archive that the bootloader knows where to look for. But The DM-Verity Signatures are made using a Hash Tree Data Structure. The correct way go about building such a tool for the S7 deals with modifying the way the LG's "EasyRecowvery" method, minus the dirty cow, looks into the hardware.

By the way, the current Nougat Eng Kernel's we have for the US Snapdragon S7, are signed with the Nougat 7.0 Test-Keys. Back in the days of the First Samsung Galaxy devices, the stock recovery shipping with Test-Key Signatures is what allowed us to bypass the signature verification of the sideloading zips.

******
miniminus said:
i was going to post that exact thing about us active user's having bootloader version 2 like the Chinese models
and they talk of the CROM app that unlocks it ? but this is not discussed at length anywhere ?
did i read right that CROM, app was how they unlocked the S5 as thats still on v2 as well ?
is there 'much' risk invovled trying the CROM method ?

UPDATE
just reread the info from OP..
CROM app (Chinese phones have this app to unlock their phones):
Result: This app communicates to Samsung servers and ends up writing a flag (kiwibird?) to STEADY partition. US phones dont have this partition so this currently wont work.
as active is a US based phone, i presume' it doesnt have such a partition either ?? how would we check ? in flashfire ?

UPDATE 2
well reading this post
https://xdaforums.com/s7-...-edge-t3458589
""You will need to unlock your bootloader now. To do this, download the app "CROM Service By Samsung Electronics Co., Ltd." from the Galaxy Apps store and run it.
Follow the instructions in the CROM Service app to allow your device to accept custom images in download mode.""
kinda shows that this WILL unlock the bootloader, so probably WILL work on our actives..
but then it will also trip KNOX too presumably...

UPDATE 3
what i really want to know, is how the TMO (t-mobile) boot.mg files seems to allow you to alter system files, but RETAIN DM-Verity !


nabears101 said:
US phones don't have a STEADY partition, but that's not the only problem. The Chinese bootloader checks for the kiwibird flag, the US versions don't. So even if you could add a steady partition with the flag kiwibird, the US bootloader would ignore that and continue as normal. Not sure if the active's bootloader ignores the flag too, but I would assume so.
EDIT: compared the emmc_appsboot.mbn in HxD and the Chinese file contains multiple entries with KIWIBIRD and the S7 active's file doesn't contain any. I've already tried replacing the active's emmc_appsboot.bin with the Chinese one and flashing it, but it fails verification.

I haven't heard about Tmobile phones allowing you edit system files, but I do know that smaller carriers like Tmo and sprint typically allow phones to have unlocked bootloader, while bigger carriers almost always lock their devices (ATT & Verizon) So that may be the reason why Tmo users can change system files.

Like I mentioned above about the partitions we DO Have that are persistent, there may still be a way somewhere. Yes, maybe they've taken out their KIWIBIRD bird flag for bootloader unlocks, but that doesn't mean there isn't still something leftover from building the Chinese firmware. Being two software revisions back however, does make the chances a lot slimmer for the current US devices. But as you stated here in your "Update 2", CROM talks to the Radio Chip and Download Mode in order to allow the devices to keep custom software from ODIN.

I've been saying for 8 months, that the Modem and Download Mode are the two important keys to unlocking/rooting the newer Samsung Flagships. The Modem firmware is the ONE piece of software that gets root perms first during the boot process, and the Radio Interface Layer is what controls the persistent partitions of our SD Devices. The T-Mobile files allow you to make changes to the system partition just as the current ENG Kernel from AT&T does.

because the ENG Kernels do not enforce DM-Verity. They allow the device to still boot after the Verity verification fails in Recovery Mode. Once on the Eng Kernel, it's possible to use ADB Shell Root and mount all the partitions RW and dump them/modify them. Combination Factory Firmwares also allow this to happen. And the Exynos Variants of the Galaxy Lines, normally have ENG Sboot files available that give ADB Root in the absence of anything else.

Currently with the Galaxy S7/Edge the ENG Root method utilizes a leaked kernel from AT&T that is signed with signatures accepted by all of the devices in the line. AT&T used Test Keys to sign the image, that is why the other carrier branded devices can still flash it. Because it is signed with a google test key it seems. Or a samsung test key. And those are supposed to be publicly available at some places.

I also feel that it would be possible to use the ENG Kernel to do a full dump of a device running the same build as the January ENG Kernel in order to get enough code and services to re-engineer the ENG Kernel.
 

XCnathan32

Senior Member
May 30, 2013
445
1,012
Texas
Copying the signature from one boot.img to another one, is actually theoretically possible. But I have a strong feeling the Device Serial Number that is burned into the device, (the number you see when you press the home button instead of the volume up button at the first DL Mode screen.), Is somehow a part of the equation to verifying the bootloaders trust zone. But that has to be done using a customized build of the "mkbootimg" command line tool. If you want to repack the kernel you have to make sure your "mkbootimg" program is actually appending the signature when it compiles all the blobs.

The signature itself is appended on as the extra payload data that 7-Zip tells you about when extracting the ODIN .tar Package Files. Literally just extra bits of data added to the end of the archive that the bootloader knows where to look for. But The DM-Verity Signatures are made using a Hash Tree Data Structure. The correct way go about building such a tool for the S7 deals with modifying the way the LG's "EasyRecowvery" method, minus the dirty cow, looks into the hardware.

So would there be any way to somehow read those extra bits and append them onto a modified kernel tar? Sorry if that's a dumb question, but I do not understand crypto very well.


because the ENG Kernels do not enforce DM-Verity. They allow the device to still boot after the Verity verification fails in Recovery Mode. Once on the Eng Kernel, it's possible to use ADB Shell Root and mount all the partitions RW and dump them/modify them. Combination Factory Firmwares also allow this to happen. And the Exynos Variants of the Galaxy Lines, normally have ENG Sboot files available that give ADB Root in the absence of anything else.

So does that mean it would be possible to flash a custom recovery, or would the locked bootloader not allow the device to boot even with dm-verity disabled?
 

Craz Basics

Senior Member
Jul 2, 2015
1,546
617
The ENG boot doesn't disable signature check right? Only disables write protection to the system partition
 
(.1.)So would there be any way to somehow read those extra bits and append them onto a modified kernel tar? Sorry if that's a dumb question, but I do not understand crypto very well.

(.2.)So does that mean it would be possible to flash a custom recovery, or would the locked bootloader not allow the device to boot even with dm-verity disabled?

Re: #1 -- Yes, there are ways to read those bits of data. The question is though, which bits exactly, and at what time & context.
Re: #2 -- If you are talking about using a build of TWRP, more than likely not. Their Recovery system is just too different from Samsung's stock Recovery. That's not to say a Custom Recovery isn't possible though. People have gotten to used to just using TWRP anymore, we'd actually need here, a 'custom' Custom Recovery.

The ENG boot doesn't disable signature check right? Only disables write protection to the system partition

Both actually. It disables Write Protection to the System Partition (and all other partitions as well), by allowing the ADB Shell to run as root. But it does also disable the signature check of the system partition, by not enforcing DM-Verity Protocols on the System and initramfs partitions.
 
  • Like
Reactions: mcmorariu

Craz Basics

Senior Member
Jul 2, 2015
1,546
617
Re: #1 -- Yes, there are ways to read those bits of data. The question is though, which bits exactly, and at what time & context.
Re: #2 -- If you are talking about using a build of TWRP, more than likely not. Their Recovery system is just too different from Samsung's stock Recovery. That's not to say a Custom Recovery isn't possible though. People have gotten to used to just using TWRP anymore, we'd actually need here, a 'custom' Custom Recovery.



Both actually. It disables Write Protection to the System Partition (and all other partitions as well), by allowing the ADB Shell to run as root. But it does also disable the signature check of the system partition, by not enforcing DM-Verity Protocols on the System and initramfs partitions.
Oh I gotcha. Thanks for clearing that up.
 

XCnathan32

Senior Member
May 30, 2013
445
1,012
Texas
Re: #2 -- If you are talking about using a build of TWRP, more than likely not. Their Recovery system is just too different from Samsung's stock Recovery. That's not to say a Custom Recovery isn't possible though. People have gotten to used to just using TWRP anymore, we'd actually need here, a 'custom' Custom Recovery.
So in theory, if we could build a custom recovery for the s7, it would work despite the chain of trust, sig checks, etc.
How would we go about building a custom recovery? Could we just modify the stock recovery to not check for signatures in flash ZIP from sd card?

Both actually. It disables Write Protection to the System Partition (and all other partitions as well), by allowing the ADB Shell to run as root. But it does also disable the signature check of the system partition, by not enforcing DM-Verity Protocols on the System and initramfs partitions.[/QUOTE]

So we can modify the ramdisk in the boot.img since dm verity is disabled? I'm fairly certain that contains a lot of settings we can tweak like overclocking (which personally I really want to get for this device)
 
This picture is taken from looking at a raw dump of the "sblapp" partition in the hex view of DiskInternal's "Linux Reader", it is also known as the 'Application Secondary Bootloader':
SBLAPP-KIWILOCK.png

I see that there is still text included within the G935U Firmware's bootloader that references the KIWI(Bird) flag settable in the Chinese Snapdragon's Firmware.
 
  • Like
Reactions: 124chase

Bones519

Senior Member
Sep 12, 2012
98
18
Moto G Stylus 5G
Feel free to disregard or delete this post if inappropriate. I am NOT a developer but I have been rooting and flashing for years and ended up disappointed with my s7 edge US unlocked version's inability to have the bootloader unlocked. I was googling and found this article for unlocking the bootloader and rooting verizon s7 and s7 edge... http://www.samsungsfour.com/tutoria...r-and-root-verizon-galaxy-s7-and-s7-edge.html
I thought that's what you were working on here. Has it already been done? And would it work not only for 930v and 935v, but also for the 935u? Am I missing something here? Or is this article incorrect?
 
Y

YMNDLZ

Guest
Feel free to disregard or delete this post if inappropriate. I am NOT a developer but I have been rooting and flashing for years and ended up disappointed with my s7 edge US unlocked version's inability to have the bootloader unlocked. I was googling and found this article for unlocking the bootloader and rooting verizon s7 and s7 edge... http://www.samsungsfour.com/tutoria...r-and-root-verizon-galaxy-s7-and-s7-edge.html
I thought that's what you were working on here. Has it already been done? And would it work not only for 930v and 935v, but also for the 935u? Am I missing something here? Or is this article incorrect?
This doesn't unlock the bootloader, all it does is allow us to root. If you follow the guide on the site you'll be running the engboot we use to root, but if you try installing TWRP or flashing the Chinese Qualcomm bootloader it'll brick your phone and stop it from booting. Don't trust the titles on articles written on sketchy sites.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 25
    Models: SM-G930_, SM-G935_ (Flat & Edge, all Snapdragon variants, NOT Exynos)
    Developer thread only!
    Work in Progress!
    DONT flash anything on your phone unless you either a)Dont care of the result or b)Know what you're doing! I will take NO RESPONSIBILITY for you breaking your phone! Know the risks!

    Research & Development Thread for Unlocking S7 bootloader

    What is this thread?
    This is a thread with all information (research) I can find regarding the locked bootloader for the S7 Snapdragon (Exynos has been unlocked so this thread will NOT cover that.) There are a lot of great seasoned Devs out there, but it seems all have given up, or remained in the dark. Flagships like the S7 we all bought because they're amazing phones, but it appears the future is locked bootloaders; if you're here then you're interested in custom ROMs. If we give up and can't 'crack this', then I'm afraid amazing phones like this will never get custom ROMs, ie, that will be a thing of the past.

    In other words, there doesn't appear to be any development anymore on trying to unlock the bootloader. Hope is lost... or is it? Therefore, we need new talent. We need a new generation of developers walking into the game knowing that what they're trying to do is almost impossible. I'm hoping this thread will quickly bring any developer up to speed so we can get some "unlocking Dev rookies". We are recruiting! Come here and ask questions regarding this so hopefully you can figure this out!

    I'm going to update from time to time the first few posts with critical info, links to info, etc. My goal with this thread is to put all of the great information from the community in one place. I don't way people to have to search this entire thread, rather get the info quick so they can begin developing quick, so we can get an unlocked bootloader, QUICK!

    Remember, there were previous locked bootloaders, but many of them have been cracked so let's take away the 'impossibility factor'!

    Who is this thread for?
    • Anyone that wants to quickly be brought up to speed on the S7 locked bootload status, all the hurdles, etc
    • Developers that want to be part of the future of locked bootloaders and something great!

    Who can post and what posts are allowed?
    • Anyone with PRODUCTIVE comments towards unlocking the bootloader or efforts already completed (regarding of fail or success)
    • Developers working on this initiative
    • Developers with questions for other developers regarding this
    • Wanna-be developers with questions (There is no shame, and you never know if YOU just might be the rookie dev we're looking for to unlock this! If you're willing to try something to potentially brick your device, then you can play here :) Or maybe you might throw out an idea that might spark an idea with someone else that leads to an unlock.)
    • Links to things that have been attempted
    • Information you think people should know regarding this, that's not already listed. Or information you think should be in the original post so people can easily see it. (I don't want great info hidden deep in the thread, rather on the first page)
    • Keep me honest! If I post nonsense or inaccurate information, WE NEED you to correct me! Last thing I want to do is steer anyone in the wrong direction!

    What NOT to post:
    • "+1"
    • "Thanks"
    • Petitions
    • Bounties
    • ANYTHING NEGATIVE! Negative Nancy, PLEASE go away!!
    • Etc. In other words, DONT waste thread space with nonsense. (Don't let that comment confuse you however with the 'very welcoming' questions from developers; This SHOULD be a collaborative thread. Productive input certainly welcome.) The idea is to QUICKLY allow someone to read this and get ALL the info to start trying to crack this. Going through pages and pages of irrelevant or useless comments will only make the goal more difficult, or prevent our new rookies from coming up to speed and trying to unlock this bootloader.

    Who am I and what am I trying to get out of this?
    I'm an application engineer and developer that bought an S7 from Tmobile and found out the hard way it had no way to get a custom rom, despite TMobiles past of typically allowing this. I'm frustrated like you all & want my phone unlocked, pure and simple! Besides, this is a community, and what better of an agenda than to try and conquer what others have said, "that's impossible"!

    Other Notes:
    • MANY, many thanks to all the contributors out there!!! I got most of this information from other forums on XDA!
    • Following few posts will have resources and additional links. This thread is new so I'll find a good organization method in time.
    • PLEASE subscribe if you are (or want to be) a contributing developer, or have anything to add - or if you can answer others questions. I think a lot of this knowledge will expand to other devices, and not just Samsung, but future devices as well.
    • Please let me know of anything to fix with this thread, like tags, thread description, etc.
    • Make sure to send the link to this thread to people you think might be interested (but don't spam them!) Or post a link to this thread in other seemingly dead threads on unlocking this bootloader. Alone it just may be impossible to do this...but as a community, sharing all of our knowledge...we can do this!
    • Still not motivated to do this? Try this: https://www.google.com/webhp?source...=1&espv=2&ie=UTF-8#q=s7+bootloader+bounties&*
    • If you found this thread useful hit "Thanks"!
    .
    6
    Information

    Quick facts

    Locked bootloader
    • Easy way to tell you bootloader locked status(?)
    • What is the bootloader? Part of the Android boot process. See all about it here: http://newandroidbook.com/
    • Why can't we currently unlock the bootloader? There is something called the chain of trust, whereby 'everything' from when the phone first turns on, through each 'piece' it verifies the contents of the flash is legit and from a listed trusted source (either Samsung or carrier). What controls this is the current, existing software/FW on your phone. So if we took what's there and removed these checks, we currently don't have a way to write this to your phone, since "we" aren't from the list of trusted sources. How do they enforce this? The images need to be digitally signed.
    • What does it mean to digitally sign a file (or image, FW in our case)? There is a private key and public key. Samsung and/or Carrier have the private key, your phone has the public key. Author writes a new SW package, then uses a tool to get a checksum. The checksum gets encrypted with the private key. The encrypted checksum gets appended to the SW package. Using OTA (over the air deployment) or ODIN, we push the package to the phone. The phone decrypts the appended encrypted checksum using its public key, does a checksum on the remaining package, and makes sure they both match. Now you can see why we can't fake this! Only way would be to find an exploit or get the private key so we can sign these ourselves!
    5
    Links (relevant threads)

    Resources
    4
    Tools

    Phone Apps

    Other
    4
    Flashing

    Info https://code.tutsplus.com/articles/an-introduction-to-android-firmware--cms-26791
    • Firmware (Android ROM) is stored in a writable form of memory called NAND flash memory, the same type of memory that is used in storage devices, such as USB sticks and SD cards
    • Bootloader more info

    Ways to Flash

    Flash Errors & What they mean:
    • Failed aboot Fused 2> binary 1 - bootloader error: ?
    • SECURE CHECK FAIL: No Bueno! You're trying to flash something that's not digitally signed correctly

    Firmware/Files:
    • AP (Application Processor or PDA or Android Partition): Android. System partition with recovery, etc. Recovery, kernel and ROM will be in this file. This is the only FW that is open source.
      Typical contents of update.zip:
      • android-info.txt: Text file specifying the prerequisites of the build, such as the version numbers of the bootloader and the radio firmware that the build needs
      • boot.img: Binary file that contains both a Linux kernel and a ramdisk in the form of a GZIP archive. The kernel is a boot executable zImage that can be used by the bootloader. The ramdisk, on the other hand, is a read-only filesystem that is mounted by the kernel during the boot process. It contains the well known init process, the first process started by any Linux-based operating system. It also contains various daemons such as adbd and healthd, which are started by the init process More info
      • recovery.img: Very similar to boot.img. It has a boot executable kernel file the bootloader can use and a ramdisk. Consequently, the recovery image too can be used to start an Android device. When it is used, instead of Android, a very limited operating system is started that allows the user to perform administrative operations, such as resetting the device's user data, installing new firmware, and creating backups.
      • system.img: Partition image thats mounted on the empty system directory from boot.img. Contains the Android OS binaries as well as system apps, fonts, framework JAR files, libraries, media codecs, bloatware, etc. (Most used for flashing a custom ROM)
      • userdata.img: Partition image that will be mounted on the empty data directory from boot.img. Custom ROMs typically come with this image as blank so that it resets the contents of the data directory.
    • BL (Bootloader): Proprietary code that is responsible for starting the Android operating system when an Android device is powered on. Typically, it checks if the operating system it is starting is authentic as well. (Checks if the boot partition has been signed using a unique OEM key, which belongs to the device manufacturer, & is private.) Ie, Locked bootloader. Fastboot, IF allowed on a device, disables this check.
    • CP (Core Processor): Modem. This proprietary Radio firmware is another operating system on an independent processor called a baseband processor, independent of Android. This adds the cellular radio capabilities of the device like 3g & LTE. Qualcomm, etc develop this FW.
    • CSC (Consumer Software Customization): It is specific to geographical region and carriers. It contains the software packages specific to that region, carrier branding and APN setting. Eg Wi-Fi Calling. Flashing will lose your data (factory reset). Variations of CSC may retain data.
    • PIT files (Partition Information Tables) (Danger! Dont flash these unless you know what youre doing!)
      Different variants of the S7 have different partition sizes; same phone/same carrier with different storage size have different PIT. One issues people were having flashing images for other variants is that the partition would fill up. A workaround would be to reformat with a correct PIT file and check "repartition" in ODIN. More info via @[Ramad] https://xdaforums.com/sho...d.php?t=999097
      "Get PIT for mapping" error while flashing (indicates you need a PIT file to flash what youre trying to flash)
      -Extract current PIT file from phone: http://www.**********.com/how-to-ext...alaxy-devices/ (need root)