PDA

View Full Version : [iPhone SDK] Problems running built apps on pwned 2.0 Beta


sleeepy
04-07-2008, 02:49 PM
This crosses turf between pwn and SDK and there are various comments in various places but no clear home. Perhaps this can become a general hook for initial problems in this area.

Being one of Apples dispossessed ("don't call us, we'll call you"), I need a way to run official SDK built apps on the iPhone. There are reports in various places that this works but very terse comment.

The following instructions attributed to cosmoLV

"1. Restore to 1.1.4
2. PWNED - see PWNED Help
3. Restore custom 1.1.4 with iTunes
4. PWNED -> Make Custom 2.0
5. restore custom 2.0 with iTunes"

Its unclear to me why step 3. is required since step 5. would seem to blow it away - but anyway.

If I follow these instructions, and then build an app for the release device using the current (recent) official SDK and sshed the built .app directory across to the /Applications of the pwned 2.0 (1.2) phone and then restart, the apps appear in the Springboard. In an unpwned 2.0 (1.2) they do not even appear.

When I try and start the apps they do start but shutdown again within a second. This is time enough to see that they are executing e.g. they are painting their UI components which suggests that the apps contain some valid code.

The apps being used are clean built copies of the Apple SDK examples and all that will build have been tested with the similar result.

For example, the Accellerometer Graph application starts up and displays three graphs but immediately shuts down again.

The only thing that I could see that looked odd on the device was that my uploaded applications did not have group execute set, unlike the preexisting ones. However the problem is the same with it set either way.

I used the default pwn options (although I have tried tht whole sequence a few times including other options)

I am running on a [early march] iPhone 16G.

So, does it work for you? What are we doing that is different? Is the need to restore a pwned 1.1.4 just a myth? and if not what lasting effect does it have after the pwned 1.2 pas been installed

thecompkid
04-07-2008, 02:58 PM
Have you tried using Xcode to upload the application instead of sshing it? There's an option in the organizer window on the bottom of the first tab.

sleeepy
04-07-2008, 05:11 PM
The plot thickens.

I cannot find the option you speak of nor can I see any tabs (in the sense of a tabbed pane) in the organizer window but guessing that this is the first choice list button, then I can see no upload option there.

But following a lead from elsewhere which said
In project settings set "code signing identity" to "Device - iPhone OS 2.0"
I thought that perhaps this option only appears if there is a code signing identity set.

"Device - iPhone OS 2.0" looks an odd value for "code signing identity" but I can confirm that with it there (or for that matter with "XYZZY" there) the system behaves differently.

Now if I try to build the code (NOT build and go, just build) I get an error

codesign error: unsupporter architecture "armv6", Please upgrade to MacOS 10.5.2 or later.

OK, so I'm running at 10.5.1 (and there are some problems upgrading to 10.5.2) BUT

If code signing identity is blank but the Base SDK set to "Device - iPhone OS 2.0" then the system is happy to build the app and not sign it and further more that code [starts to] execute on the pwned 2.0 iphone.

So is the problem that the applications MUST be signed although it doesn't matter what with, and mine are being killed because they aren't signed at all - and someone has built the x3.1 code signer to require armv6, possibly for no good reason apart from it being Friday.

Or is it because there is something in the iPhone that really does require v6 code and that xcode 3.1 relies on the presense of a signature, rather than selection of the Base SDK to "Device - iPhone OS 2.0", to tell it which compiler to use.

Assuming that the Apple sandbox can kill applications that it doesn't like, after they start, which I understood to be the case but don't remember where from, then my money is on the former.

I wonder if there anything else that I can use to sign the application in a compatible manner, albeit with a random signature.

sleeepy
04-08-2008, 01:59 PM
OK, I think that I now have a clear set of rules.

You can deliver the application to the Device by ssh or by xcode's upload facility or by using the Build and Go option directly -

BUT

The application must be "sandboxized" [Ugh - from the messages output - not my word]

The Build option will sandboxize an application if and only if the "code signing identity" attribute in the project settings is not empty, and of course empty is the default.

Sandboxizing includes signing but may include other packaging things.

A sandboxized application will run on pwned 2.0 Beta device so you can sign with any string in "code signing identity" BUT

An unsandboxized application will be killed shortly after startup, but long enough after to perform quite a bit of UI initialisation.

Presumably this is NOT a serious security feature since a malicious application can perform quite a bit of damage in the available fraction of a second. Perhaps it is intended as more of a marketing control feature, but if this is intended as real security for the user against a rouge application then it must be fixed so that there is no window of opportunity for damage before UI initialisation or else it simply provides a false sense of security. Apple Please Note!

cazlar
04-08-2008, 06:27 PM
Are you sure it is actually running code?

Because iPhone apps let you put a default.png image in the bundle that is displayed while the app begins initializing - maybe this is all you are seeing?

pinxue
04-09-2008, 05:57 AM
OK, I think that I now have a clear set of rules.

You can deliver the application to the Device by ssh or by xcode's upload facility or by using the Build and Go option directly -

BUT

The application must be "sandboxized" [Ugh - from the messages output - not my word]

The Build option will sandboxize an application if and only if the "code signing identity" attribute in the project settings is not empty, and of course empty is the default.

Sandboxizing includes signing but may include other packaging things.

A sandboxized application will run on pwned 2.0 Beta device so you can sign with any string in "code signing identity" BUT

An unsandboxized application will be killed shortly after startup, but long enough after to perform quite a bit of UI initialisation.

