Explain "Don't Downgrade!" warnings when flashing stock firmware


Question

I have a few devices I want to put back from custom roms to stock. On almost every stock rom source, however, there are dire warnings for some devices not to downgrade to stock versions from before your latest installed rooted rom version. For example, from Androidayos:




UPDATE: DO NOT DOWNGRADE back to the old stock firmware version. Once your Galaxy Note 2 already runs on 4.4.2 based rooted ROM you should only revert back to 4.4.2 stock firmware, same as it goes if you are on 4.3 you may install and stay on 4.3 and then upgrade to 4.4.2 KitKat but do not ever downgrade to 4.1.2 or 4.1.1 due to the current secured bootloader on every update.




I wish to really understand that warning. For example, if the bootloaders are secure, how is it so easy for people to flash custom roms for the first time, coming from those 'secure bootloader' stock firmware versions? What would actually happen and what problems would arise if one did downgrade just as is proscribed in the warning? If there's a "current secured bootloader on every update," why is it safe to flash the same version that one is currently running rooted, but downgrading is not? And so forth…



I'm doing this to several devices, but the best is example is a Samsung Note II currently running Cyanogenmod 12.1, which is 5.1.1 Lollipop. In that device's case, every stock firmware is an older Android version than Lollipop, since no brand pushed OTA updates beyond 4.4 KitKat. If I go back to stock 4.4.2 KitKat, I'm going 5.1 to 4.4—doing what they're warning against. How do warnings like that pertain to devices in this state, and what should I expect?


Answer

Bootloader itself will get updated with some firmware updates. Take the Galaxy S6 as an example - the firmware G920FXXU4DPJN comes with bootloader level 4, while G920FXXU5EQF1 comes with bootloader level 5. Samsung has made it so you can only flash the same or a higher level of bootloader by official means, so as to prevent downgrading and exploiting vulnerabilities in older ones to achieve modifications such as rooting.



This bootloader level is not necessarily tied to the Android version of the firmware it comes with, although on older devices it tends to be the case - every major Android version bump comes with a new bootloader.




...why is it safe to flash the same version that one is currently running rooted?




Since bootloader is a rarely updated part, a series of updates will share the same bootloader level. Allowing the same level will let these updates through.




What would actually happen and what problems would arise if one did downgrade?




Attempting to downgrade will either stop halfway when flashing, or result in an unbootable phone (until you return to a firmware of the original bootloader level).




...how is it so easy for people to flash custom roms for the first time?




Bootloader has been unlocked by default on most Samsung phones (except AT&T, Verizon and a few other examples) up until Android 5.x, where the "OEM Debugging" switch has been added in the OS to ask for explicit user consent when they attempt to flash anything. Flashing under unlocked bootloaders are almost always easy and safe, but of course with the price of warranty void.




a Samsung Note II currently running Cyanogenmod 12.1




By definition you know that's not a stock firmware. In fact you probably shouldn't even call it firmware, since it only contains updated /boot and /system partitions - no userdata, no modem, no bootloader. Custom ROMs don't depend on bootloader level as strictly, and when they (rarely) do, they simply halt installation if the check fails, leaving you with an untouched system. More importantly, the bootloader itself is never modified or overwritten, so stock ROM compatibility stays the same - you still can only flash ones with the same or higher bootloader level.



TL;DR - bootloader level matters, Android version doesn't.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes