Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[PATCH] Working Superuser/su for newer Sense ROMs

OP rmk40

25th December 2010, 10:20 AM   |  #1  
rmk40's Avatar
OP Recognized Developer
Thanks Meter: 4,592
 
1,358 posts
Join Date:Joined: Jun 2010
Donate to Me
Anyone following the RUU threads already knows about this and it's starting to get more attention now. The latest official build of Superuser does not work with newer Sense ROMs (such as Vision 1.72+, anything released recently). HTC has started utilizing a relatively new feature of sqlite; a journaling mode called WAL (write-ahead logging). It's actually smart. WAL journaling should improve sqlite throughput, which represents a large amount of Android's IO and benefits applications across the board. The downside is it broke Superuser because it's actually special in its' use of sqlite.

WAL journaling, as built with these new Sense ROMs, is using exclusive locking. Why is this important for Superuser? It's the one situation where you have an application running within Android's process space and one outside of it, both accessing the same sqlite database. When su runs, it opens the sqlite database to check whether you have allowed access for said command to run. If not, a call is made to the Android application, which fires up and prompts you for an answer. Problem is, su has the database open with an exclusive lock (i.e. nothing else can touch it), so Superuser (the Android app) fails to open the database and cannot run. It'll either force close or do nothing.

To fix this, I have modified Superuser and su. Both changes have been submitted to ChainsDD for review. You can look at his git repository's pull requests to see the changes I'm proposing. I'm basically changing the journal mode being used by su one that is non-exclusive and Superuser to close its' database when sitting idle. I couldn't change Superuser's journal mode no matter what I did; it seems to be set deeper in the stack than I can access.

Here are the links to my pull requests on Github if you want to review the code:

https://github.com/ChainsDD/android_...eruser/pull/14
https://github.com/ChainsDD/android_..._extras/pull/1

Anyway, the end result is I have a working Superuser. Here are the caveats:
  • This is not an official build, so it's signed with my key, not ChainsDD. He has merged my patches into his Github repository so they should be making their way into a release soon.

  • I've artificially incremented the version number to 9.9.9, to make sure if you install my version, it'll "win" over any other installed version. Also, this prevents the Market from nagging you for updates.

  • I don't recommend using this version unless you must. In other words, you are on one of the Sense ROMs which is broken. Use an official build otherwise.

  • If you ran the RUU and have trashed your custom recovery (Clockwork), this isn't going to help you root the device again. Superuser is a tool for managing root access, not obtaining it.

If you are running Virtuous, you DO NOT need this.

Last edited by rmk40; 22nd March 2011 at 11:58 PM.
The Following 29 Users Say Thank You to rmk40 For This Useful Post: [ View ]
25th December 2010, 05:50 PM   |  #2  
Senior Member
Flag Kuala Lumpur
Thanks Meter: 5
 
154 posts
Join Date:Joined: Nov 2007
More
great work rmk! but i still prefer to stick with your virtuous.
25th December 2010, 10:53 PM   |  #3  
tbalden's Avatar
Recognized Developer
Thanks Meter: 6,437
 
3,912 posts
Join Date:Joined: Oct 2010
Donate to Me
More
I'm trying to work around the no root available for 1.72 problem with my stock HTC Z rom updated to 1.72 OTA, but with Rage method temp-root I'm stuck with a frozen terminal after the 'Force Close' step, starting the terminal the 3rd time in the process. I've replaced the gfree_temp_root package's su file with the one provided here, used the APK provided here (pre-installed the apk too before the attempt). It's unfortunately stuck with a frozen black terminal window. Probably the Rage thingy doesn't work with the new 1.72 update, or am I using these files correctly at all?

(guide http://forum.xda-developers.com/wiki...ermaroot.22.29 )
26th December 2010, 02:21 AM   |  #4  
rmk40's Avatar
OP Recognized Developer
Thanks Meter: 4,592
 
1,358 posts
Join Date:Joined: Jun 2010
Donate to Me
ChainsDD merged my patches into his repositories today so they should make it into an official release soon.
The Following 2 Users Say Thank You to rmk40 For This Useful Post: [ View ]
26th December 2010, 04:33 AM   |  #5  
~~Tito~~'s Avatar
Retired Forum Moderator
Flag Las Vegas
Thanks Meter: 80
 
2,959 posts
Join Date:Joined: Jun 2007
More
Question
Nice! Is ChainsDD going to be changing Journal Mode himself?
26th December 2010, 09:02 AM   |  #6  
afrcom15's Avatar
Senior Member
Flag Cornwall
Thanks Meter: 24
 
370 posts
Join Date:Joined: Sep 2010
More
thanks for this, confirmed working on DHD.
26th December 2010, 12:44 PM   |  #7  
Senior Member
Thanks Meter: 10
 
359 posts
Join Date:Joined: Dec 2010
Just for a correct understanding:

I need to have root like described here to use SU right?

Or is it now possible to get the new Update via OTA and get root with this method and its a solution for rooting 1.72?

Thanks!
26th December 2010, 01:10 PM   |  #8  
steviewevie's Avatar
Retired Forum Moderator
Flag UK
Thanks Meter: 615
 
5,320 posts
Join Date:Joined: Oct 2009
More
Quote:
Originally Posted by Dacoco

Just for a correct understanding:

I need to have root like described here to use SU right?

That's a DHD thread and this is the DZ/G2 forum. So you're either in the wrong forum, or looking at the wrong procedure (which could brick your phone).
26th December 2010, 01:11 PM   |  #9  
MacaronyMax's Avatar
Senior Member
Flag Oxford
Thanks Meter: 626
 
13,593 posts
Join Date:Joined: Aug 2008
More
Soo.... Us stock 1.72 people can root??
26th December 2010, 01:12 PM   |  #10  
steviewevie's Avatar
Retired Forum Moderator
Flag UK
Thanks Meter: 615
 
5,320 posts
Join Date:Joined: Oct 2009
More
Quote:
Originally Posted by MacaronyMax

Soo.... Us stock 1.72 people can root??

There has been more than one report that rage doesn't work either, on the 1.72 ROMs.

Also, there's the issue of S-OFF that needs addressing, whether that can be re-done at 1.72.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes