[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:
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.