Custom Applications on 2.0

Discussion in 'Jailbreaks and iOS Hacks' started by endoscient, Jul 19, 2008.

  1. endoscient macrumors member

    Jun 3, 2005
    I just jailbreaked my new iPhone 3G, and I have an application I wrote with the iPhone SDK that I would like to get on my iPhone. I am not "enrolled" in the developer program so I can't get it on with official means. I installed SSH and tried copying the compiled .app file to /Applications with no success. It will show the application in SpringBoard but will crash before loading. Any ideas?

    Also the application I made I compiled on my PPC mac, not sure if that will make a difference.
  2. nownot macrumors regular

    Feb 25, 2007
    im in the same boat but i have 3 apps that i have written and would love to get on the iphone for personal use. any info on this would be greatly appreciated.

    p.s. i have jailbroken 3g
  3. The General macrumors 601

    Jul 7, 2006
    You have to pay $99 for Xcode to cross compile them for ARM. Otherwise it just compiles them for the iPhone simulator which I think is Intel or PPC.
  4. endoscient thread starter macrumors member

    Jun 3, 2005
    What about Cylia? Was that compiled with the full version of iPhone SDK? Or what did people do to compile for 1.1 Jailbreak.
  5. The General macrumors 601

    Jul 7, 2006
    Cydia wasn't made with the iPhone SDK. It was made with the unofficial toolchain.

    Not sure what you mean "1.1 jailbreak" ...
  6. endoscient thread starter macrumors member

    Jun 3, 2005
    If I go to Project menu and Set Architecture it has armv6 selected. And Active SDK it is Device selected. So it seems like it is compiling an arm version.
  7. nownot macrumors regular

    Feb 25, 2007
    ok this is where im at
    looking here /Users/**your computer name**/Library/Application Support/iPhone Simulator/User/Applications/
    and comparing to one i got off the iphone via ssh from here / var/mobile/Applications/
    there are 2 things missing. a folder in the .app named SC_Info which contains two files *.sinf and *.supp. from what i read these are the same for all programs so a quick copy and rename got these for my app. here's the problem there is a folder called _CodeSignature that contains a .plist called CodeResources that i have no clue how to create. i believe if we can somehow recreate this along with the generic *.sinf and *.supp we can figure this out and have our own apps on the iphone.
  8. nownot macrumors regular

    Feb 25, 2007
  9. ViRGE macrumors member

    Oct 24, 2003
    You also should read the FAQ that comes with Cydia. It mentions that all applications need to have a SHA1 checksum included, and it tells you how to generate it and attach it to the application. The OS will kill applications without the checksum or if it's mismatched.
  10. locester macrumors newbie

    Jul 20, 2008
    I followed the instructions of the Cydia-FAQ, which states:
    "Question: Whenever I run programs I compile with your toolchain, they are immediatley "Killed".
    Answer:The new iPhoneOs only wants to run signed code. This was mostly fixed by some kernel patches added by PwanageTool, but you still need to at least add a valid CodeDirectory to the binary that contains SHA1 hashes of the executable. This is done using the developer tool ldid.
    $ apt-get install ldid
    $ gcc -o program program.c
    $ ldid -S program
    $ ./program

    But when I try to install ldid apt complains:
    iphone:~ root# apt-get install ldid
    Reading package lists... Done
    Building dependency tree... Done
    The following extra packages will be installed:
    The following NEW packages will be installed:
      ldid odcctools
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 2203kB of archives.
    After unpacking 6017kB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Get:1 tangelo/main odcctools 252-4 [2178kB]
    Get:2 tangelo/main ldid 1.0.363-1 [25.3kB]                                                                                                                  
    Fetched 2203kB in 14s (152kB/s)                                                                                                                                                   
    Selecting previously deselected package odcctools.
    (Reading database ... 1295 files and directories currently installed.)
    Unpacking odcctools (from .../odcctools_252-4_iphoneos-arm.deb) ...
    Selecting previously deselected package ldid.
    Unpacking ldid (from .../ldid_1.0.363-1_iphoneos-arm.deb) ...
    Setting up odcctools (252-4) ...
    Setting up ldid (1.0.363-1) ...
    W: Couldn't stat source package list xena/main Packages (/var/lib/apt/lists/repo.smxy.org_cydia_apt_dists_xena_main_binary-iphoneos-arm_Packages) - stat (2 No such file or directory)
    W: You may want to run apt-get update to correct these problems
    iphone:~ root#
  11. endoscient thread starter macrumors member

    Jun 3, 2005
    Ya, I read that too, and tried to install ldid. I got the same error, but it seems like ldid was installed regardless, though maybe not in full working state. But I tried to do it anyway, but I got this:

    Fang:/Applications/ root# ldid -S MyApp
    codesign_allocate: object: MyApp malformed object (unknown load command 9)
    util/ldid.cpp(431): _assert(0:WEXITSTATUS(status) == 0)

    I also tried copying the Simulator version of the app to /var/private/mobile/Applications where all the other App Store applications are located, and just replace the .app file with iPhoneOS built one. But no luck, when I try to launch I get a popup say "The application cannot be opened".
  12. The General macrumors 601

    Jul 7, 2006
    That's because the iPhone simulator isn't arm.
  13. endoscient thread starter macrumors member

    Jun 3, 2005
    Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.20)

    That is why I said I copied the .app file that was compiled for iPhone OS and only using the directory structure from simulator.
  14. spinstorm macrumors 68000

    Sep 14, 2007
    I would head to for developer talk as that is the best place for complicated issues!

Share This Page