Presumably this is NOT a serious security feature since a malicious application can perform quite a bit of damage in the available fraction of a second. Perhaps it is intended as more of a marketing control feature, but if this is intended as real security for the user against a rouge application then it must be fixed so that there is no window of opportunity for damage before UI initialisation or else it simply provides a false sense of security. Apple Please Note!

I just use the xcoder to deploy applications with empty code signing information, it works fine, build and go or click in SpringBoard.

sleeepy
04-11-2008, 11:37 PM
Are you sure it is actually running code?

Because iPhone apps let you put a default.png image in the bundle that is displayed while the app begins initializing - maybe this is all you are seeing?

H'm. I Think you're right.

Strange working convention. You write software to create a GUI and then create an image to display the same information. I woz conned. The software was indeed not running at all.

k0nstantin
04-14-2008, 12:11 AM
I have the same problem! I have gone through the same pwnage-process you mentioned above, twice (just to make sure).

and ...

1. The Organizer in Xcode accepts my iPhone.

2. I can compile all the Apple example projects.

3. I can use the Build & Go to build and deploy the app directly to my iPhone (through USB cable).

4. The app starts up, but then freezes (or more correctly: it just shows me the png screenshot).

5. BUT - strangely - there is ONE app that DO run and work fine, and that is the "WhichWayIsUp (http://developer.apple.com/iphone/library/samplecode/WhichWayIsUp/index.html)" example!

sleeepy, DID you or did you NOT solve this problem? I don't really understand where to SIGN the application, or what that means? If this is the solution to the problem, please give me a clue on how to proceed ...

(I'm using an 'old' iPhone bought in September.)

saispe
04-14-2008, 11:27 AM
Re: DEFALULT.PNG
The image that shows up (Default.png) when you start the app is there for a good reason.
It gives you feedback the moment you open the app and makes you feel that the iPhone is very responsive.
In fact it takes a while to start any app and you can clearly see that if you are paying attention. For example the calculator app which only starts the moment the screen turns on (goes blue).
Also, it is possible to create the Default.png at runtime, in case you want to make the user feel like the app never closed. You just have to generate the image when the app suspends or terminates. There is a function that does just that.

k0nstantin
04-15-2008, 05:04 PM
Now it works! I just updated to 5A240d (which became possible today with the new pwnage tool 1.1)!

A wild guess is that the problem was I updated the latest version of the SDK this week but was running the older 2.0 beta.

This is great!

Niiro13
04-15-2008, 09:35 PM
That is indeed correct. Of course as you can imagine, it is very annoying...having to update apps everytime a new SDK build releases.

saispe
04-17-2008, 02:53 PM
That's great.
I can confirm that it works with Pwnage tool 1.1 and 5A240d firmware on an iPod Touch.

Niiro13 : this is beta software, so it's supposed to be annoying :))

matrix4123
04-26-2008, 04:58 AM
Could anyone post a how-to or quick walk through for putting SDK built apps on the phone...? Like what OS versions, SDK versions, unlock apps, etc...? Any help is appreciated.

THANKS

sh4508
04-26-2008, 08:20 AM
@matrix4123: I use MacBook 2.16GHz with 120GB Leopard, i.e. Mac OS 10.5.2 | iPhone SDK beta 3 & iPhone firmware 2.0 (5A240d) customized by PwnageTool 1.1 and restore into the iPhone using iTunes 7.6.2. The iPhone was from week 51 (1.1.2 OTB with 4.6 bootloader version). The iPhone has been upgraded to 1.1.3, 1.1.4 and 2.0 and frequently at least once a week restored to 1.1.4 or 2.0 depending what apps I want to test.

All sample apps from iPhone SDK can be installed using X Code. First, download the application, for me the zip one, not the dmw version. Then click the app you just downloaded, it will open the folder. Find the element with extension xcodeproj Double click that one. It will open X Code.

From the application folder, at top left corner, you can select, to use iPhone simulator or iPhone device. Click build or build and go. Some will only works if installed into iPhone device, as the iPhone simulator will not have all the functions available in the iPhone.

Here are samples that has been installed into my iPhone (2.0 firmware version 5A240d): GLSprite, GLGravity, GLTeapot, FingerSketch, Kalimba, Metronome, Touches, UIShowcase, SQLiteBooks, SeismicXML, whichWayIsUp, ViewTransitions, TheElements, Reachability, HelloWorld, QuartzDemo, MoveMe, GestureWatch, WiTap etc.

As for LunarLander, the version I downloaded yesterday is specifically has been modified for beta 4, so I have to wait until I can use PwnageTool to customized version 5A258f.

I hope this is sufficient for you to start enjoy the iPhone SDK. Download it from apple.com, it is free. Just register.

matrix4123
04-26-2008, 07:29 PM
Thanks sh4508. I am currently running an unlocked version iPhone of 1.1.4. I tried sshing an application I made to the phone and it appears to just start up and then exit. I think it has to do with the "signed" application stuff discussed in another thread. So I guess I will need to use the pwnage tool and the latest firmware? Thanks for your help!

digitalrio
04-27-2008, 04:56 AM
Thanks sh4508. I am currently running an unlocked version iPhone of 1.1.4. I tried sshing an application I made to the phone and it appears to just start up and then exit. I think it has to do with the "signed" application stuff discussed in another thread. So I guess I will need to use the pwnage tool and the latest firmware? Thanks for your help!
Unfortunately all samples have now been updated to beta 4 and cannot be used with beta 3. I keep getting "unsigned" errors. I guess we'll have to wait for the new beta to be pwned before we can do anything...