Lab 09. Rooting

Rooting a virtual device

Resources:

Create a virtual device for the emulator using AVD Manager: Pixel XL, Android 7.1.1, API 25.

Start the virtual device with a writable system partition and with SELinux disabled:

./emulator -avd Pixel_XL_API_25 -writable-system -selinux disabled

Run adb as root:

adb root
adb remount

Install Superuser.apk (found in SuperSU archive, common folder) on the device:

adb install common/Superuser.apk

Push su binary (found in SuperSU archive, x86 folder) on the device, in /system/xbin/:

adb push push x86/su.pie /system/xbin/su

Change permissions to su binary:

adb shell chmod 0755 /system/xbin/su

Set SELinux on permissive mode:

adb shell setenforce 0

Install su:

adb shell su --install

Run su as daemon:

adb shell su --daemon&

Open SuperSU application and let it update the su binary.

Restart adb as non-root.

adb unroot

Enter adb shell and then access root using su.

adb shell
su 

Check if packet routing is enabled and enable it:

sysctl net.ipv4.ip_forward
sysctl -w net.ipv4.ip_forward=1 
smd/laboratoare/old/09.txt ยท Last modified: 2019/03/06 15:03 by adriana.draghici
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0