<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ramblings of a Geek - Jeremy Johnstone &#187; trouser mac</title>
	<atom:link href="http://www.jeremyjohnstone.com/tag/trouser-mac/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jeremyjohnstone.com</link>
	<description>Ramblings of a Geek</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:33:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>First drawing using Brushes.app on the iPhone</title>
		<link>http://www.jeremyjohnstone.com/blog/2009-05-25-first-drawing-using-brushesapp-on-the-iphone.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2009-05-25-first-drawing-using-brushesapp-on-the-iphone.html#comments</comments>
		<pubDate>Tue, 26 May 2009 03:37:56 +0000</pubDate>
		<dc:creator>flickr</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[drawing]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[trouser mac]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/2009-05-25-first-drawing-using-brushesapp-on-the-iphone.html</guid>
		<description><![CDATA[


First drawing using Brushes, originally uploaded by Jeremy Johnstone.



Today I spent most of the day catching up on my blog reading and I stumbled across an article about a guy using an iPhone app named Brushes to design this month&#8217;s cover of The New Yorker. Highly impressed by the output and the video of it [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: left; padding: 3px;">
<a href="http://www.flickr.com/photos/jeremyjohnstone/3564935176/" title="photo sharing"><img src="http://farm4.static.flickr.com/3398/3564935176_5ebb97e93c.jpg" style="border: solid 2px #000000;" alt=""  class="aligncenter"/></a><br />
<br />
<span style="font-size: 0.8em; margin-top: 0px;"><a href="http://www.flickr.com/photos/jeremyjohnstone/3564935176/">First drawing using Brushes</a>, originally uploaded by <a href="http://www.flickr.com/people/jeremyjohnstone/">Jeremy Johnstone</a>.</span>
</div>
<p><br/></p>
<p>
Today I spent most of the day catching up on my blog reading and I stumbled across an <a href="http://www.newyorker.com/online/blogs/tny/2009/05/jorge-colombo-iphone-cover.html">article</a> about a guy using an iPhone app named <a href="http://brushesapp.com/">Brushes</a> to design this month&#8217;s cover of <a href="http://www.newyorker.com/">The New Yorker</a>. Highly impressed by the output and the video of it being created, I decided to give it a shot.</p>
<p>Realizing of course that I am definitely not an artist and that using just a finger on the iPhone screen isn&#8217;t the most precise way to dry, I don&#8217;t think my first work is too bad considering. I&#8217;ve done a lot of sketches in the past with various pen tablets and while the experience wasn&#8217;t anywhere near as easy as with them, it was pretty fun and rewarding that such a feat could be accomplished on my iPhone. A company named <a href="http://www.tenonedesign.com/">Ten One Design</a> seems to make a stylus for the iPhone for a very reasonable price ($14.95) and I think I might pick one up not just for this purpose.</p>
<p>I think what impressed me the most is that all this was possible using a $199 &#8220;smartphone&#8221;. Times are changing and when we step back and think about what was possible with a cell phone not even 10 years ago, it simply is amazing, IMHO.</p>
<p>The above image was modified after creation in Brushes to add in the frame and thought bubble. The additional elements were added using Photogene and then the image was uploaded to Flickr via Mobile Foto (both also iPhone apps). See below for a time-lapse video of the creation of the coke zero image created using the Brushes Viewer desktop companion app.</p>
<p><object type="application/x-shockwave-flash" width="267" height="400" data="http://www.flickr.com/apps/video/stewart.swf?v=71377" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  class="aligncenter"><param name="flashvars" value="intl_lang=en-us&#038;photo_secret=d297acfdaa&#038;photo_id=3564482213"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=71377" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&#038;photo_secret=d297acfdaa&#038;photo_id=3564482213" height="400" width="267"  class="aligncenter"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2009-05-25-first-drawing-using-brushesapp-on-the-iphone.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;trouser mac&#8221;</title>
		<link>http://www.jeremyjohnstone.com/blog/2007-12-12-trouser-mac.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2007-12-12-trouser-mac.html#comments</comments>
		<pubDate>Thu, 13 Dec 2007 00:52:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[trouser mac]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=238</guid>
		<description><![CDATA[A new geek term for the masses. Instead of calling the most kickass phone ever invented an &#8220;iPhone&#8221;, from now on it should be referred to as a &#8220;trouser mac&#8221;.
]]></description>
			<content:encoded><![CDATA[<p>A new geek term for the masses. Instead of calling the most kickass phone ever invented an &#8220;iPhone&#8221;, from now on it should be referred to as a &#8220;trouser mac&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2007-12-12-trouser-mac.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPhone hacking just got a whole lot easier!</title>
		<link>http://www.jeremyjohnstone.com/blog/2007-08-24-iphone-hacking-just-got-a-whole-lot-easier.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2007-08-24-iphone-hacking-just-got-a-whole-lot-easier.html#comments</comments>
		<pubDate>Sat, 25 Aug 2007 04:19:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[trouser mac]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=139</guid>
		<description><![CDATA[This evening I decided today would be the day I upgraded to 1.0.2. Despite a few hiccups with the restoration, the update proceeded and my iPhone was now running Apple&#8217;s latest and greatest release. Sadly, that also meant my iPhone was now pristine again without any of the apps I have come to love on [...]]]></description>
			<content:encoded><![CDATA[<p>This evening I decided today would be the day I upgraded to 1.0.2. Despite a few hiccups with the restoration, the update proceeded and my iPhone was now running Apple&#8217;s latest and greatest release. Sadly, that also meant my iPhone was now pristine again without any of the apps I have come to love on it. After hearing about the new Installer.app GUI installer, I had to give it a shot.</p>
<p>This is about as simple of a howto as one could get, the steps to getting Installer.app running (which opens the door for SSH, Terminal, etc) is as follows:</p>
<blockquote>
<ol>
<li>Download the <a href="http://www.nullriver.com/~zigzag/AppTappInstaller.zip">Installer.app GUI installer</a> from <a href="http://iphone.nullriver.com/beta/">here</a>.</li>
<li>Run the application and follow the onscreen instructions (connecting phone, shutting down iTunes, selecting current phone firmware revision).</li>
<li>Sit back and wait 2-3 minutes. It literally does everything else for you!</li>
</ol>
</blockquote>
<p>No more do you need long howtos, no more do you need to worry about missing steps. Just sit back and let the GUI app do it&#8217;s business and you are good to go. I&#8217;m still a little irritated they haven&#8217;t opened up the source on the app, but otherwise the process couldn&#8217;t be simpler. If you haven&#8217;t hacked your phone yet, what are you waiting for?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2007-08-24-iphone-hacking-just-got-a-whole-lot-easier.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto: Run custom apps on iPhone (Part #2)</title>
		<link>http://www.jeremyjohnstone.com/blog/2007-08-05-howto-run-custom-apps-on-iphone-part-2.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2007-08-05-howto-run-custom-apps-on-iphone-part-2.html#comments</comments>
		<pubDate>Mon, 06 Aug 2007 01:11:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[trouser mac]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=123</guid>
		<description><![CDATA[In the first post of this howto, I talked you through getting full access to your iPhone and a basic SSH server running. If you haven&#8217;t read Part #1 yet, please do so before continuing here. In this post, we will actually get our toolchain setup as well as install a few more useful pieces [...]]]></description>
			<content:encoded><![CDATA[<p>In the first post of this howto, I talked you through getting full access to your iPhone and a basic SSH server running. If you haven&#8217;t read <a href="http://www.jeremyjohnstone.com/blog/archives/2007/08/05/howto-run-custom-apps-on-iphone-part-1/">Part #1</a> yet, please do so before continuing here. In this post, we will actually get our toolchain setup as well as install a few more useful pieces of software.</p>
<p>The first thing I will talk you through is replacing DropBear. We will install OpenSSH2 onto the phone which will provide us with the full suite of SSH functionality. Follow these simple steps to upgrade:</p>
<ol>
<li>Download the <a href="http://iphone.natetrue.com/ssh_3.2.9.1_mach-o_acorn.tar.gz">openssh iPhone</a> package and extract it into ~/phonedmg/openssh</li>
<li>Download the <a href="http://iphone.natetrue.com/iphone-binkit-0.06.tar.gz">iPhone binkit</a> and extract it into ~/phonedmg/binkit</li>
<li>Fire up iPHUC and run the following commands (you will get an error about the rmdir, ignore it as it did it&#8217;s job):
<pre class="brush: bash">
mkdir /etc/ssh2
putfile /Users/(your username)/phonedmg/openssh/etc/ssh2/ssh2_config /etc/ssh2/ssh2_config
putfile /Users/(your username)/phonedmg/openssh/etc/ssh2/sshd2_config /etc/ssh2/sshd2_config

putfile /Users/(your username)/phonedmg/openssh/usr/bin/scp2 /usr/bin/scp2
putfile /Users/(your username)/phonedmg/openssh/usr/bin/sftp-server2 /usr/bin/sftp-server2
putfile /Users/(your username)/phonedmg/openssh/usr/bin/sftp2 /usr/bin/sftp2
putfile /Users/(your username)/phonedmg/openssh/usr/bin/ssh-add2 /usr/bin/ssh-add2
putfile /Users/(your username)/phonedmg/openssh/usr/bin/ssh-agent2 /usr/bin/ssh-agent2
putfile /Users/(your username)/phonedmg/openssh/usr/bin/ssh-keygen2 /usr/bin/ssh-keygen2
putfile /Users/(your username)/phonedmg/openssh/usr/bin/ssh-probe2 /usr/bin/ssh-probe2
putfile /Users/(your username)/phonedmg/openssh/usr/bin/ssh-signer2 /usr/bin/ssh-signer2
putfile /Users/(your username)/phonedmg/openssh/usr/bin/ssh2 /usr/bin/ssh2
putfile /Users/(your username)/phonedmg/openssh/usr/bin/sshd2 /usr/bin/sshd2
putfile /Users/(your username)/phonedmg/openssh/System/Library/LaunchDaemons/com.sshd.plist /System/Library/LaunchDaemons/com.sshd.plist

putfile /Users/(your username)/phonedmg/binkit/usr/bin/scp /usr/bin/scp
putfile /Users/(your username)/phonedmg/binkit/bin/ls /usr/bin/ls
putfile /Users/(your username)/phonedmg/binkit/usr/lib/libarmfp.dylib  /usr/lib/libarmfp.dylib

rmdir /System/Library/LaunchDaemons/au.asn.ucc.matt.dropbear.plist
</pre>
</li>
<li>Now, ssh into your phone (you will be connecting to the dropbear server still) and do the following:
<pre class="brush: bash">
-sh-3.2# chmod 555 /bin/ls /usr/bin/*
-sh-3.2# ssh-keygen2 -P -t dsa -c "DSA hostkey" /etc/ssh2/hostkey
-sh-3.2# launchctl load /System/Library/LaunchDaemons/com.sshd.plist
</pre>
</li>
<li>Now reboot your phone and make sure you still have ssh access.</li>
</ol>
<p>Now that you have a good SSH server on your phone, it&#8217;s time to add in a bunch of standard Unix commands. You do this by running the following commands on your Mac:</p>
<pre class="brush: bash">
$ cd ~/phonedmg/binkit
$ scp -R bin sbin usr libexec root@(iphone IP):/
</pre>
<p>After doing this, you should have things like grep, uname, ps, etc on your iPhone. Try them out to be sure. As a quick exercise, now that you have a full blown SSH server on your iPhone and basic apps like vim, you should consider disabling password based authentication and put your SSH key on it. Much more secure, IMHO. If you need help with this, ping me.</p>
<p>The next thing we will do is get our toolchain working. My preference is to build the toolchain from source (easier to keep up to date). This can be time consuming though, so if you are the impatient type, do a Yahoo! search for &#8220;iphonetoolchain dmg&#8221;. I haven&#8217;t tested this approach, so I won&#8217;t provide any direct links (as they may rapidly change). To build the toolchain, do the following:</p>
<ol>
<li>Create a home for the toolchain source, my suggestion is ~/phonedmg/toolchain and the examples will follow as such.</li>
<li>Install libstreams onto your box by running:
<pre class="brush: bash">
sudo port install libstreams
</pre>
</li>
<li>We now need to decrypt the firmware. Due to the fact I am uncertain the legality of posting the firmware encryption key, I am linking you to the instructions <a href="http://iphone.fiveforty.net/wiki/index.php/Decrypt_Firmware">here</a>. After decrypting, you should have a file named decrypted.dmg. Mount this disk image.</li>
<li>Now copy the files inside the mounted disk image into your toolchain directory by doing the following:
<pre class="brush: bash">
mkdir ~/phonedmg/toolchain/heavenly
sudo cp -R /Volumes/Heavenly1A543a.UserBundle/* ~/phonedmg/toolchain/heavenly/
</pre>
</li>
<li>Now checkout the toolchain code from the public subversion repo
<pre class="brush: bash">
cd ~/phonedmg/toolchain
svn checkout svn://svn.berlios.de/iphone-binutils/trunk
</pre>
</li>
<li>Now we need to actually build the toolchain itself. First we:
<pre class="brush: bash">
cd ~/phonedmg/toolchain/trunk
./configure --with-heavenly=/Users/(your username)/phonedmg/toolchain/heavenly/
</pre>
<p>Then we need to fix a problem in the generated makefile by editing line 34 and making it read:</p>
<pre class="brush: bash">
cd llvm-2.0 &#038;&#038; $(MAKE) ENABLE_OPTIMIZED=1 install
</pre>
<p> and then following that we run _sudo make_ (note the sudo is apparently required).</li>
</ol>
<p>Now that we have our toolchain setup, let&#8217;s build the most useful app I have found so far. This application is a Terminal.app like application for the iPhone. It provides a GUI interface to running shell commands on the phone and is immensely useful for things like SSH (outbound from the phone). The app also has good polish for such an early edition and thus is a good example of what can be done. Follow these steps for getting it running on your iPhone:</p>
<ol>
<li>First things first, we need to download the source code to the app. We do this by:
<pre class="brush: bash">
mkdir ~/phonedmg/apps
cd ~/phonedmg/apps
svn checkout http://mobileterminal.googlecode.com/svn/trunk/ mobileterminal
</pre>
</li>
<li>Now we need to download a header file, <a href="http://ellkro.jot.com/WikiHome/iPhoneHacking/UITextTraitsClientProtocol.h">UITextTraitsClientProtocol.h</a>, missing from the toolchain and put it in /Developer/SDKs/iPhone/include/UIKit/</li>
<li>Next we fake a couple files to make things happy by doing the following:
<pre class="brush: bash">
sudo touch /Developer/SDKs/iPhone/include/UIKit/NSObject.h
sudo touch /Developer/SDKs/iPhone/include/LayerKit/NSObject.h
</pre>
</li>
<li>Now run _make_ and _make package_</li>
<li>Assuming all goes well (I got some warnings, but it compiled), copy the resulting Terminal.app bundle to your phone:
<pre class="brush: bash">
scp -r Terminal.app root@(iPhone IP):/Applications/
</pre>
</li>
<li>Now reboot your iPhone and now you should see the new app available to use. Here&#8217;s a screenshot of what it looks like:<br />
<a href="http://code.google.com/p/mobileterminal/"><img src="/images/mobileterminal.png" border="0" /></a></li>
</ol>
<p>That completes our howto and I would love to thank the numerous devs around the world who have made all this possible. Now that you have a toolchain and an extremely useful sample app, let&#8217;s see what apps you can create! If you make something, please be sure and let me know.</p>
<p>P.S. &#8211; A helpful tip in regards to the terminal app, to do a control key sequence use the &#8220;bullet&#8221; key which can be found by pressing the 123 key, then the #+= key (center far right of that last keyboard). Also, to hide the keyboard, simply tap the screen (and again to bring it back up).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2007-08-05-howto-run-custom-apps-on-iphone-part-2.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Howto: Run custom apps on iPhone (Part #1)</title>
		<link>http://www.jeremyjohnstone.com/blog/2007-08-05-howto-run-custom-apps-on-iphone-part-1.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2007-08-05-howto-run-custom-apps-on-iphone-part-1.html#comments</comments>
		<pubDate>Sun, 05 Aug 2007 22:03:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[trouser mac]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=122</guid>
		<description><![CDATA[After getting numerous inquiries from coworkers and friends, decided to write a cohesive howto guide on getting custom apps on your iPhone. Yes, there are numerous sources of information all over the net, but I haven&#8217;t seen (keyword, I haven&#8217;t, maybe you have) a howto which covers everything from start to finish. This will be [...]]]></description>
			<content:encoded><![CDATA[<p>After getting numerous inquiries from coworkers and friends, decided to write a cohesive howto guide on getting custom apps on your iPhone. Yes, there are numerous sources of information all over the net, but I haven&#8217;t seen (keyword, I haven&#8217;t, maybe you have) a howto which covers everything from start to finish. This will be a multi-part series (mainly because I don&#8217;t want to type so much write now) so stay tuned for the complete guide. For all of these instructions, I am going to assume you are on a Mac. I&#8217;ve not seen any way to build apps using the toolchain on Windows and since that is the whole point of this howto series, I won&#8217;t go into any Windows related stuff (sorry!).</p>
<p>First things first, you need to get access into the iPhone outside of normal Apple channels. I&#8217;ve tried numerous different methods with varying levels of success, but the one I have found easiest is to use <a href="http://iphone.natetrue.com/jailbreak11.zip">Jailbreak</a> combined with <a href="http://iphone.fiveforty.net/wiki/index.php/IPHUC">iPHUC</a>. Yes, yes, you can do all of it with just iPHUC now, but I have found Jailbreak to be far easier and less error prone to get out of the chroot jail. So, first things first, you need to download a few things:</p>
<blockquote><p>
<a href="http://iphone.natetrue.com/jailbreak11.zip">Jailbreak</a><br />
<a href="http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-3538.20070629.B7vXa/iPhone1,1_1.0_1A543a_Restore.ipsw">iPhone Restore Image</a>
</p></blockquote>
<p>The restore image is really a zipfile, so if it didn&#8217;t uncompress automatically, then rename the file with a .zip extension and extract it. Now create a directory somewhere (like your home dir) named &#8221; phonedmg &#8220;. Inside this directory put the _contents_ of the iPhone1,1_1 from the extracted restore image. Make sure you put the contents (aka two disk images, a directory, and two files) and not the directory itself! Now also extract Jailbreak and put it&#8217;s contents there too. Next you are going to run Jailbreak (if I need to tell you how to run it, you should really stop here). Follow the instructions it gives to put the phone in restore mode and a couple moments later your phone should now be fully accessible. If you are curious the steps it is performing behind the scenes, read this twiki page on &#8220;<a href="http://iphone.fiveforty.net/wiki/index.php/How_to_Escape_Jail">How to escape Jail</a>&#8221; which is more or less the same steps (except it does it in a different order, but essentially the same thing). I chose to use the automated method as the steps are a bit tedious and there is no perceived benefit I can tell from using the manual steps.</p>
<p>Now that we have complete access to the phone&#8217;s filesystem, we will install a basic SSH server to help us with the bootstrap process. The  first step is to download and compile <a href="http://iphone.fiveforty.net/wiki/index.php/IPHUC">iPHUC</a>. The build process is as follows (lifted from <a href="http://iphone.fiveforty.net/wiki/index.php/IPHUC">here</a>, only reprinted to keep you from having to jump around):</p>
<ol>
<li>Download and install <a href="http://www.macports.org/">MacPorts</a></li>
<li>Open Terminal and issue the following commands (these instructions assume you have xcode developer tools installed and put your phone software in ~/phonedmg):
<pre class="brush: bash">
sudo port selfupdate
sudo port install readline
cd ~/phonedmg/
mkdir tools-src
cd tools-src/
svn co http://iphonesvn.halifrag.com/svn/iPhone iphuc-src
cd ./iphuc-src/trunk/iPHUC/
</pre>
</li>
<li>Get the most recent version of <a href="http://iphone.fiveforty.net/wiki/index.php/MobileDevice.h">MobileDevice.h</a> and save a copy to &#8216;MobileDevice.h&#8217; in the iPHUC directory</li>
<li>Patch NormalInterface.cpp with the following patch:
<pre class="brush: diff">Index: NormalInterface.cpp
===================================================================
--- NormalInterface.cpp ( revision 8 )
+++ NormalInterface.cpp ( working copy )
@@ -1,4 +1,4 @@
-#include "normalinterface.h"
+#include "NormalInterface.h"
 #include "Shell.h"

 int n_pwd(string *args, struct shell_state *sh)
</pre>
</li>
<li>Build iPHUC via the following (ignore warnings if everything builds):
<pre class="brush: plain">./autogen.sh &#038;&#038; ./configure --with-readline=/opt/local &#038;&#038; make</pre>
</li>
<li>Copy iPHUC into your phonedmg folder (not required, but I like to keep everything in one convenient spot)</li>
</ol>
<p>Now that you have built iPHUC, it&#8217;s time to get shell access on the phone. We first need to download <a href="http://www.jeremyjohnstone.com/dl.php?what=dropbear.tar.bz2">dropbear for iPhone</a>. Ultimately, dropbear isn&#8217;t the SSH server we will stay with, it&#8217;s just easier to get it going first. After downloading it, extract it into ~/phonedmg/dropbear. We also need to create ourselves some SSH host keys which we can do by:</p>
<ol>
<li>Download <a href="http://matt.ucc.asn.au/dropbear/dropbear.html">dropbear source code</a></li>
<li>Do the normal ./configure &#038;&#038; make routine (no need to install, we just need one thing from it)</li>
<li>Generate the host keys via:
<pre class="brush: bash">
./dropbearkey -t rsa -f dropbear_rsa_host_key
./dropbearkey -t dss -f dropbear_dss_host_key
</pre>
</li>
<li>Copy these two files to your ~/phonedmg folder and then you can delete the dropbear stuff you downloaded in this part as it&#8217;s no longer needed</li>
</ol>
<p>With that completed, now let us upload the stuff to the phone. We do this by firing up iPHUC and following these steps:</p>
<ol>
<li>Upon running iPHUC, you should see something like the following (if you don&#8217;t, then leave a comment or contact me and hopefully I can help you):
<pre class="brush: bash">
localhost:~/phonedmg $ ./iphuc
iphuc 0.5.0
>> By The iPhoneDev Team: nightwatch geohot ixtli warren nall mjc operator
initPrivateFunctions: this is still not clean.  Architecture: i386
AMDeviceNotificationSubscribe: 0
CFRunLoop: Waiting for iPhone.
notification: iPhone attached.
AMDeviceConnect: 0
AMDeviceIsPaired: 1
AMDeviceValidatePairing: 0
AMDeviceStartSession: 0
AMDeviceStartService AFC: 0
AFCConnectionOpen: 0
AFCPlatformInit: (no retval)
notification: Entering shell in Normal Mode.
shell: Entering loop.
(iPHUC) /:
</pre>
</li>
<li>Now we need to tell iPHUC to use the special AFC by typing in &#8221; setafc com.apple.afc2 &#8220;. You should see something like the following:
<pre class="brush: bash">
(iPHUC) /: setafc com.apple.afc2
AMDeviceStartService AFC: 0
AFCConnectionOpen: 0
</pre>
</li>
<li>If that&#8217;s what you see, then do an ls and make sure you see things resembling a normal root filesystem path (/Applications, /usr, /System, etc). Again, if not, you got a problem.</li>
<li>Now let&#8217;s get some files in various places which we need. Execute the following commands:
<pre class="brush: bash">
getfile /System/Library/LaunchDaemons/com.apple.update.plist com.apple.update.plist.original
getfile /usr/sbin/update update.original
</pre>
</li>
<li>Now that we have originals of those files, we can upload our files to the phone by doing the following commands back in iPHUC:
<pre class="brush: bash">
putfile /Users/(your username)/phonedmg/dropbear/sh /bin/sh
putfile /Users/(your username)/phonedmg/dropbear/chmod /bin/chmod
putfile /Users/(your username)/phonedmg/dropbear/chmod /usr/sbin/update
putfile /Users/(your username)/phonedmg/dropbear/dropbear /usr/bin/dropbear
putfile /Users/(your username)/phonedmg/dropbear/au.asn.ucc.matt.dropbear.plist /System/Library/LaunchDaemons/au.asn.ucc.matt.dropbear.plist
putfile /Users/(your username)/phonedmg/dropbear/com.apple.update.plist.hacked /System/Library/LaunchDaemons/com.apple.update.plist
mkdir /etc/dropbear
putfile /Users/(your username)/phonedmg/dropbear_rsa_host_key /etc/dropbear/dropbear_rsa_host_key
putfile /Users/(your username)/phonedmg/dropbear_dss_host_key /etc/dropbear/dropbear_dss_host_key
</pre>
</li>
<li>Now we need to reboot the phone _twice_. The first time will set execute permissions on our binaries, the second time will actually start the ssh daemon (since it will now be executable). You do know how to reboot your phone, right?</li>
<li>Now we need to make sure SSH is working. First make sure you are associated with a wifi network on the phone and get the IP address (logically your laptop and phone need to be on the same wifi network). Then SSH to the phone using username &#8221; root &#8221; and password &#8221; dottie &#8220;. If all is well, then we will want to restore the update daemon back to normal. Do this via the following two commands in iPHUC:
<pre class="brush: bash">
putfile /Users/(your username)/phonedmg/com.apple.update.plist.original /System/Library/LaunchDaemons/com.apple.update.plist
putfile /Users/(your username)/phonedmg/update.original /usr/sbin/update
</pre>
</li>
<li>Now, before continuing any further, we need to secure the phone a bit. Since everyone who has hacked an iPhone (and many who haven&#8217;t) now knows your root password, let&#8217;s fix that. Run the following command in a normal terminal window:
<pre class="brush: bash">
perl -e 'print crypt("MYPASSWORD", "XX");'
</pre>
<p>Replacing MYPASSWORD with a password and XX with any random two letters (it&#8217;s the salt). The easiest way to replace the passwords is to do a &#8220;getfile /etc/master.passwd master.passwd.original&#8221; in iPHUC, edit both the root and mobile users&#8217; passwords, and the do a &#8220;putfile /Users/(your username)/master.passwd.original /etc/master.passwd&#8221;.
</li>
</ol>
<p>With that, this first part of the series is now complete. You have successfully hacked your iPhone and got an SSH server running on it. In the next part of the series, I will detail how to install a better SSH server, get basic unix commands on the phone, setup your toolchain/build environment, and then build and install a terminal GUI app on the phone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2007-08-05-howto-run-custom-apps-on-iphone-part-1.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
