Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,736,594 Members 53,881 Now Online
XDA Developers Android and Mobile Development Forum

[PATCH] Working Superuser/su for newer Sense ROMs

Tip us?
 
rmk40
Old
(Last edited by rmk40; 22nd March 2011 at 10:58 PM.)
#1  
rmk40's Avatar
Recognized Developer - OP
Thanks Meter 4590
Posts: 1,358
Join Date: Jun 2010

 
DONATE TO ME
Default [PATCH] Working Superuser/su for newer Sense ROMs

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.

The Following 29 Users Say Thank You to rmk40 For This Useful Post: [ Click to Expand ]
 
chchia
Old
#2  
Senior Member
Thanks Meter 5
Posts: 153
Join Date: Nov 2007
Location: Kuala Lumpur
great work rmk! but i still prefer to stick with your virtuous.
 
tbalden
Old
#3  
tbalden's Avatar
Recognized Developer
Thanks Meter 6369
Posts: 3,892
Join Date: Oct 2010

 
DONATE TO ME
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 )
 
rmk40
Old
#4  
rmk40's Avatar
Recognized Developer - OP
Thanks Meter 4590
Posts: 1,358
Join Date: 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: [ Click to Expand ]
 
~~Tito~~
Old
#5  
~~Tito~~'s Avatar
Retired Forum Moderator
Thanks Meter 80
Posts: 2,959
Join Date: Jun 2007
Location: Las Vegas
Nice! Is ChainsDD going to be changing Journal Mode himself?
My Device(s):
Phone: T-Mobile HTC One HBOOT Status: S-Off ROM: InsertCoin Accesories: Bear Motion Premium Slim Back Cover

This phone is amazing. Bravo HTC, bravo .

My Twitter My Google+
 
afrcom15
Old
#6  
afrcom15's Avatar
Senior Member
Thanks Meter 24
Posts: 370
Join Date: Sep 2010
Location: Cornwall
thanks for this, confirmed working on DHD.
Sent from the edge of the universe over 6 billion years ago
 
Dacoco
Old
#7  
Senior Member
Thanks Meter 10
Posts: 342
Join Date: 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!
 
steviewevie
Old
#8  
steviewevie's Avatar
Retired Forum Moderator
Thanks Meter 615
Posts: 5,319
Join Date: Oct 2009
Location: UK
Quote:
Originally Posted by Dacoco View Post
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).
 
MacaronyMax
Old
#9  
MacaronyMax's Avatar
Senior Member
Thanks Meter 626
Posts: 13,579
Join Date: Aug 2008
Location: Oxford
Soo.... Us stock 1.72 people can root??


Gli Sviluppatori
 
steviewevie
Old
#10  
steviewevie's Avatar
Retired Forum Moderator
Thanks Meter 615
Posts: 5,319
Join Date: Oct 2009
Location: UK
Quote:
Originally Posted by MacaronyMax View Post
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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes