To get a privileged shell you need to modify the following lines to the given values in the default.prop file ro.secure=0



I have the extracted the recovery image of my phone model : So is it possible to modify the following values in the default.prop file, repack the image and flash it using fastboot(bootloader is unlocked) to get a privileged shell, and then copy the su binary after remounting system as read/write?

Do I need to change any other values in any of the files? And will it work, theoretically at least?

  • Before you reinvent the wheel, did you check xda-developers for an official root method for your device?
    – Mihic
    Commented Sep 2, 2012 at 15:05
  • 2
    Yes I have, there are no "official" methods and I wanted to do it by myself for once, its a re-branded Chinese device, so not much support there,
    – Kedar
    Commented Sep 2, 2012 at 15:11
  • Which device do you want to root?
    – Flow
    Commented Sep 14, 2012 at 10:54
  • @Flow Karbonn A9/K-Touch W680. Update: The above approach did not work, either because the image wasn't stock recovery in the first place or it isn't that easy. Phone is rooted now.
    – Kedar
    Commented Sep 14, 2012 at 14:08
  • default.prop is located in ramdisk, which is "reset" every boot
    – trogper
    Commented Sep 21, 2013 at 19:12

2 Answers 2


This approach will work (provided there are no proprietary funny locks in place anywhere), but the recovery partition is no party to it from the very beginning. The default.prop is overwritten on bootup, copied from the boot partition, which is not a directly accessible file system. You need an image of the boot partition, which you will then unpack, make the change, and repack.

Assuming you know how to go about doing all that (since you say you tried it with the recovery), I must warn ahead that often times it is necessary to include the base address when making the image with mkbootimg. There is no way to know when it is required, so it is safe to always include a base address. You can follow a tutorial here:


The script includes the od command with which you can get the base address, in case you want to make your own script. For more on the manual steps (for reproducing on GNU/Linux):


I do not recommend use of the unpack/repack scripts, as they have hardcoded lines not portable across cases. Use split_bootimg.pl, then gunzip and cpio extract it, after which you will again use cpio and gzip it, followed by the mkbootimg command. The only exception is for MTK65xx devices, where you will need the relevant unpack/repack tools (because they have very different offsets; you will also skip the mkbootimg as the repack script does it for you):


And here is an on-going example of a Chinese rebranded phone going through the same thing to finally get root:


I'm sorry I have to strip off proper links, but I am apparently considered potential spam. Also, I've not been rather thorough because I'm not really sure you'd want more verbosity.

  • Can you link to or explain how to extract the recovery.img or boot.img from the phone (without already having root)? Thanks!
    – user29020
    Commented Jan 23, 2015 at 2:19

The above approach did not seem to work.

Either because the stock recovery put up wasn't meant for the device or the method isn't this easy and may involve making other changes. The phone wouldn't go into recovery mode, which is the only mode in which you would get a privileged shell to perform the necessary operations to obtain permanent root.

Another method would be to modify the build.prop in the boot image itself, repack and then flash it and adb to get a privileged shell in normal operating mode.

Better to follow someone else's procedure when you're not too sure about your own.

  • 1
    This is not working because the shipped ADB version is not supporting root. (I looked up the make file and the ADB source, I know what I am talking about)
    – Orri
    Commented Nov 6, 2015 at 8:23
  • 1
    @Orri Though this may be years later, I'm pretty sure Chainfire's insecure ADBD app was around when the answer was posted.
    – Math1000
    Commented May 25, 2020 at 15:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .