OK, here's the thing... This is just a demonstration that he has access to write to a root protected sector. Not that this gives you root access. So this is the "evidence" that root has been attained on this device. This is NOT the method to attain root.
- adb devices -l
- devices [-l]- list all connected devices
('-l' will also list device qualifiers)
- adb shell
- Gives you an interactive Linux command-line shell on your device
- this is in contrast to root access
- id
- Identify the Android device attached
- this first time it returns the response that you have 2000(shell) access for the UserID and the GroupID (shell@quark) along with a number of other special accesses
What he is doing is showing that initially he only has shell access (shell@quark) to certain User and Group partitions starting at location 2000 in the memory file allocation table, uid=2000 (shell) & gid=2000 (shell), along with the specific partitions in the 1000 and 3000 ranges for special purposes (graphics, input, log, adb, scard, etc...), but no read or write access to the Root partition (0 through 2000) other than those specific exclusions. This is the default, locked down mode the phone comes from the factory with.
- ls -l /dev/block/mmcblk0p11
- ls -l is a command to list files (ls) in long format (-l)
- /dev/block/mmcblk0 is a BLocK (BLK) of memory within the MultiMediaCard (MMC), in this case BLocK 0, with various Partitions (P), and we are looking at Partition 11
- p11 is the 11th partition. This corresponds to a specific range of addresses in the memory partition, much like a sector and block on a hard drive
- the command returns the block and partition and tells us the permissions as well as whether it's part of the root or not, what it's size is, date and taime, and it's formal address (i.e. mmcblk00p11)
- this first time it returns that you only have Read and Write access for the User in the shell (600) as demonstrated by the permissions list at the far left (brw - - - - - - -), where RW represents the System access to the root partition, and the dashes (-) are showing no access to User or Group
He then lists (ls -1) a BLocK (BLK) and Partition (P) of the MediaMemoryCard (MMC) (/dev/block/mmcblk0p11) and it shows that it is a root partition, and that the permissions are only to the System (the first rw at the far left), or 600. The rest of the permissions are none, represented by "-" (dashes).
- chmod 644 /dev/block/mmcblk0p11
- chmod 644 sets read and write access permissions for a specific partition
- the first 6 is the File Owner (system), and it is being set to read and write, the next access is to Group and it is being set to Read only, the third digit - 4 sets the Other Users to Read only
- So this attemtping to set the permissions to rw - r - r - - for the MMCBLK0Partition11 in the root partition
- It returns a "Permission denied" because it doesn't have authorization to write in ADB to the root partition
Then when he tries to write to change permissions the computer returns a "Permission denied", since he doesn't have root permission (still quark@shell).
- tells the ADB shell to gain (at least temporary) root access for the next commands from the phone.
- the phone then authorizes the root access
Then he requests SU and the phone provides the familiar window prompt to ask if you wish to allow root access. This then opens the User and Group to Root rather than Shell access. He wouldn't get that option and pop up window on the phone if the phone weren't already successfully rooted.
- This shows that the phone now has root access
Now he does another ID and this time it shows uid-0(root) and gid-0(root). This is proof that the phone has
at least temporary root access, to all partitions all the way to address 0 on the MMC.
Now it shows he has root access and permission at the command prompt to make changes to the root partition (quark@root).
- ls-l /dev/block/mmcblk0p11
- command is excuted, but nothing has been told to change yet.
Next, he lists the partition again and you still see the same permissions as above (brw - - - - - - -) showing nothing has changed...yet.
- chmod 644 /dev/block/mmcblk0p11
- This time, chmod is allowed to change permissions and there is no error "Permission denied"
Then he is able to do the permission changes to the partition (chmod 644 mmcblk0p11). He has changed the permissions to the partition from read/write, no access, no access to Read/Write/Read only/Read only.
- ls -l /dev/block/mmcblk0p11
- Now when it is listed, the proof is there in the permissions
Then he does the list command again and this time you see that the permissions to the left are now "brw - r - - r - -
- chmod 600 /dev/block/mmcblk0p11
- Then he executes a chmod command to change the permssions back to the default
This time he changes the permissions back to the original brw - - - - - - - with a 600 where 6 represents read/write and the 0s represent no access.
- ls -l /dev/block/mmcblk0p11
- finally, he shows that they are back to brw - - - - - - -
He executes another list command to prove that the root access permissions were changed back to before root was attained. A reference chart for the respective permissions and their numerical representations is below.