Monday, October 21, 2013

Android terminology explanation and why ROOT isn't a crime


This Android terminology dictionary will be growing in time. If you have any suggestions for terms to be included here, please leave a proper comment below this article. The purpose of this dictionary is to explain basic and fundamental Android terminology to a regular "noob" Android user. It is supposed to be written in language that everyone can understand.

Related articles:

ROOT (Superuser) - special user account used for system administration with the highest possible access permissions. The root/superuser account on Linux/Android OS has the same purpose as the Administrator account on MS Windows. For some reason however the term "root" has a very pejorative meaning in the Android world. Many users believe that "root" (or "rooting") is a forbidden fruit that might brick their Android device, void its warranty, make it unstable, unsecured or even explode in some situations.

What is the truth? Very simple - just go to the Control Panel on your PC/notebook and in User Accounts check the type of your account. Is it "Administrator"? Ouch! You're rooted! I really hope you can live with that. Anyway, it seems that having account with an Administrator rights on the Windows powered machine is nothing unusual. What you need to realize, is that having Android powered device without root access is like using the "Guest" account on your Windows computer.

So what will root access give you? Well, it might give you everything, but might give you nothing too. Basically it all depends on what the user would like to do with his device. Root access by itself doesn't change anything. Just like Administrator account on Windows, you can use its capabilities and change almost everything on your device or you might just keep using the OS as it is.

To add root access to Android device you need 2 files - Superuser.apk and su binary. The su binaries people commonly use are modified to latch onto a companion app, which prompts the user when an app requires root access.


ROM (proper definition) - Read Only Memory. Actually it has nothing to do with what most people think. What does an internet definition say about it? "Read-Only memory is a class of storage medium used in computers and other electronic devices. Data stored in ROM cannot be modified, or can be modified only slowly or with difficulty, so it is mainly used to distribute firmware".


ROM (wrong definition) - most people call Android installation package a "ROM" or a "custom ROM". What we call a "ROM" is just a content of /data, /system and boot partitions. Their technical name is "update package". Flashing this package is nothing other than just replacing particular files on device partitions. Where do these files come from?
  1. Developers can compile builds from Android Open Source Project (AOSP) or similar open source projects like Android Open Kang Project (AOKP) or CyanogenMod (CM).
  2. They can modify closed source vendor images (HTC, Samsung, Sony, LG) by extracting factory system partitions, images (i.e. system.img) or dumping the system partition directly from the device.
What does a typical "custom ROM" looks like? It's a .zip package with files organized in a specific order - applications, framework, binaries, libraries and other files required for proper system work. Imagine a .zip package with "Windows, Users and Program Files" folders inside. That, if we massively simplify it, is what an Android "custom ROM" package is made of.

"Custom ROMs" usually contain root access, so flashing a "custom ROM" results in rooting the device, BUT rooting the device does not always mean flashing a "custom ROM" because you can add root access on a stock system too by adding the su (superuser) binary.

The best name for Android "custom ROM" would be a “modified system zip package”. Why .zip? Because update.zip packages were originally designed for over the air (OTA) updates. So both OTA update and custom "system zip packages" have more less the same construction - system files with the proper update-binary/updater-script (inside META-INF), compressed into ZIP archive. The only method to install (or "flash") ZIP package is via Android recovery.


Boot - The boot.img file is commonly mistaken for the Linux kernel that powers Android. It is actually the image containing the kernel and a ramdisk. The kernel is the fundamental layer of the operating system that controls the input and output of data in the system, it mounts the ramdisk during the boot sequence.


RUU - ROM Update Utility used by HTC to flash/update firmware on HTC device. Again - not very fortunate naming. In fact RUU does contain some "low level" firmware like bootloader, radio, touch panel drivers but it also contains entire EXT3/4 partitions like system or data, which surely can't be considered "Read Only Memory".


Firmware - a combination of persistent memory, program code and data stored in it. "Firmware" is actually a better term than "ROM", but many people are used to calling "Firmware" everything else that comes in the RUU except from system.img. The content of so called "firmware.zip" (called that by HTC itself) was described in this article.


S-OFF/S-ON - S-OFF stands for "Security OFF" and S-ON for "Security ON". It's a term specific to HTC devices (and refers to digital signature checking on the bootloader "hboot"). Retail devices always come with SHIP S-ON locked bootloaders. Hboot can also be found in an engineering version (ENG as opposed to SHIP), but it's not easy to get such a device.


Bootloader - a computer program that loads an operating system and has all the parameters for how to boot the OS. Bootloader is located on a separated partition on your device and is responsible for a low level security on your device. Extended bootloader commands (usually executed via fastboot protocol) can basically manage the whole device, including possibility to gather all device sensitive details (like IMEI, software version, serial number and more), flashing a new operating system or recovery, updating bootloader and other parts of the firmware or even formatting EXT partitions. This is why some vendors (like HTC) lock the bootloaders on their devices to avoid giving end-users too much control over the device.


Fastboot - diagnostic protocol used primarily to modify the flash filesystem via a USB connection from host computer. After enabling the protocol on the device itself (entering "fastboot" mode from inside the bootloader), it will accept a specific set of commands sent to it via USB using a command line, for example "fastboot flash boot boot.img" or "fastboot erase cache".


Android Recovery - a separate partition on your device responsible for installing original OTA updates (.zip) and performing some basic operations on partitions (wiping, formatting, mounting). In some way Android recovery is a sort of mini-OS because it has its own kernel (so it boots independently from the main OS) and on custom recoveries (like 4EXT Recovery, TWRP Recovery) you can run simple applications like AROMA installer or AROMA Manager. Custom recoveries also provide touch support and many advanced features like partition conversion (EXT3--->EXT4), Nandroid backup, possibility to use themes, different wipe and format options, permissions fix and more.

Android Recovery can be based on open source or closed source code. The Android kernel inside the recovery must be always based on open source code.


CID/MID - CID (Carrier ID) and MID (Model ID) numbers are specific tags used by HTC to match a particular device with proper software updates. Many Android devices need different settings, hardware drivers and applications depends on the region of the world or carrier. One device can be available in a few different variants, for example HTC One has 6 different models IDs (MIDs) - PN0711000 (Taiwan), PN0714000 (Austraila, Hong-Kong, Singapore), PN0710000 (Europe), PN0712000 (United States and Canada), PN0771000 (China) and PN0720000 (U.S. Sprint). To check your current MID/CID number you need to use fastboot protocol and type "fastboot getvar all" command or respectively "fastboot getvar mid" / "fastboot getvar cid" if you don't want to see all variables output.


NANDroid backup - an 1:1 copy of the /system, /data, /cache and boot partitions. NANDroid backup can be created and restored using custom Android recoveries like CWM, EXT4 or TWRP. The form of NANDroid backup vary from different custom recovery - could be .tar, .zip, .img or other. NANDroid backup is saved on your SD-card (either virtual or physical) and can be easily transferred to the PC. It's highly recommended to do a regular backup, but to be even more secured, remember about having backup of the backup too.



Article contributors:
  • Shen Ye
  • Want to became an article contributor? Write a comment with an explained term in the the comments section.

Have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!