New Superuser 2.3 - SPRecovery compatible package

Discussion in 'Android Hacks and Help' started by MotoCache1, Aug 11, 2010.

  1. MotoCache1

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    New Superuser 2.3.1 - SPRecovery compatible package

    Update: On 8/28 the developer of Superuser.apk modified his package to be compatible with SPRecovery in his 2.3.5 release. As of that release my repackaging of his app is no longer necessary. Nonetheless this topic may be of interest for technical or troubleshooting value. The attachments will remain below, but unless you have trouble with it, you should use the original developer's package which can be found in the OP of his topic on XDA.

    On 8/10 ChainsDD on XDA-Developers.com released a new, completely revamped version of su (Superuser) -- version 2.3. In the updated OP of his topic (which has been running since May of this year and is just updated with each subsequent version) he has a link to a zip file for Eclair/ForYo and anothe rlink for the zip for Cupcake/Donut.

    Unfortunately the zip he provides (for Eclair/FroYo) will not install under SPRecovery. As I lamented in another thread, when attempting to install the zip it simply does this:

    Code:
    -- Install from sdcard...
    Finding update package...
    Opening update package...
    Verifying update package...
    Installing update...
    [B]Installation aborted.[/B]
    Apparently many/most of the Superuser installer zips out there won't install with SPRecovery, but will install just fine with Clockwork Recovery. There have been numerous pages of posts on the XDA-Developers topic since the new version was posted and a large number of them have been people either having trouble with FC errors after installing, failure to install, and in some cases loss of their su after installing. I don't fault the developer for that -- with so many platforms out there, making a .zip that will install cleanly on all of them would be nearly impossible. Fortunately I don't have to worry about every phone in the world, so making a reliable, working package for SPRecovery is a little easier.

    In any event, at the outset of this I knew just about nothing about how SPRecovery zip files were built and certainly had never done it before. That's all changed now. :)

    I have created a new SPRecovery compatible package using the files from the original distribution. The only thing I've done is repackage them in a way that will make SPRecovery happy (which involved rewriting the update script and then packaging and signing the package). I also employed a little art to ensure that the package does what the developer intended even if the target phone might be a little atypical. I have tested my package successfully using SPRecovery 0.99.3b and using Clockwork Recovery 2.5.0.1 (sholes). The original developer's package is also available under "Extras".

    My package installs with no errors or issues on my Droid 1 running FRG22 and SPRecovery. My su has been 100% solid (no FC's, etc.). While the new features are great (see the developer's topic linked at the top) the main reason I wanted this was to fix a bug in the 2.2.x su versions that caused them to not deal well with apps that need su during boot (like SetCPU does if you use the "Set at Boot" option). This has definitely fixed that.

    The reason SPRecovery can't run the developer's original package has nothing to do with a mounting issue (as I originally suspected but have now disproved). The issue is that SPRecovery appears to be written to only load packages that include an update-binary and updater-script (the way my package is built) and will not load packages that contain only update-script and no binary (the way the developer's package is built).

    I'm working with the developer to see if he can modify his package the same way I have (and still have it work for all of the other phones in the world that need to run it). If that works out, then this separate build for SPRecovery wouldn't be needed any longer.

    For anybody who's interested, feel free to check out the contents of the zip and compare them to the original distribution. The only files that didn't come from the original distribution are:

    update-binary: This is the updater binary that you find in just about every package now (including OEM ones) and is the exact same file used in the P3Droid/ChevyNo1/etc. packages. If you want to learn more about it, Koush has the source for it here.

    updater-script: This is the installer script that I wrote to replace the update-script file in the original distribution. If you look at the steps you'll see that it does the same thing, in the same order. The only additions are that it explicitly mounts /system (which the original doesn't which is why it fails) and the way the binary method implements "run_program" requires you to extract the file/script you're going to run (fixsuperm) to /tmp before running it. The one deviation I did make was in the permissions on the su file. The original developer applied 4755 to su, but my existing su was 6755 and every other su package I've looked at uses 6755, so I used 6755. He has since updated his package to do 6755 as well after I pointed this out.

    A few notes to try to avoid some of the easy to anticipate questions:


    1. If you've not installed a 2.2.x su package from this developer on your phone previously, your su whitelist will be erased and you will have to re-authorize any apps that need su. This will happen in any of the packages that say "includes fixsuperm". This is a good idea in case there is any data there that would confuse the new Superuser.apk. Installing a package that does not have fixsuperm shouldn't reset the whitelist. If you install a package that doesn't have fixsuperm and you get FC errors trying to view the log, etc., then either load a package with fixsuperm, or clear the data for Superuser yourself via application management.
    2. The developer notes: "Apps may still crash if they try to get permissions on boot that have not been granted yet. Once an app is in the whitelist, it should have no trouble at all getting permissions on boot." For this reason I made sure my "Set on Boot" option in SetCPU was unchecked before installing so when the phone booted up with an empty whitelist SetCPU wouldn't try to get su permissons. After booting from the update I turned "Set on Boot" back on and now SetCPU starts up clean (it didn't with the old su).
    3. You can use this file to do a bare minimum root of an unrooted phone as long as your phone has a custom recovery on it (not the stock recovery). When I say "bare minimum" I mean you won't have busybox, etc., and you'd have to install that manually. But you'd have su. I've done this on my dev phone starting from unrooted and it works fine.
    4. I don't know what is different between the Eclair/FroYo package and the Cupcake/Donut package. I didn't even look at the Cupcake/Donut package because it is of no use to me.
    5. Yes, the icon is a little pirate android guy now instead of a ninja. The icon is built into the file by the original developer -- I didn't do it and I have no idea how to change it. I actually like it better than the ninja anyway.
    6. There are tons of new features -- most of them very useful. Check out the developer's topic on XDA-Developers for details, screen shots, etc.
    7. If you're running a custom ROM, chances are the ROM builder will be including this version in their next release of the ROM. If you're not having any problems with su, you might as well skip this unless: a) any of the new features are particularly appealing to you, b) you just have to have something your buddy doesn't have yet. I have tested this package on ESE81 and FRG22. I can't see a reason why the various custom ROMs would have any trouble. As long as the ROM doesn't do anything crazy with where it puts su and Superuser.apk it should be fine. The package with the latest version (2.3.2.3) is the best with regard to how well it tries to clean up prior su and Superuser.apk and put in the new and grant correct permissions. The earlier packages weren't as robust.

    How to install using SPRecovery:
    (same as any update.zip - but here's pretty detailed instructions in case you need 'em)

    1. Download the file to your computer
    2. Connect your phone to your computer via USB
    3. Do "turn on USB storage" on your phone to mount your phone's file system to the computer
    4. Copy the zip file to the root of your SD card
    5. If the file shows a name of "Superuser-2.3.2.3-ef-signed-MotoCache1" (no .zip on the end) then rename it to just "update". If the file shows a name of "Superuser-2.3.2.3-ef-signed-MotoCache1.zip" (.zip on the end) then rename it to "update.zip".
    6. Properly eject your phone from your computer and do "turn off USB storage" on the phone to dismount the file system from your computer
    7. Power down your phone
    8. Hold the X key (on the physical keyboard) while powering up your phone. Keep the X key held until SPRecovery (or whatever your recovery is) comes up.
    9. Do a Nandroid backup. Make sure you backup at least SYSTEM and DATA. A "simple Nandroid backup" will back these up, but you can also do an Advanced and specifically select them, or (best idea?) just do a full Nandroid backup to be safe. The package only replaces your su and Superuser.apk files which are in SYSTEM, but the "fix su permissions" script (which was written by the original developer and which I haven't attempted to completely digest) modifies /data/system/packages.xml and removes /data/data/com.noshufou.android.su as cleanup of possible older version information.
    10. After your backup finishes, get back to the beginning menu of SPRecovery and choose "install"
    11. Choose "Allow update.zip installation" [nothing seems to happen when you click the camera button to run this choice, but it enables you to do the next step without getting an error saying update.zip is not allowed.
    12. Choose "Install /sdcard/update.zip (deprecated)"
    The update will be over and done with quite quickly. Then you can just go back to the beginning menu and choose "reboot system now" and you're done.

    As with any change to a restricted area of the phone there is a chance for mistakes, etc. Best advice is to be sure you're starting with a well-charged battery, do your Nandroid backup first, and if you run into any trouble there are about a bazillion topics here (and helpful, experienced members) that should be able to deal with most anything you'd run into.

    Sorry this was so long folks. That's just how I am.


    Superuser-2.3.2.3-ef-signed-MotoCache1.zip
    md5: 42aafa7c576490cf5c16ed6ceabaa4c9
    -- Eclair/FroYo, contains fixsuperm


    Enjoy!



    Prior versions in the unlikely event they are needed:

    [OLD VERSIONS below - use newest version above]

    Superuser-2.3.1-ef-signed-MotoCache1.zip
    md5: d13311505e59a24f894cca1d5f984e0b
    -- Eclair/FroYo, does not contain fixsuperm

    Superuser-2.3-ef-signed-MotoCache1.zip
    md5: 39eb898cc16a3b7635b2b41945d59bba
    -- Eclair/FroYo, contains fixsuperm
     
    Last edited: Aug 30, 2010
  2. Tallica

    Tallica Premium Member Rescue Squad Premium Member

    Joined:
    Mar 17, 2010
    Messages:
    3,259
    Likes Received:
    1
    Trophy Points:
    101
    Location:
    Middleboro, MA
    Ratings:
    +1
    Good job MotoCache, and a great explanation of what you did.

    Will be checking this out soon.
     
  3. Dan A

    Dan A New Member

    Joined:
    May 24, 2010
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Thanks! Works great. I tried the file from XDA forums and it failed. Appreciate the work to repackage this.
     
  4. MotoCache1

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    You're welcome. I wonder if it would be a good idea for folks to post what OS, ROM, etc. they are running so we end up with a list of ones that are known to work with no trouble? Hopefully none have issues with my package. I seem to remember seeing someone on XDA that tried running it on "CM nightly" and it had trouble but it was fixed in the next nightly build or something. Of course he was running the zip from XDA and it might not have gone in as cleanly.
     
  5. Dan A

    Dan A New Member

    Joined:
    May 24, 2010
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    I'm running Sapphire 1.0 here. I really like the new UI for this version of the app. The old version was somewhat confusing. Logs are nice too. And the new icon is fitting, IMHO.
     
  6. Black_diamond

    Black_diamond Member

    Joined:
    Jul 26, 2010
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    The first state
    Ratings:
    +0
    Im running BB v.04 and 1.1 Chevy ULV kurnel and Froyo 2.2, i like the new upgrade, the icon is better IMO and overall a better program i thought it was a little buggy at first, i was downlaoding all my apps again and it rebooted 2 times, but its up and running fine i have been running it for about 1 hour..

    -NICK
     
  7. MotoCache1

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    I'm also running Chevy's ULV kernel (1.2 but I don't usually keep it set that high), but on plain FRG22 FroYo. You said you were "downloading all your apps again"... I assume that was for something unrelated to the install? Or do you mean you were re-authorizing your root apps?
     
  8. Black_diamond

    Black_diamond Member

    Joined:
    Jul 26, 2010
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    The first state
    Ratings:
    +0
    I installed it through Rom-manager (lazy way), i downloaded it then put it on my SD card and did a back-up and then did a complete wipe of data and cache. Almost like installing a new rom..
     
  9. MotoCache1

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    Yikes. The backup was a good plan, but definitely no need to wipe data and cache (or anything else) for this (unless you just wanted to do a little house cleaning anyway :)).
     
  10. Black_diamond

    Black_diamond Member

    Joined:
    Jul 26, 2010
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    The first state
    Ratings:
    +0
    Yeah i figured it was good to start fresh.
     
  11. MotoCache1

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    Looks like the developer (over on XDA) is busily making fixes and changes to the app. He's got a new v.2.3.1 posted up now. I'm going to grab it and update my package as well. After that I'll probably let things settle for a day or so and then see if he's made more changes or not. The code was just released 1 day ago, so I should have expected that there would be a flurry of bug reports and fixes. As he updates version numbers I'll grab the new one and make a new package. I'll keep them all posted in the OP.

    Edited to add: I've got 2.3.1 repackaged but I'm waiting on one piece of information from the developer before I post it. In his package he got rid of the fixsuperm file. It was causing trouble on "Galaxy S" phones. Judging from the error messages some people were posting, some phones had trouble executing the script directly from inside the package without extracting it first (which is what his package does). My package extracts fixsuperm to /tmp first so there's no real issue there. Nonetheless, if he says it's 100% not needed, then I'll get rid of it in my package too.
     
    Last edited: Aug 11, 2010
  12. huskerkate

    huskerkate Premium Member Premium Member

    Joined:
    Apr 30, 2010
    Messages:
    2,650
    Likes Received:
    10
    Trophy Points:
    103
    Location:
    Phoenix, AZ
    Ratings:
    +10
    i took the simpleton way, and got it thru RM. no problems, thankfully. but, it's nice to know that there's a way to do it the "right way" if any bugs pop up - thanks!!!
     
  13. MotoCache1

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    Simple is good. I think the only people who are likely to need this are those who are running SPRecovery. If you're running ROM Manager / Clockwork Recovery, I think it always starts with your /system partition mounted so there's no trouble.
     
  14. MotoCache1

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    Developer said there was no need for the script so I went ahead and ditched it. I've also updated the Superuser.apk file to the newest version in his 2.3.1 release. The su file didn't change. The link for my package of 2.3.1 has been added to the OP.

    I wasn't having any trouble at all with the 2.3 Superuser.apk, but if he's going to release an updated one, obviously it fixes a problem that someone, somewhere was having, so it would be silly not to update.
     
  15. nateccnn

    nateccnn Member

    Joined:
    Feb 26, 2010
    Messages:
    849
    Likes Received:
    2
    Trophy Points:
    18
    Ratings:
    +2
    I just installed 2.3.1 SU. My phone is running the FRG01B flavor with no custom rom. I used the BIG file to update my phone.

    I did not change the settings in SetCPU (allow to load on boot). I booted up after the update and it granted SU permission to SetCPU. So not sure why the developer feels we might have trouble on boot. All my apps I had granted permissions to before the update were properly listed in the updated SU app.

    Seemed like a nice clean install. Weird?

    Nate
     
Search tags for this page
2.3superuser v.
,
android su update zip
,
old version of superuser
,
su-2.3.6.1 .apk
,

superuser 2.3.1

,
superuser apk old version
,
superuser old version
,
superuser older versions
,
superuser package
,
update.zip superuser.apk