Background
What is XDA Developers?
XDA Developers (also known simply as XDA; often stylized as xda-developers) is a mobile software development community launched on 20 December 2002. Although discussion primarily revolves around Android, members also talk about many other operating systems and mobile development topics.
Many software and hardware hacks, rooting methods, and other phone and tablet specific tweaks originate from the members of the XDA Forum.
XDA Developers also hosts the XDA Portal, a source for Android and mobile phone development news, as well as XDA Labs, an Android app and repository that acts as a third-party application provider.
What is Magisk?
It’s a relatively new tool for customizing Android devices. It was developed by XDA Developer topjohnwu in 2016. Magisk is an alternative to the long-standing SuperSU, but it’s much more than just a root method. There are some key things you should know about this popular tool before you dive in.
Magisk is known as a “systemless” root method. It’s essentially a way to modify the system without actually modifying it. Modifications are stored safely in the boot partition instead of modifying the real system files. This is the most important feature of this tool. Since the original system files remain unchanged, modifications can go undetected by Google SafetyNet.
Googley SafetyNet is the reason why a lot of people use this tool over other methods. SafetyNet detects when the system has been tampered with and blocks certain apps from working properly. Google Pay, Netflix, and Pokemon GO are a few examples. SafetyNet is an important security measure, but it can be overly aggressive. Magisk allows users to have root and other modifications while still using these popular apps. Methods like SuperSU modify the system files, which triggers SafetyNet to block apps.
How to change user into plugdev mode or set up udev rules?
First, enable USB debugging under developer options. (If it doesn’t exist, continuously tap on the Build number option until you see a message that the Developer option is enabled!)
and then use lsusb in order to obtain the vendor & product IDs.
1
2
3
4
5
6
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 070: ID 18d1:4ee7 Google Inc.
Bus 001 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 002: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Go into the file /etc/udev/rules.d/51-android.rules, and add the line (Vendor and Product ID should be read from above info) into that file:
1
2
SUBSYSTEM=="usb", ATTR{idVendor}=="22d9", ATTR{idProduct}=="2765", MODE="0660", GROUP="plugdev", SYMLINK+="OPPO_Reno4"
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0666", GROUP="plugdev", SYMLINK+="Google"
And then run:
1
sudo udevadm control --reload-rules
Check it works or not, run (Bus number and Device number should be read from above info):
1
2
$ ls -l /dev/bus/usb/001/070
crw-rw---- 1 root plugdev 189, 133 Jan 13 11:00 /dev/bus/usb/001/070
Now it should work:
1
2
3
$ adb devices
List of devices attached
e0ce00b7 device
Or it could be related to the option File Transfer / Select USB Configuration.
How to Unlock Bootloader via Fastboot
- Setup ADB and Fastboot on your PC.
- Enable USB debugging and OEM Unlock on your Android device.
- Connect your device to the PC with a USB cable.
- Open a command window on your PC.
- Boot your device into bootloader mode using the following command:
1
adb reboot bootloader
└ You may get a request to authorize USB debugging on the device, accept it.
- Once your device is in bootloader mode, issue the following command to unlock bootloader:
1
fastboot flashing unlock
If the above command doesn’t work, run this command (older devices need this):
1
fastboot oem unlock
- (Not applicable for all) If you get a confirmation screen on your device. Press Volume Up button to highlight Yes and press Power button to select it. This will begin the bootloader unlocking process, which shouldn’t last more than a couple of minutes.
- Once the bootloader is unlocked, your device will reboot into bootloader mode. You need to boot it into the system now using the command below:
1
fastboot reboot
- During reboot, your device will go through a factory reset and then finally boot into system.
How to make adb root available?
Enable OEM unlock in the devices setttings, and then use
1
2
adb reboot bootloader
fastboot flashing unlock
What is OEM unlock?
OEM Unlocking means you are freeing yourself from your manufacturer. By unlocking your device you take full control and also full responsibility to whatever that is going to happen to your device. OEM unlock is kind of like breaking the agreement between you and your device manufacturer. After OEM unlocking, you can do powerful stuff such as flashing your phone with a custom ROM, a custom recovery such as TWRP or even custom Kernels.
Google introduced the OEM Unlock option with Android 5.0 and you should have an option called OEM Unlock under developer options.
Errors about couldn’t find the path of dsp
export ADSP_LIBRARY_PATH=”/data/local/tmp/libs/dsp;/system/lib/rfsa/adsp;/system/vendor/lib/rfsa/adsp;/dsp”
Note!
- /data/local/tmp doesn’t need adb root access!
- /system/vendor/lib/rfsa/adsp The default path of library from DSP is here.
Android 11
In android 11, developer have to build android in userdebug mode and flash the device.
How could we know the problem come from unsigned pds by reading logs?
Log:
1
01-17 11:05:16.296 11062 11076 W ./tester_example: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:750: Warning: apps_std_fopen_with_env failed with 0x2 for testsig-0x5f3bb7d1.so (No such file or directory)
How to create a signature for devices?
Use scripts to create a signatrue file testsig-No.series.so, and push it to the folder
- /system/vendor/lib/rfsa/adsp (/vendor/lib/rfsa/adsp)
- /system/lib/rfsa/adsp
which depends on the default searching path. And it will solve the problem.