2009年3月30日

[黑暗]讓你寫的程式在 iphone 上執行

自從去年購入 iphone 之後,為了徹底的研究他,所以破解、升級、裝 cydia 樣樣來。

當然,少不了的,是在這台超棒機器上面開發自己的軟體囉。

有圖有真相,先 post 一張執行的結果 (背景是用模擬器跑的)



沒錯,就是超級好玩的 globme 現在有了 iphone 的版本~!!

但是呢,這是用一種黑暗的方法達成的,一般人還是照教科書的做法比較好。

--- 黑暗方法分隔線 ---

沒錯,如果您想在 iphone 上面開發自己的程式,請先安裝 xCode,然後去蘋果網站下載 SDK,最新的版本 2.2.1 版大概有 1.7G,安裝後高達 4.5G,所以如果硬碟不夠(我以前的窘境),請先升級硬碟和作業系統到 Leopard 10.5.6。

重點來了,當你興高采烈的開發完程式之後,你會發現只能在模擬器上跑爽的,沒辦法在您買的 iphone 上面看到執行結果。這是因為蘋果希望你購買 iphone 的開發者憑證。這個憑證要收費 USD 99 元。

既然叫黑暗,那當然我沒有花錢,所以如果大家照我的方法,導致的任何後果可是要自負的。破解的方法有很多招,不過開頭都是一樣的

1.先去安裝 QuickPWN or pwntool 讓您的 iphone 可以有 cydia 安裝其他任何的第三方軟體。
2.我安裝了 BossPrefs ,他可以讓你看到 iphone 的 ip, 以及 enable SSH。
3.在 cydia 上安裝 OpenSSH,讓您的 iphone 可以被連入。

接下來是 MAC 電腦端:

1.威鋒網有教您如何自行製作憑證。這也許是一個可行的方式,但是我試了之後是失敗的結果。

or

2.打開 Xcode,到您的專案下,先確保您選擇的是正確的版本,也就是手機和開發環境是一樣的版本(我是 2.2.1)


3. 進入 project setting,到 Build 裡增加三個使用者自訂的設定:
CODE_SIGNING_REQUIRED = NO
PROVISIONING_PROFILE_ALLOWED = NO
PROVISIONING_PROFILE_REQUIRED = NO


4.重新打開 xCode 然後選 Build。之後去找到 app 存放的位置。




5. 然後你可以在自己的電腦裡找到這個 app 檔案,當然,mac 裡面是顯示成無法執行的樣子



6. 這個時候請啟動您的遠端連線工具,我個人是用 CyberDuck 這個免費軟體,利用 SFTP 連到 iphone 裡面,請去找到您的 /private/var 這個目錄



7.裡面可以看到一個 Applications.xxxxxx <---- xxxxxx 每個人的都不一樣,這裡面放的 app 就是您的 iphone 可以執行的程式。


8. 把您開發的專案執行包傳到這個目錄下,然後去找目錄裡的 info.plist 這個檔案,用文字編輯器打開,去尋找

Signerldentity

Apple iPhone OS Application Signing

這兩組關鍵字,然後刪除、存檔。



9.把 iphone 重新開機。到 cydia 安裝一個軟體叫做 respring,這個軟體可以修復 iphone 桌面上沒有出現的 icon。

理論上這個時候您自行開發的軟體就可以在自己的 iphone 上面執行了。再強調一次,這是黑暗的方法,正常來說請按照教科書的解法來進行,才是王道喔。
祝大家寫 iphone 程式都順利。

2009年3月24日

Globme beta 0.25

宇宙無敵超級棒的記錄個人人生專用平台 globme 出了 beta 0.25 版啦。

在這個版本裡,不但可以看到世界上的人都在做些什麼,照片的整理和事件的編排也更有順序、時間軸的設定也變成以一週為單位,讓重度使用者可以更清楚看到自己填了什麼樣的內容在 timeline 上。

此外,多了 globme 的名人堂。裡面目前有十個名人的人生在等待著給大家填滿。也算是一種另類的 wiki 囉 :p

還在等什麼,快去註冊

2009年3月16日

iphone 2.2.1 jailbreak

上次回台灣的時候 Jerry 買了 iphone,還是 16G 的咧。

身為使用數個月的玩家,當然馬上推薦他 Jail Break 來讓他的 iphone 多采多姿。沒想到他的手更快,一下從 2.2 升級到 2.2.1 版,所以我手邊完全沒有適合的工具來解這個問題。

這次回來,就發現可以利用 quickPwn 2.2.5 來解 iphone 2.2.1 啦,我的方法是先去下載 2.2.1 的官方復原版,然後從 iTunes 安裝硬碟裡的這個版本,接著用 quickPwn 來破解就大功告成。目前一切正常使用中。

