Android 4.4 System How to get root permissions

Source: Internet
Author: User

1. Preparatory work:

Prepare an Ubuntu machine, copy the boot.img to the machine, download the necessary tools
sudo apt-get install abootimg
git clone https://github.com/anestisb/android-simg2img.git
CD android-simg2img
Make
sudo cp Simg2img/usr/bin

2. Unzip the boot image
Abootimg-x boot.img
mkdir RAMDisk
CD RAMDisk
Gunzip-c. /initrd.img | Cpio-i

3. Modify the Default.prop file to make
Ro.secure=0
Ro.debuggable=1

4. Modify the init.rc to make
On property:ro.debuggable=1
Start Console

Service ADBD/SBIN/ADBD
Class Core
Socket ADBD Stream 660 system system
Disabled
Seclabel U:r:su:s0

On Post-fs
# Once everything is setup, no need to modify/
Mount Rootfs ROOTFS/RW remount

5. Modify the Fstab.freescale so that the Mount permission can be written
/dev/block/mmcblk0p5/system ext4 RW Wait

6. Repackaging RAMDisk files
CD ramdisk/
Find. | Cpio–o–h NEWC | Gzip >. /new-ramdisk.img

7. Create a new boot.img
The new-randisk.img file size will be different from the original initrd.img because it is unpacked and then packaged.
If larger than the original, you need to reset the size of the boot.img,
View the original size
Cat Bootimg.cfg,
The first line is the size of the original boot.img,
Use Ls-l to view the size of the initrd.img and new-ramdisk.img two files,
In the original boot.img size based on the size of the two file (newsize-bytes), note that the number of bytes added is best block integer times, such as 4096 bytes and so on.
Then use the command to generate a new image:
Abootimg--create new-boot.img-f bootimg.cfg-k zimage-r new-ramdisk.img-c "Bootsize=newsize-bytes"

8. Boot.img the generated new-boot.img into the Development Board as the
After rebooting, the system partition becomes writable.

Android 4.4 System How to get root permissions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.