Root Your Android

*** Disclaimer I am not responsible for any damage you made to your device. You have been warned

-What is Root?

A must read about root is at Wikipedia.
Here Root is not the bottom part of plant which is in soil;). Rooting is the process of gaining administrator permissions to tweak partitions that are read-only before.

-What are the prerequisites for Rooting?

Good understanding of what you are doing. A method to revert back all changes done if something goes wrong.
In most cases you need an unlocked bootloader to do so. I will tell you in which cases we don't need an unlocked bootloader.

-What I can do with Root privileges?

Main advantage of rooting your device is blocking ads in system wide. Other advantage include Use apps that only work with root and modify /system, /data partitions.

-Why not to Root?

In the process of rooting, if you misunderstand something and done something wrong, then it may lead soft/hard brick of your device. Your warranty may void according to your region policy.

-Should I really need to Root my device?

In recent years, many things are changed. Before, we need custom roms/root for many customizations to device like changing font, increasing battery life, boosting performance etc.,. But now devices are capable of performing these things without root.
For example you can do below things without root:-
-Blocking ads system wide, use FireWall with VPN
Eg:- TrackerControl, Karma Firewall, Orbot
More info is at this guide or this
-Removing bloatware with ADB
-Install Linux distro with PRoot.

-Is there anyway to experience Root without actually rooting device?

It is possible if you use apps like twoyi, VMOS, F1VM, x8sandbox etc., or use Android in PC(read below).

-How to Unlock Bootloader?

This is needed to flash partitions with fastboot or dd. Method to unlock differs from OEM to OEM. Google, OnePlus, Moto, Xiaomi, Realme has some unique methods. Your device will factory reset automatically after you unlock bootloader, so make sure to backup your data before going. More info about unlocking bootloader can be found at here and here

-How can I Root my android?

It depends on Android version of device you are going to root.
If it is Lollipop(5.x) or lower, then one-click root is far best and easy way to root your device without need of unlocked bootloader.
If your device not have above mentioned one, then you have to search Google like How to Root your_device_name and go through the steps mentioned in your device specific sites.

If searching didn't find anything, then you have to use PC(and some complicated steps in certain devices) to root. First you need to unlock bootloader of your device if it is locked. Then follow one of below method.

There are different methods for this.
Below methods require bootloader to be unlocked
-Patching boot.img/recovery.img with Magisk
Example of this, see here
-Using a custom recovery and flashing root zip in it
Example of this, see here
-Using a custom/GSI rom which is pre-rooted
Phh's AOSP GSI is an example of pre-rooted GSI
-Using a custom kernel which is pre-rooted
Example of this, see here
We only need this if Magisk can't patch boot.img(lower than Android 4.2(17) or unsupported format of boot.img) or Magisk doesn't work in the device for some reason
-Using CF-Auto Root for Samsung
Example of this, see here

Below methods does not need to have an unlocked bootloader
-Using an exploit like MTK-SU, DirtyCow, qu1ckr00t
Example usage of MTK-SU, see here
Example usage of DirtyCow, see here, here
-Using one-click root methods
Example of this, see here

Examples of one-click root apps
=> Framaroot
=> Kingo ROOT (Recommended and will work in nearly all devices)
=> KingRoot (Will work in nearly all devices)
=> Towel Root
=> UniversalAndRoot
=> z4root

-What is a Custom Recovery and how I can root my device using it?

