Making SBF file ?

Discussion in 'Android Hacks and Help' started by tujj99, Apr 22, 2010.

  1. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    So far just stock with custom recoveries. I keep the newest Superuser update.zip file on my SD card of all my phones, so getting SU from that point is flashing a single .zip. With a little extra work that .zip could be made even better by having it install busybox, etc. while it's adding su and Superuser.apk.

    BUT, where I want to be is what you just said above. I want to be able to take the code group that populates /system, and add files to it, and then use it when rebuilding the SBF. Honestly I think it will be easy (especially compared to what I just had to figure out), but I just don't have all the Linux file system stuff loaded into my brain yet. Even if I never got to that point it wouldn't kill me (maybe bug me slightly) since as long as I can have my custom recovery flashed in as part of the stock ROM, everything else is a single update.zip away.
  2. jstafford1
    Offline

    jstafford1 DF Super Moderator Rescue Squad

    Joined:
    Nov 15, 2009
    Messages:
    9,074
    Likes Received:
    134
    Trophy Points:
    63
    Location:
    Hebron, Oh.
    Next project......easily flash these from a Mac?
  3. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    I've not seen anybody do a complete ROM as an SBF yet (other than Motorola of course). At this point I have no reason to think it's impossible, but if it's been done, I've not seen it yet.

    According to my research, someone who goes by [mbm] made the SPRecovery_for_ESE81.sbf. I've seen posts to that effect here, and also found a little note by him buried in one of the code groups (which gave me a chuckle). In any event, I'm sure there are any number of people who could have done this if they weren't working on other things. The good news is, however many people there are that know how to do it, there's now 1 more and that helps get things done. :)
  4. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    Thanks! With EasyRoot and ROM Manager, it can't get much easier -- heck, flashing a SBF is probably harder. I think I see these files more as a way to fix things when you break them (with ROM Manager or whatever) and can't get back in. Also for people like me who don't want to use EasyRoot and just want their custom recovery so they can do what they like however they like.
  5. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    Since there is a Linux based utility that can flash SBF's on, I'd think if you had a modern Mac, running whatever it is they run that's a Linux derivative, you could just compile that utility for the Mac and you'd be all set. I don't know a thing about Mac's and don't know anybody who even uses one, so that's about as clever as I can be right off the cuff on that one.
  6. jstafford1
    Offline

    jstafford1 DF Super Moderator Rescue Squad

    Joined:
    Nov 15, 2009
    Messages:
    9,074
    Likes Received:
    134
    Trophy Points:
    63
    Location:
    Hebron, Oh.
    As nice as these are......since rsd only runs on windows our Mac users are left out in the cold. We searched for while to find a way to get it to work to no avail. Maybe someone will be inspired to try now. Lol
  7. Tallica
    Offline

    Tallica Premium Member Rescue Squad Premium Member

    Joined:
    Mar 17, 2010
    Messages:
    3,259
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Middleboro, MA
    Yes, but Easy root and Rom Manager has serious problems. Seems like all the problems I see are directly related to one of those two apps.

    This will be good!
  8. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    I think it is hard to keep the newbies from taking the easy route -- it's too tempting. I'd much rather do it the tried-and-true, reliable way -- even if it takes an extra 3 minutes. Like you said, we can't protect them from themselves, but at least now maybe we'll have a couple extra options before we have to blow away the entire phone to get 'em operational again.
  9. Tanknspank
    Offline

    Tanknspank Beta Team Premium Member

    Joined:
    Jan 13, 2010
    Messages:
    3,506
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    North Carolina
    This alone can explain why people have trouble when booting after flashing spr on Froyo. It comes with the ESE81 kernel. Learn something new everyday.

    And that linux can just use flash_sbf.
  10. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    According to a quick Google search I just did, you can compile Linux apps to run on Mac. Someone with a Mac needs to grab this code and take a whack at it.
  11. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    Thanks for reminding me to say something about this! Once I noticed that there were two code groups in the SPRecovery_for_ESE81.sbf file I set about figuring out what the second one was (obviously the one of primary interest at the outset was the recovery). The way I figured it out was kinda crafty, but it absolutely is the boot image which is the kernel. So, yes, if you flash SPRecovery_for_ESE81.sbf onto a non ESE81 phone, you're going to mess it up. If you flash SPRecovery_for_ESE81.sbf onto an ESE81 phone that has a custom kernel, they'll go back to stock kernel. Although my new packages have just recovery and no kernel, I would still want to use the package built specifically for the SBF that the phone was originally built from. I built an "ESE81 Clockwork recovery only" and a "FRG01B Clockwork recovery only" file, using the same image on both for the recovery part, but using the HMG and RDL files particular to that build (which are different) and as expected, the resulting SBFs are different. I haven't done testing to know if they are different in a way that matters or not. I'm not afraid of hurting my test phone, so I'll try cross-flashing them and see if it matters. Honestly it may be hard to know for sure if it matters because who knows what action would expose whatever problem might be introduced. Since we have the files and the ability to make a special recovery flash for any release that we have an original SBF for, there's not much reason not to unless we completely prove to ourselves that once the kernel is removed from the SBF it just doesn't matter (but I bet it does). :)
    Last edited: Aug 17, 2010
  12. christim
    Offline

    christim DF Super Moderator Rescue Squad

    Joined:
    Jan 23, 2010
    Messages:
    5,112
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    New England
    See if this makes sense. I'm on a stock 2.2 phone and want to root.

    RSD Lite to get sprecovery on, and you get an oddball kernel. As long as you don't boot the phone there should be no issue. You boot into recovery or you boot into the phone (desktop, apps, browser, phone, contacts, etc). If your next step is to put the update.zip onto the root of your card, you can do so from SPRecovery, or if you did it first you also would be ok.

    I think maybe folks are putting on sprecovery then trying to boot up the phone to then mount the phone to get update.zip on their card. They have the wrong kernel for that OS so get stuck and can't mount their phone to get the update.zip onto the phone.

    So the solution is to put update.zip onto the card first, then get sprecovery on the phone and just boot-x into SPR and apply the update.zip file.

    They also could boot into SPRecovery and use the mount option in there to get the file on their card too, without booting the phone os up until after they have flashed a new rom.


    Of course....the real solution is to have multiple sbf files to choose from and to select the right one and/or nicely asking motocache1 for a kernel-free sprecovery sbf file. :)


    I do know there are some folks with mac's on here. Not sure how deep into this they can go. Thanks for the link to get them started MotoCache1

    of course, for the mac owners...

    If such a thing was easy, I'd think someone would have made it already, and for those trying such a thing, I wish you luck and the thanks of our community. ;)
  13. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    For anybody who is keeping score, I figured out how to do this. I haven't had time to actually do it, but unless it turns out that the /system code group is signed or something, making a pre-rooted SBF of an entire release (or even a custom ROM for that matter) should be doable.
  14. jntdroid
    Offline

    jntdroid DF Super Moderator Premium Member

    Joined:
    Nov 18, 2009
    Messages:
    6,437
    Likes Received:
    292
    Trophy Points:
    83
    Location:
    TX
    Did I understand it correctly (I read this thread LATE last night) that flashing our old faithful ese81 sprecovery .sbf file puts an ese81 kernel on the phone? So, hypothetically, I install a FRG01B based ROM through CW/ROM Manager, then flash that sprecovery, don't flash any other kernel, and it could mess things up a bit?
  15. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    I'm pretty tied up at the moment, so my apologies that this reply is so brief, but it is important that everyone is clear about this. The SPRecovery_ESE81.sbf contains the ESE81 kernel in the image. When you flash that SBF to your phone you will be flashing SPRecovery to the recovery partition, and you will also be flashing the ESE81 (Android 2.1) kernel to the boot partition. If "the rest of your phone" isn't on Android 2.1, it wouldn't be surprising if it didn't like that very much. The presence of ESE81 in the name should suggest that the SBF should only be applied to ESE81 phones, but I don't think (prior to now) anybody knew why, thought it was particularly important, or understood what happened if you used it on a phone running another build. Have to run for now.
  16. teddyearp
    Offline

    teddyearp Active Member

    Joined:
    Jan 13, 2010
    Messages:
    1,800
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Randle, WA
    I've got a ton of info to post in this thread, but for now I will have to say and affirm that the SPRecovery_ESE81.sbf file should NEVER, EVER be attempted on any Droid A855 phone unless it is using ESE81/2.1 firmware already.

    And I just gotta say that this is the MOST intelligent thread I have read to date here @ DF and I have a ton more info that I will try to post in the morning in an attempt to dispell all the rumors so far posted.
    Last edited: Aug 19, 2010
  17. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    OK, you've piqued my interest. :)

    Regarding the SPRecovery_ESE81.sbf file, honestly, unless you need to repair your ESE81 kernel, I see no reason for anybody to use it again at this point. As announced in the SBF to root / unroot topic, I've created and released a new SBF file that contains only the recovery partition with SPRecovery in it. You should be able to flash this onto any A855 phone.

    It is linked in the root/unroot OP, but for convenience, here is the link.

    I'm looking forward to the "ton more info" you've got to share. The only thing I fear is that you're going to tell me all the things I just spent the last 30 hours figuring out by brute force observation and reasoning. :) Of course I had a good time and learned a lot, so fire away.
  18. Bob Dammit
    Offline

    Bob Dammit DF Super Moderator

    Joined:
    Dec 11, 2009
    Messages:
    1,715
    Likes Received:
    17
    Trophy Points:
    0
    Location:
    N 42° 05.183 W 079° 10.914
    Moto, Im having troubles with SPRecovery on my phone getting nandroid code #!'s. I posted here: http://www.droidforums.net/forum/hacking-help/72279-nandroid-code-31-a.html

    I was planning on trying to manually flash SPRecovery again, and see if that took care of my problem. If I understand what I have read so far, I can take your SPRecovery only sbf file and flash it to my phone, and leave everything else intact?
  19. teddyearp
    Offline

    teddyearp Active Member

    Joined:
    Jan 13, 2010
    Messages:
    1,800
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Randle, WA
    First off, Gr8 job on your work MotoCache1!. I guess I exagerated, it's not quite a 'ton' of info and not at all technical in nature. I DO hope that there was some testing of your .sbf file before you guys released it into the wild.

    Anyways, Yes Motorola is the ONLY one I know of that can make these .sbf (and .shx, etc.) files, but then with certain tools dedicated hackers can modifiy them as MotoCache1 and mbm have proven.

    Motorola has NOT NOR EVER WILL actually officially release any of these propietary files to the public. That's not to say that there is an employee or two that has leaked them. Yes it gets like a spy novel. The statement that P3Droid knows the most is almost true. He knows the same guy I do that gets these leaks and then removes all traces of the identity of the leaker before forwarding them down the line. This guy has been a giant in hacking Moto phones for years, but prefers not to have much fanfare and quietly hacks away in the background. I know P3Droid has mentioned one of his screen names. He was one of the ones who worked so hard to remove the 'watermarks' on the first .sbf files ever released for the droid at the old alldroid.org site. It was through another mutual bud that I first got pics and learned about the droid last May (i.e. 2009), it used to have a red d-pad and keys with a chrome bezel around the screen. It was also through this group that I was able to aquire an engineering phone, the A4500 "Napoleon" (one of the first [almost] truly unlocked smartphone from the factory); it and the hacking of similar moto 'Q' series phone led VZW to finally go ahead and unlock the internal GPS chip for third party apps, like google maps since it was done for the Nap and only a matter of time for the rest.

    So no, MotoCache1, you didn't waste your time at all, I just wish I had had the time to have been able to help. Now I'm off to read if your efforts were a success . . . .
  20. MotoCache1
    Offline

    MotoCache1 Chief Droid Scientist

    Joined:
    Jun 30, 2010
    Messages:
    530
    Likes Received:
    1
    Trophy Points:
    0
    Yep - I've installed every ESD56, ESE81, and FRG01B "official SBFs" and then followed them with my "recovery only" package and it has worked great. A few Rescue Squad guys beat on it until they were happy as well. Unfortunately there's only so many scenarios you can throw at it, so there are bound to be wrinkles to work out once a broader audience starts playing with it. We had a couple guys in the root/unroot thread that tried to put it on. At first it wasn't going on, and then it did, but then it spontaneously went away on them. The "not going on" part I think may just be their workstation setup (one is Vista 64 bit, don't know what the other is). The spontaneously reverting back to stock recovery is intriguing. I have some ideas about that that I'm investigating. One of the guys mentioned his bootloader version and it's newer than what's on either of my phones. I have read about certain phones having a copy of the recovery image stored elsewhere on the phone, and each time you boot the recovery image is rewritten. I'm wondering if their newer software has this feature. That could be interesting. In any event, working around that should be no trouble -- I just want to get a better idea about it first (and replicate it if I can). Fortunately the OTA updates can just be unzipped and you can read through the update from start to finish and see what all it is doing. That helps. :)

    Actually I am now able to make an sbf (and the smg files it contains) from scratch. Apparently shx files are another type of sbf-like file and the Droid doesn't use them. The SMG files really aren't that bad once you understand what they are. Catch is they aren't all the same thing.

    [Edit: On re-reading, my comment immediately above, it is misleading. I can't start with nothing and make an SBF out of thin air. I have to know what the SBF looks like for the target phone, what files should contain what, etc. The files that contain file systems and boot images and such can be remade from scratch. The files that contain things like RAM Downloaders and such have to be whatever the manufacturer made for that device. Even though you really are rebuilding the SBF from scratch (as opposed to just hex dumping blocks into the existing SBF) in some ways you're still just modifying the original -- replacing parts with new parts, and removing parts you don't need to update.]

    Thank goodness for the folks who leak stuff to us. Eventually all of these device manufacturers are going to require everything to be signed using strong encryption. At that point, unless someone leaks the encryption keys, we're in big trouble. We're already seeing a taste of that with the latest Moto Droids.
    Last edited: Aug 20, 2010
Search tags for this page

create sbf file

,
droid a855 .sbf file
,
how to create a file from my files on droid
,

how to create a sbf file

,

how to create an sbf file

,

how to make a sbf file

,

how to make sbf file

,

make sbf file

,
sbf smg
,
sbf-recalc
,
who makes sbf 245125126
,
xt908 sbf