Shared publicly  - 
S-Off vs Unlocked, and flashing firmware

Earlier this week, I met with some of the folks on the HTCDev team in Seattle to talk about supporting +CyanogenMod and root users/developers.

We had a chance to discuss some of the misperceptions of both sides, and the conversation was enlightening. On the ROM community's end, there seems to be a misunderstanding of what "S-OFF" means; as there are a few issues being conflated here. So much so, that they recently released a S-OFF FAQ on their HTCDev portal about it:

There are two distinct concepts here:
 * Being able to flash a custom ROM (boot, recovery, system)
 * Being able to flash the black box partitions (non-mfg bootloader, radio, trustzone, etc). This also enables carrier unlock via SuperCID.

The term "S-OFF" is specific to HTC's bootloader, and is now being generically used and misnomered across all Android phones. The HTC Dev Unlock tool (as of the One) allows a user to flash the partitions that are interesting to custom ROMs. A full S-OFF turns off all security, allowing flashing of the radio and bootloader (and switch carriers). The latter bits are complete black boxes to all developers, and are generally not very interesting. Anyone that is involved with the radio stack, etc, are most likely employed by either Qualcomm, Samsung, etc. There is no "radio" development in the ROM community.

In a previous post, I stated the that "...the HTCDev unlock on this device [HTC One] actually behaves properly, unlike its predecessors. It behaves like a Nexus device."

The HTC One is not S-OFF. But neither are the Nexus devices (Secure Boot, good luck flashing a "custom" radio image).