哎呀呀,版本的推進真的是很討厭,因為每次不想升級的時候就會有一些神祕的軟體是要新版本的 iphone 才能玩,這些廠商大概有被蘋果收買吧 :p

2009年3月11日

讀了黑羊

上個週末我在養生的蘇州渡過,因為時間空閒的關係所以讀了一個小小說。

一隻羊長成黑色,並不表示所有的白羊都是對的,但是特立獨行的人,命定是活得比較辛苦。

這是一篇大約寫在五十年前的小小說,以下是「黑羊」的原文:

Black Sheep, by Italo Calvino

There was a country where they were all thieves.

At night everybody would leave home with skeleton keys and shaded lanterns and go and burgle a neighbour’s house. They’d get back at dawn, loaded, to find their own house had been robbed.

So everybody lived happily together, nobody lost out, since each stole from the other, and that other from another again, and so on and on until you got to a last person who stole from the first. Trade in the country inevitably involved cheating on the parts both of the buyer and the seller. The government was a criminal organization that stole from its subjects, and the subjects for their part were only interested in defrauding the government. Thus life went on smoothly, nobody was rich and nobody was poor.

One day, how we don’t know, it so happened that an honest man came to live in the place. At night, instead of going out with his sack and his lantern, he stayed home to smoke and read novels.

The thieves came, saw the light on and didn’t go in.

This went on for a while: then they were obliged to explain to him that even if he wanted to live without doing anything, it was no reason to stop others from doing things. Every night he spent at home meant a family would have nothing to eat the following day.

The honest man could hardly object to such reasoning. He took to going out in the evening and coming back the following morning like they did, but he didn’t steal. He was honest, there was nothing you could do about it. He went as far as the bridge and watched the water flow by beneath. When he got home he found he had been robbed.

In less than a week the honest man found himself penniless, he had nothing to eat and his house was empty. But this was hardly a problem, since it was his own fault; no, the problem was that his behaviour upset everything else. Because he let the others steal everything he had without stealing anything from anybody; so there was always someone who came home at dawn to find their house untouched: the house he should have robbed. In any event after a while the ones who weren’t being robbed found themselves richer than the others and didn’t want to steal any more. To make matters worse, the ones who came to steal from the honest man’s house found it was always empty; so they became poor.

Meanwhile, the ones who had become rich got into the honest man’s habit of going to the bridge at night to watch the water flow by beneath. This increased the confusion because it meant lots of others became rich and lots of others became poor.

Now, the rich people saw that if they went to the bridge every night they’d soon be poor. And they thought: ‘Let’s pay some of the poor to go and rob for us.’ They made contracts, fixed salaries, percentages: they were still thieves of course, and they still tried to swindle each other. But, as tends to happen, the rich got richer and the poor got poorer and poorer.

Some of the rich people got so rich that they didn’t need to steal or have others steal for them so as to stay rich. But if they stopped stealing they would get poor because the poor stole from them. So they paid the very poorest of the poor to defend their property from the other poor, and that meant setting up a police force and building prisons.

So it was that only a few years after the appearance of the honest man, people no longer spoke of robbing and being robbed, but only of the rich and the poor; but they were still all thieves.

The only honest man had been the one at the beginning, and he died in very short order, of hunger.


如果你也耐心看完原文了,那下面是簡單的翻譯,可以跳過 :p

這個故事說的是,從前有個國家全國都是賊,每個晚上每一戶人都離開自己家去偷別人家,在偷別人家的同時,自己家也被別人偷了,如此每天大家彼此偷著彼此,沒人變窮也沒人變富,你幸福我美滿,大家都過著幸福快樂的日子。

一直到有一天,有個誠實的人住進這個國家,他不知道晚上必須出門去偷別人,這樣也好被人家偷,他每天晚上躲在家裡抽煙讀小說,結果每個該偷他家的人都不敢進他家,有人好心的提醒他,這人只好在晚上刻意離開家,以讓別人來偷他,但是他卻堅持不去偷別人。

這下問題又來了,他不去偷人家,就會有人回家時變有錢了,他不去偷人家,家裡空空如也,就有人到他家因為偷不到而變窮,於是有錢的人開始學會不去偷東西了,這些富人把多出來的錢拿一部份出來雇用窮人幫忙他偷東西,他還用錢雇了警察保護自己不被偷和蓋監獄關那些偷東西的人。

於是這國家完全變了樣,貧者越貧,富者越富,大家活在另一種情境裡,有人活得更好,有人活得更壞,而最後,那個堅持不偷的老實人很快就活活餓死了。

- - -

非常好的作品呀,裡面完全沒有直接說作者支持或反對那種社會體制,只簡單清楚的呈現故事,讓讀者自己去思考。

輕鬆玩東京六天五夜

起因是今年春天在我們家一輪投票之後,泰國曼谷出局,東京獲選為我們家的暑假旅遊點,掌聲~~~