Friday, September 30, 2011

Rooteando Android.

This post reads about: Android Root, Superuser, Superuser update failed, Rooting problems, No root privileges granted, no root permissions, sudo, su, sh, bin, SuperOneClick, AceGingerRoot, failed root installation, Android 2.3.4 Gingerbread, Samsung Galaxy Ace, Rooted Android.

Hello there,

This post is for you all that are having problems after rooting an Android device, specifically talking about version 2.3.4 on a Samsung Galaxy Ace.

As you may already know, there is no known way of rooting an Android device with a version >= 2.3 using the classic root utilities (like SuperOneClick). To root the device, you need to boot it in recovery mode and apply an update using the "" file. This file contains the necessary binaries to use the device as root (SU, Busybox, SH, SQLite3 and Superuser.apk). If you want more information on this process, visit this link.

After I rooted my phone, everything went OK and I applied Juwe's RAM Script for memory optimization. No problem there. I removed some stock apps that I never use to free up a little bit of internal storage, again, no problem there.

I opened the Superuser app just for being curious. It said that a newer version of the SU binary was available and that I could use the auto-update feature. Just after hitting "update" a toast poped up: "Automatic Update Failed"," An error occured and su was not updated. A zip file( has been placed on your sdcard, Please reboot into recovery mode and flash it to update your su binary". I went to check that file and it was a 0 bytes file... I guessed it wouldnt be a problem since the update was not applied and it was working well. Suddenly when I was using my favorite file manager (File Expert) to move some other files, it didn't have root permissions.

I won't make a bible of this story. I looked for an answer and used Android ADB for about 6 hours until I found the answer, so if you are stuck in the same problem I was, here it is.

For a strange reason, the SU binary located in the /system/bin folder was the "locked" binary, so when an app was asking for root privileges it was asking for them to the /system/bin/su file (since that folder goes before the /system/xbin folder in the PATH variable. The "unlocked" version of SU is installed in /system/xbin). What I had to do to get my root working again (and undo everything I did so I could get my guarranty back) was to temporarily rename the /system/bin/su to /system/bin/su-old so that when an app was trying to query for root privileges, the system would not find the /system/bin/su file, thus running the /system/xbin/su modified file.

You can do that by typing "/system/xbin/su" via an ADB console. You phone will need to have the screen on and unlocked. A popup will appear asking you to grant Root privileges to the ADB client. Of course, you need to have the root binaries from the installed.

After doing that, I was able once again to gain root privileges for my apps. Immediatly after that I changed the su-old name back to "su", rebooted and used the "" update to remove the root modded files.

  • Reinstall "" as usual (check link above)
  • Install Android's SDK and tools so you can get ADB
  • Boot your phone in normal mode
  • Fire up an ADB console window in your computer
  • Mount your filesystem as Read/Write with the following command: mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
  • Type in "mv /system/bin/sh /system/bin/sh-old"
  • Run any root app you need to run on your phone. May be you will be asked once again to give that app enough privileges.
  • Do what you need to do as root
  • Once done, close any root app
  • Back to ADB, type "mv /system/bin/sh-old /system/bin/sh" (may be you will need to remount as read/write)
  • Close ADB, Reboot your phone in recovery mode, and run the "" file.

Hope this helps you if you find yourself stuck in this problems.

Cheers! =)

No comments:

Post a Comment