Cydget development in Objective-C

Discussion in 'iOS Development' started by mccannmarc, Dec 30, 2009.

  1. mccannmarc

    mccannmarc New Member

    Joined:
    Dec 30, 2009
    Messages:
    4
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Hey all,

    Just wondering if any of you could give me some pointers.

    I have a couple of applications on the AppStore that would be perfectly suited for porting to a Cydget.

    Does anyone have any info on how to develop a standalone cydget with Obj-C? According to the Cydget description they can be written natively but there is no info anywhere. All of the info I can find is referring to how to do it with HTML or Cycript and I don't particularly want to use either of these if I'm honest.

    Thanks in anticipation
  2. hyernado

    hyernado New Member

    Joined:
    Apr 13, 2009
    Messages:
    127
    Likes Received:
    0
    Device:
    2G iPod touch
    Yep, it's possible, but it takes a lot of work. Like...
    - Getting Xcode to code-sign bypass (not really that hard)
    - Getting your SpringBoard headers to work in Xcode (to get them via class-dump is easy, but patching them.. good luck)
    - By this time you rock and are much better than me, I'm still stuck at patching 3.1 SB headers

    I would look at cydget's source at http://svn.saurik.com/repos/menes/trunk/cydget/. Anyways, after finally being able to compile your cydget, place the .app in /System/Library/SpringBoardPlugins/, rename to *.bundle from *.app, and discard the rest of the contents of the .bundle besides Info.plist and your executable. Also edit your Info.plist, edit out the app flags like NSMainNibFile and whatever. Now to make this an actual cydget, you make a new cydget directory in /System/Library/LockCydgets, and the Info.plist should look like this:
    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPEplistPUBLIC"-//Apple//DTDPLIST1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plistversion="1.0">
    <dict>
    <key>Name</key>
    <string>Name of your cydget</string>
    <key>Plugin</key>
    <string>Name Of Your .bundle (don't include the .bundle suffix)</string>
    </dict>
    </plist>
    
    there you go, hope this clarifies it for you at least slightly. An example of a Cydget made like this is CyDialer by saurik, BTW. Also, above iptf removed some of the spaces in the header of the Info.plist file, which will result in an XML
    parsing error. So you'll have to edit yourself.

    Typed on my iPod.
  3. mccannmarc

    mccannmarc New Member

    Joined:
    Dec 30, 2009
    Messages:
    4
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Thanks! I have everything up and running for jailbreak development in xcode using some templates i found on this forum.

    I will have a go at porting my app(s) while I have some spare time

    Please Register or Log in to view images

  4. hyernado

    hyernado New Member

    Joined:
    Apr 13, 2009
    Messages:
    127
    Likes Received:
    0
    Device:
    2G iPod touch
    You do know that you will need to actually build it from the ground up, you cant use an actual .app made for launch in springboard, right? What i would try, is tweaking the cydget source slightly, and somehow changing the cydget switch from the home button to a three-finger gesture or something, and actually running cydget inside cydget. If you could get that to work then that would be an excellent starting point.
  5. mccannmarc

    mccannmarc New Member

    Joined:
    Dec 30, 2009
    Messages:
    4
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Yeah I'm aware I won't be able to port my app straight off, I'm not new to writing jailbreak apps/mobile substrates etc I just didn't have a clue how one is supposed to create a cydget natively with obj-c

    Please Register or Log in to view images

    Your advice has given me a good place to start though, maybe I should stop saying I will port my application and say I will completely rewrite it for use as a cydget

    Please Register or Log in to view images



    BTW did you get your SpringBoard headers patched? I can send you mine if you like but most of them still have the includes for "ABC_Blah blah.h". What I tend to do is when it moans during compilation just delete the #import then. Its pretty pointless going through all the headers and deleting it at 1st because its unlikely you will use the majority of them in an application anyway so you will be wasting your time.
  6. hyernado

    hyernado New Member

    Joined:
    Apr 13, 2009
    Messages:
    127
    Likes Received:
    0
    Device:
    2G iPod touch

Share This Page