First we need to know about stock recovery.
-What is a stock recovery?
The recovery that comes default with your device is stock recovery. Different OEMs have different stock recoveries. But the main theme and background process is same for all these.
-Can I able to flash root solution in stock recovery?
No, stock recovery needs zip to be signed with OEM keys. Only OEM has that key. If you flash root zip in stock recovery, it will simply fails by showing Signature verification error. Some stock recoveries accept testkey signed flashable zips. But we need to create a edify based installer, since stock recovery may not have busybox in PATH.
-What does a custom recovery will do?
The main thing that a custom recovery do is, it allows flashing of unsigned zips or zips that are signed with publicly available keys(google testkeys), so that we can do whatever we want.
-How can I get custom recovery?
You need to port or compile it from your device and custom recovery sources. Alternatively, you can also use pre-compiled custom recovery for your device from different sites like XDA, 4pda, hovatek etc.,
-How to flash custom recovery?
If your device manufacturer has flash tool then use it. Example Samsung's Odin, Xiaomi's MiFlash Tool. If your device does not have specific flash tool then you can use fastboot method to flash. If it also doesn't work then you have to use SoC(Mediatek, Qualcomm Snapdragon, Spreadtrum/Unisoc, RockChip) specific flash tools like SP Flash Tool, Research Download Tool.
If you are rooted and had unlocked bootloader, then you can flash recovery like dd if=custom_recovery.img of=.
-What are different custom recoveries?
CWM, TWRP are popular recoveries. These are exist for many number of devices. Others are mainly derivatives of these like PhilZ, PBRP etc.,
-How can I root with custom recovery?
Simply choose one of the root solution that is compatible with your device from below and flash it in custom recovery.

Various custom recovery flashable root solutions
=> Magisk (Recommended for 5.x and higher)
=> SuperSU (Recommended for 2.3 - 4.4.x)
=> Phh Superuser (Recommended for 5.x and higher)
=> Koush Superuser (For 2.2 - 4.4.x)
=> ChainsDD Superuser (For 1.5 - 2.2.x (3.2-RC3 will work in 2.0 - 4.1))
* Root solutions that are recommended for specific android version may also support other android versions, but it will work better in recommended versions.

References:-

XDA Developers Eg:- this
Wikipedia
Various others like this


Root your Android PC

Android in PC is possible in following ways
- Using Android Emulator(AVD)
- Using Android-x86 or its derivatives like Lineage, Bliss, PhoenixOS, PrimeOS.
- App Players like MEmu, LDPlayer, BlueStacks, Nox.

-What is the difference between those ways?
Android Emulator is official by Google with its term AVD. It is in ARM or x86 architecture. You can choose whatever architecture you want. So, if you want to use apps then you don't need to worry with compatibility.
Android-x86 is unofficial project with x86 architecture. That means we can install it like any other OS without need of Virtualization/Emulation. But downside of this is that, we need to be take care of selecting apps. Native x86 apps will work but not all arm apps will work. App Players are also x86 versions.

-Is there a simple way to get root access?
The simplest way to root access is to use adb shell in AVD or Debug Mode (ALT + F1 to enter and ALT + F7 to exit) in Android x86. All the commands run in this way will run as root user. We can do whatever you want with commands.
Downside of this is, we cannot give SuperUser access to apps. To overcome this, we need to push su binary to PATH and install corresponding root management application. App Player may has different procedure like enabling in settings(MEmu*, LDPlayer*, Nox*) or executing hidden su like in BlueStacks* /system/xbin/bstk/su(from adb shell only!).

A new tool is made to install Magisk in Android-x86 emulators. You can get it at here

-How to push superuser files to Android?
If you are rooting Android-x86, make sure that /system is read-write when installing it.
If we want to root Android 7.x.x or below versions then we can flash SuperSU from root prompt as said above using update-binary. Before going to execute this, make sure busybox in installed and set in first of PATH. Example usage is sh update-binary 2 1 /path/to/SuperSU-v2.82-SR5-20171001.zip


-How to root using Magisk?
See github repo by shakalaca at here, another tool here by newbit, one more one at here and guide at here and here.

* Tested versions of App Players with above said functionality are:-
-MEmu 7.3.2
-LDPlayer 4.0.45
-BlueStacks 4.260.0.1032
-Nox 7.0.0.8

Comments

Popular posts from this blog

online తెలుగు రేడియో

Day 3 at Gym

Day 7 at Gym