To put things in perspective (and these are my/+CyanogenMod's opinions); I'm not particularly concerned about devices being S-OFF. Even if they were, I wouldn't want to (or be able to) make changes to the radio anyways. I do want my phones to be unlocked so I can flash custom firmware, and I can do that.
David Li's profile photoKristopher “IrishGreen” Davis's profile photoPRASAD CHOWDARY's profile photojohn o'carroll's profile photo
My problem with the HTCDev unlock tool has always been that it did not lift the security on the boot partition.  I'm glad to hear that has changed though.  

As to the other partitions, even without S-Off, you can still overwrite most of them if you know what you're doing.  That's plenty of access.

Thanks for the post.
Thanks for clearing that up.  
e: You can flash a new HTC radio with S-On, my mistake.
Rich S
Some apparently find value in flashing radios - when I had a Sensation, there were a lot of winzipped sense roms that would swap out the radio from various releases.  Some would claim that the reception was improved, and maybe it was true, maybe not.  

Still, if HTC pushes out an update to the One that includes an updated radio, wouldn't it be beneficial to be able to flash that if you're already running a CM variant, and don't want to have to revert to stock, get an OTA update, and then hope you can still root while running the latest?
+Franklin Morrison They can. I'm disappointed your comment even has a +1, and I may delete it, as that is just further misinformation you are spreading. S-On just verifies the radio signature. It does not prevent legitimate radio upgrades.

You do not want to be flashing radios that are not signed by HTC, as that's probably going to just brick your phone.
I think the misconceptions come from older HTC devices. When I had my HTC Desire you would need to put it on S-OFF or the /system partition would be locked for writing (you could mount with rw permissions, but on the moment you make any change to the /system partition the phone would reboot and the change would not be made).

If I remember correctly you could install custom ROMs if they're signed, but you could not, for example, use Ad Block software without using a hack.
+Koushik Dutta And even with S-On, you can still dd a new HTC-signed radio image.  You just can't use an unsigned image - which, as you pointed out, would be worthless anyway as there is no custom radio development in the first place.
+Koushik Dutta thanks for clearing this up. While now HTC's bootloader unlock means that we can now flash boot.imgs from recovery, can we also still flash different radios (that are signed and official) from fastboot without an S-OFF bootloader? Like +Rich Stone mentioned, sometimes the freedom to pick and choose your radio is beneficial.
To seek clarification, this does means that there is no need to flash kernel separately on the HTC One via fastboot when flashing custom ROMs, right? 
Thank goodness, that was why I refused to purchase HTC devices for a while. I don't mind having to fastboot something over but everytime I got a custom rom upgrade got old fast
Pro Tip for the old-style HTCDev unlock: fastboot boot recovery recovery.img; then you can flash the boot partition (or any others for that matter) in recovery just fine.
+Koushik Dutta Yeah, this is similar to how +ASUS handles things on their #transformer  line of devices. You can write signed bootloaders, recovery, boot and system. That's all you really need to support custom rom's anyway. So it works for me.
+Rich Stone I would take those kinds of comments with a grain of salt. Almost none of those claims are backed by any sort of hard evidence.
+Koushik Dutta So are you saying that all of the issues raised in the past (see the info from toastcfh at as an example) are no longer valid?  From the sounds of it, at least the kernel restrictions are gone, but what about the other issues?

Looking at that article, I am led to believe that with S-ON, not only am I unable to flash unsigned radio firmware (don't care about this), but I am also unable to update signed radio firmware from the manufacturer in recovery.  Has this changed?  From various sources, the restrictions on flashing kernels from recovery and on flashing even signed radio updates WERE present in the past.  Denying hacked radios is "yeah whatever", I agree with you that running unsigned radios is something that it's perfectly within reason for a manufacturer to block - making it difficult to flash official signed baseband updates is a different story though.

FYI, on almost any other device, you can flash an unsigned or improperly signed radio all you want - the modem will reject it when it is bootloaded from the AP at runtime.  This eliminates the potential side effects of accidentally blocking legitimate updates, while still ensuring that the modem doesn't screw with the network.

As an example of why there are valid reasons to update to newer official radio firmware - older Samsung radio firmwares had broken signal strength reporting, requiring all sorts of framework hacks (Such as deriving an arbitrary strength number from the number of "bars") as a workaround.  Newer basebands for Samsung devices report signal strength properly, eliminating the need to reverse-derive it from the number of bars.
+Koushik Dutta people like me who sometime can't get an official HTC device for my region and want to import a us carrier locked device, without s-off I can't use the device. This sucks, as HTC always delays the official release in my region... 
Thanks! Glad that we can flash everything together. I think that was the main reason everyone wanted Soff.
"The latter bits are complete black boxes to all developers, and are generally not very interesting."

They may be "uninteresting" in as much as their functionality and implementation are mostly abstract to the Android stack (and most people don't have access to their source code), but that doesn't mean they are "uninteresting" in the unilateral sense.

I think the most sensible reason i've been given for keeping the baseband locked down is for regulatory compliance. Okay, I can live with a blackbox network connection. But locking down the bootloader is kind of lame.
Very sick! I couldn't begin to tell you how annoying it is to have to flash kernel seperatly especially since it makes dual boot in applicable
maybe I am wrong but I thought that by being S-On you can't upgrade to a new hboot while being on custom rom, you have to revert to stock, OTA update and start all over again.
If that is true, S-ON is still a pain in the ass for CM users.
+Ran Bar-Levi Yup.  That's the part of this that isn't clearly addressed by Koush in this post - can the "black box" components now be updated with newer (but still signed by HTC) components without a major hassle?

That's the reason I still think S-ON in its current form should not exist - any device with a sane security architecture enforces the chain of trust at runtime (when the device boots).

I think that's the aspect of S-ON that bothers people the most - restrictions on flashing items that do occasionally change (including, at least historically, difficulty in flashing items that ARE signed by HTC), NOT restrictions on execution of trusted components of the boot chain (which are perfectly reasonable).
+Andrew Dodd Versioning is a factor in a trusted boot chain though. Otherwise for example, a malicious actor could just flash an older signed component with a known vulnerability and it will be trusted in the chain.

Only optimal solution i see is to let customers electively turn off trusted booting. All the usual disclaimers and rigamarole can apply (e.g. getting a token from an "unlock" server, etc)
+Tadej Rudec once in a blue moon but if HTC fixes something important or change it for the better you want it.
Sometimes the root loophole is closed with a new stock. that's when it gets to be a real pain.
+Tadej Rudec depends how root is achieved.
I had to wait weeks onceon my HTC sensation cause reverting to stock + OTA left me with no root option.
+Jason Hsu Completely eliminating the trusted boot chain is not something we'll ever see (ESPECIALLY for the baseband), and I'm OK with this.  However, arbitrarily write-protecting partitions achieves little in terms of security (unless your security architecture is just plain broken).

See d2vzw as an example - it relied solely on write protection of the recovery partition for security of that partition, and got pwned within 3 days because of that.  Arbitrarily throwing partition write protection in users' faces achieves little to no benefit in terms of security (since any partition that is "important" can be integrity-checked at boot time), but is a royal pain in the ass for users.

Again, if HTC has changed things so that you can update the radio firmware (again, to be clear, to a newer manufacturer-signed version) without major hassle, this is all moot - but so far it sounds like they may not have.
One thing to note - S-OFF doesn't necessarily mean that you can flash a custom radio. S-OFF basically means that you have full control over the "apps" side of the device through HBOOT. Radios are still signed through a chain of trust that goes from PBL -> OEMSBL -> Radio (on the radio side of the processor). 

With the ability to have full control of HBOOT, you can however speak to the radio bootloader, which can let you do potentially compromising things to the radio.

Disclaimer: I haven't worked deep in HTC radios for a few years, but I suspect they are still architected in a similar way.
+Daniel Charlton sorry that is incorrect.  You couldn't flash the boot partition in recovery unless you had S-off.  There was a script that had to be run after the custom rom installed that would boot the phone back into bootloader mode and then flash it that way, if you were still S-On.

Also +Koushik Dutta another reason for achieving S-Off was to revert back to previous builds from leaked builds that had an updated mainver.  Some people still like to run stock roms that are just tweaked.  
+Koushik Dutta What about signed baseband updates?  Are these easier to apply now than they have been in the past?
+Koushik Dutta did HTCDev folks happen to mention if the AT&T variant of the One would remain unlockable on HTCDev?  The debacle that was the HTC One X (Evita) wasn't that long ago, and engadget said the unlock service could be discontinued at any time. 
Yep, just realized that the main version problem was induced because of the script needing to be run in hboot.  Thanks +Koushik Dutta for pointing out I was being a bonehead.
With this information, I might consider getting a One. I'm not thrilled with the current state of my HOX, so I'm a bit reluctant to consider another HTC device. 
+Aaron Saellam I was right there with you, until I saw the One in person.  HTC got this one right
Sounds like HTC have changed what you can do while still S-ON. You used to have to S-OFF to do anything meaningful custom ROM-wise, but it sounds like now S-ON is good enough. Not suprising HTC think there have been misunderstandings if they have moved the goalposts (in a good way, and kudos to them for that).
With Samsung locking bootloaders on some of their SGS 4's the One could become the dev community's darling.
Well then why does an unlocked bootloader droid DNA with s on can't flash kernel from recovery is the question ?.
+Michał Banszel I'm not talking abou the HTC One X or other legacy devices. I am specifically talking about HTC One and future devices. I don't expect them to go and retroactively apply their policy change to older devices.
Regarding radio flash: it's more likely going to really in a bad flash, but keep in mind the argument against touching these "black boxes" is the same employee against the ROM community back in 2009. If I'm not mistaken, the perma-tether solution for some Motorola devices uses tools to access"black box" areas.
Except being able to flash unreleased radio firmware at your own risk. They should have the option for S-OFF much like unlock. 
Also saying "TAMPERED" in big letters on the hboot is a bit unfair. I buy the developer edition and flash ROMs as intended and I get hammered with a big, fat "YOU MESSED WITH THIS PHONE" message. 
Here's my policy on spreading misinformation on my threads: I will delete your post.
+Koushik Dutta one issue for me with HTC's S-OFF/S-ON policies is that those black box sections do have development value. Sure there is not (that I am aware of) custom Radio development, but as +Andrew Dodd has pointed out and asked about there is definitely value to being able to flash a radio update. Going back to my Evo 4G, being able to flash the radio independent of anything else was very important when we had a rash of bad radio firmware. And as was pointed out, if you're in CM and there's a new RUU from HTC, wouldn't you want to be able to flash the radio firmware without having to do the age-old process of nandroid, flash ruu so it flashes the radio, then restore your nandroid?
Also, being able to flash things like the littlekernel bootloader and having more control over your device is something that HTC is limiting in their S-OFF/S-ON policy. To me it stifles development opportunities and/or options.
Thanks for getting the conversation going on this. 
+Michał Banszel deleting data before unlocking is good security practice. Or your stolen device data could be compromised even if it had a pin lock. Even the nexus does this.
+Koushik Dutta Deleting data on unlocking isn't the issue that people have - it's the fact that, apparently (according to multiple reports, specific to the One), HTC is putting things in /data/preload which get killed by the unlock process.  Now, I find it kind of surprising that they're putting things here without a backup of those applications elsewhere (otherwise, those same apps would be wiped when you wipe data) - but it may be that HTC's method for restoring these items from wherever they should be restored from breaks during an unlock wipe.  (Perhaps stock recovery is doing some special restore voodoo for /data/preload after a wipe during stock recovery?)

If you go to the link +Michał Banszel posted you'll see that there are actually OTA updates that look for /data/preload/Calculator.apk, and will fail if it is not present.  Can you (or HTC) give a rational justification for brokenness like this?
Oh, as an example of why it should be easy to update the trustzone partitions (again, updating to a newer manufacturer-signed component, which has historically been difficult on HTCs and so far, I have yet to see any confirmation that this has been fixed):  On all Krait devices I've seen so far, the default GPU frequency governor passes load information to trustzone, and trustzone returns a decision on whether to increase or decrease GPU frequency.  I'm assuming this is done because trustzone has access to some sort of decision data the kernel doesn't.  As a result, if the manufacturer fixes a bug in the scaling algortihm on the trustzone side of things, a user should be able to update this without going through major hoops.  Otherwise, they have to continually use kernels that completely replace the GPU scaling algorithm.

(What valid reasons there are for this decision to be made in TZ when it is acted upon and can be overridden by the kernel is subject for a completely different discussion.)

Edit:  What goalpost have I moved?  The goalposts have been "unlocking my device should not have nonsensical negative consequences" and "I should be able to update key components of the system without going through hooos" .  Always has been, always will be.  Losing stock applications on unlock, however it happens, is a nonsensical negative consequence.  I still have yet to see a confirmation that updating to newer signed radio firmware is not the pain in the ass it has been historically.
As long as any software/firmware runs that is inaccessible, we do not own our device and cannot fully trust it.  More hardware allowing flashing of custom roms is great - huge progress - but we have no guarantees there are not exploits, root kits, or other devious trojans waiting to betray us in our own devices until we can freely examine or change that source.  That is why from a practical standpoint, nexus phones are great, but from an idealistic point of view, they still have a long long way to go (and as you rightly imply, even having S-OFF today would be pretty useless unless we actually had the source, or alternatives, we could use that worked)
+Carl Myers To HTC's credit, the items in question are usually only signed, not encrypted.  You can see what they are, you can (with other manufacturers, but historically not with HTC) update them easily to items signed with the same key, you just can't arbitarily alter them on any device I've ever worked with.  There are VERY good reasons to do this for the radio baseband.  You know all of the arguments carriers make about "we don't want stuff interfering with our network"?  Those arguments are bullshit as long as the baseband is signature-checked before execution.  However, if the baseband can be altered easily, those arguments start holding weight.

So there are VERY good reasons for signature-checking the baseband before execution (most baseband chipsets do this in the chip, with no need for the application processor's trusted boot chain to be involved.  Qualcomm MSMs are a bit of a special exception, but the modem can verify its firmware on load even if the file that firmware is being read from is writable by the user.), just very few legitimate ones for write-protecting the location where the baseband firmware resides.
Thanks for sharing +Koushik Dutta but I always wondered and actually am interested in the radio development and benefits which could be gained by being able to control certain aspects of it. Would there be any?
Next time, please ask why HTC left half of their kernel source code... 
Currently S-ON, to me it's just a matter of needing to be at a PC to flash ROMs. No biggie.
Thanks for the post, I don't care what the label the manufacturer uses says as long as "unlocked" includes being able to flash kernels without hoops.
This actually makes the HTC One a lot more interesting than past HTC phones.
+Rafal Blaszkiewicz If you had the right equipment, and knew what you were doing, in theory you could optimize the radio's performance for a given carrier/region.  However, you would need detailed documentation of Qualcomm's DSP architecture, radio architecture, UMTS modulation and demodulation, and a ton of very expensive RF test equipment.  As a result - there are good reasons for cellular modems to always signature-check their firmware before starting operation.

However, there is no legitimate reason for making it difficult to upgrade/downgrade firmware as long as the signature check passes during modem initialization - HTC has traditionally made this workflow EXTREMELY difficult, and I'm still looking for someone to confirm that the One addresses this horribly broken aspect of the workflow in addition to the kernel flashing issues.  On any other device I've worked with, I can dork around with the flash region where the radio firmware resides all I want, and the worst case result will be that I get a baseband of "Unknown" in Settings due to the modem failing to initialize because the signature check failed.
Hey guys I need help I'm helping a coworker with his htc one he did something to it. Everytime you boot the phone it goes directly to will wheatons recovery lol.
So how do I get his phone to boot normally.
 I turn it off completely turn it back on and it goes straight to recovery.
+Michał Banszel Because that is not a bootloader/S-OFF issue. That's an ota/partition layout/data layout bug.

For example, take bootloader unlock out of the picture completely.

You're on a stock HTC One X.
You factory reset via stock recovery, hboot, or Android system settings. (The phone is not unlocked)
This wipes /data/preload.
You can now no longer get OTAs due to the apply_patch check.

You are bundling that bug into bootloader issues, when it is not a bootloader issue. The bootloader unlock is just one of many ways to reproduce the bug.
My past concern with s off was simple. New updates included new radios. Without s off. You couldn't manually flash them.
On the rezound it was really irritating to flash kernels not being soff. Unless you paid for certain root programs you always had to fastboot the boot image via fadtboot commands. Not very handy to always be best the PC.
Dev unlock is nice. But for people that truly like owning their device I have always preferred s off.
Koush and cm are so far advanced past me its silly but for me, if I owned another HTC device it would most certainly have to be s off.
My old Evo 4g was a wet dream due to such things as s off. Look at the DNA. Its not just Verizon limiting it. Also you do need a GPL complainant company if you want proper ROMs and that another sore subject in the communities. 
+Michał Banszel Furthermore, you are also backdating my statement onto past devices.

The HTC One does not have a /data/preload.

To reiterate, my post is specifically about the HTC One and future HTC devices. I'm not going to argue about what HTC has done in past devices or hold it against them. What they are doing now and in the future is a more meaningful discussion to me.

If you want to complain about unlocks on older devices (which admittedly have terrible unlocks as even I have stated myself), you can do that on another thread, because that's not what this post was about.
We're doing our best to talk to vendors and improve support for various things, but they have to be highly specific. Not being able to do things you should obviously be able to do from various modes is likely an oversight or bug and we can bring these things up. Asking to open EVERYTHING because of one specific issue is not how you get things fixed.
This kind of talk reminds me the Windows mobile days with htc devices. The first branch of Android htc phones were a little alike. Custom radios and bootloaders were needed to enable some things like supercid, mfg bootloader required.
so then why was i stuck with 1X when using cm7 after i put my og evo on boost??
If you don't have an iPhone, you don't have an iPhone :D
+Koushik Dutta the One does have /data/preload (in fact I think it's the first phone HTC have done it on), although I expect a lot of them are missing it by now.
You are right +Dhruv Bhagat if you don't have an iPhone and spent close to the same amount of money on a Android phone then you most likely have a smartphone with much better specifications than an iPhone.
Can anyone help please. I have a HTC desire hd which I love. I tried to root it and made a complete mess of it. It will not boot up at all. Is there anything I can do to get it going again
Does this mean thay have changed it so the OneX boot partition can be flashed from recovery. At the moment boot is protected by S-ON and requires a flash via fastboot. 
+Andrew Dodd and fair enough, but if I hack my baseband and it interferes with their network, why not just knock me off? why not ban my hardware? why instead cripple my ability to run the software I want on the device I own? if an ISP did this to a computer with the same argument about impacting service, we would never accept it. why is this different?

+Koushik Dutta +Michał Banszel unless the american device differs which I doubt I agree with Michal, myself and others have lost these apps when the bootloader has been unlocked. Then the recent 1.29.401.12 OTA fails to go through. This is for the HTC One.
Seriously. You all either keep finding new problems or just ignoring what Koushik says 
it's just the problem that htc made it impossible to flash a kernel from recovery on the oneX and oneS (and maybe earlyer models) but now that this works everything is fine with dev unlock!
Enjoy it while you can mr Koush. Reminds me of the early 1998 gold rush of un-patched named servers and we had so many we made SHAFT, the first DDOS of its time. Its been surpassed with many other botnets. But hey, we did it first. Expect pax to be slapped on the next production models. Just a guess.
+Koushik Dutta +Steve Kondik quick example...cannot edit the build.prop with root explorer. You have to flash a new one in to make an edit. It makes something easy to do, now a hassle. Not to mention all the new hoops to jump through (flashing scripts) 
Don't get me wrong, I love the one...but the more I play with the xperia z, the more I don't care about the front speakers on the one.
+Koushik Dutta hi i'm not familliar with htc devices so is it going to be possible to unsimlock (is it the proper term to say that i want to put an other sim card form an other carrier) the htc one ?
+Koushik Dutta Idk how you deal with all these people. Some of em don't read shit before they comment , others ask a question u just answered a comment above them, some just want to argue, some are braindead, and a couple are making a big deal because u lose flashlight and a couple other .apks?smh
+Daniel Charlton so you can do this and you wont have to use fastboot to flash a new kernel eveytime i reboot on the stock rom? Its driving me nuts that my phone just goes nuts while at work and stuck on the boot screen until it dies. That part gets old real fast whether on stock roms or 4.2.2
hey koush what script will allow me to flash a kernel in twrp or cwm recovery on htc one v?
Mordy T
+Steve Kondik A simple question I still have (and the one that has been holding me back from buying any HTC devices since March of 11) is... what partitions are open and what are locked. I don't care if radio is locked (as long as I can flash signed updates), but if bootloader is locked, I won't be able to change the initial splash screen if I wanted to. On the Galaxy Nexus (Toro for example) I can change the initial "Google" splash screen when booting and the icon of the unlocked padlock. Can I do this on the One?

Also, I want to know the status of fastboot. I can't tell you the times I would have an unbootable system (including no recovery) and just boot to fastboot, boot to recovery, pull all data, etc. Is fastboot still gimped in HTC phones? I know at one point it was just about useless...

I am glad HTC is finally opening up their phones to custom development without needing to hack around the blocks, but they need to be at 100% open for them to regain their lost customers.

Also something to discuss with them - warranty on hardware after an unlock. If my power button breaks under normal use, regardless if I am running CM or stock, that should be something I can warranty.

If they do this right, they may be able to regain a lot more of their customers who left for Samsung. And while a small minority, the techies are the ones other people go to asking "should I get this phone"?
+Rich Stone i'm one of this user with sensation. Early my phone is branded and my op not release the latest htc's ota with radio upgrade. I gain s-off with joupnotbear method and 'im able to flash the radio, new hboot etc after flashing the last radio for sensation i gain over 30% of signal compared to older. And new hboot help with overheating problem of sensation after upgrade to ICS. For htc device are S-off is the first goal for a better phone :P
When the google edition binaries come out, could we flash them with s-on? 
hi all...
small help.. My htc one rooted m7 international everything fine s-on but i am able to flash recovery .. previous i am able install custom roms kernels. but i am not able to flash custom roms kernels now suddenly ..etc.. if  i am trying to flash my phone reboots.. any solution plz ???
+Himanshu Dubey International only.. even i tried to flash all recoveries means cwm twrp also diffrent versions.. stil i am stuck up and bootloop ..i am not able to find soultion
2.24.707.3.. Only ota avaliable.. hboot 1.54.. s-on
No ruu avaliable for that version.. even i tried with previous version ruu.. showing signature failed
I tried everything.. no use.. i am able to flash recovery... but i am not able to enter into it.. in bootloop mode
5 times i locked and relocked.. 20 to 30 times i flashed recovery and erased cache also
4.1.2 .... Dont know exact version may be 1.29 
So would I be able to convert my T-Mobile One to a Google Play Edition with it's Ota updates with s-on?
Add a comment...