brandontreb.com Tips And Resources For Software Consultants

Beginning Jailbroken iOS Development – Getting The Tools

Developing for jailbroken is actually quite similar to regular iOS development with one addition. More Power! oh oh oh (said in a Tim Taylor voice (sorry for non-Americans that don’t get the reference)). With your device jailbroken, you have the ability to hook in to pretty much every class that Apple writes allowing you quite a bit of control over the iPhone’s functionality.

In today’s tutorial, I will simply be discussing the best way to get up and running with the tools necessary to write a jailbroken iPhone app. We will not be doing any coding, however this tutorial will be necessary for all posts going forward.

Theos

There are many ways to go about writing a jailbroken iOS app. Most of them are quite complex. @DHowett has come up with a brilliant tool called theos which drastically simplifies the process. My tutorial will pretty much be a regurgitation of his tutorial found here with some added cheesy jokes.

Theos is a command line utility that essentially generates a template for creating applications, libraries, preference bundles, tools, and mobile substrate hacks. These cover 99% of the jailbroken apps that you are likely to create.

One thing to note is DHowett talks about doing jailbroken iOS development on both Mac and Linux; my tutorials will be Mac-only.

Step 1: Install the iOS SDK

You will first need to install the official iOS SDK.

http://developer.apple.com/devcenter/ios/index.action

You can register for a free account and download the latest SDK. Once installed reboot your Mac and come back here. I’ll wait…

Step 2: Setting Up The Environment Variables

Start by deciding on a good location to install theos. The suggested location is /opt/theos. The only issue with doing it here is you will need to have administrator permissions as well as have to enter your password when updating files. For teaching purposes, I am going to assume you will install it here too.

Open the terminal and type:

<code class=’bash’>export THEOS=/opt/theos</code>

What we are doing is setting an environment variable. You can always see if this variable is set by typing echo $THEOS in the command line. It will need to be (re)set every time you reopen the terminal to develop a jailbroken app.

Step 3: Getting theos

DHowett uses subversion for version control on theos, so you need to make sure and have it installed. If you followed step one above, it should have been installed by default. We will be checking out theos into the THEOS directory specified in step 2.

In the terminal type:

<code class=’bash’>svn co http://svn.howett.net/svn/theos/trunk $THEOS</code>

You most likely will be asked for your password. You should now see the /opt/theos directory created with theos installed.

Step 4: Getting ldid

We now need to install the ldid tool. ldid is a tool written by Saurik (if you don’t know who he is, stop reading now). Basically, it simulates the signing process for the iPhone, allowing you to install your jailbroken apps/hacks on an actual device.

You can find this tool in many places, however DHowett has generously hosted it for us on his dropbox account.

Now, I had a tricky time getting this to download directly to my /opt/theos folder. So, I downloaded it to my desktop and then moved it in to /opt/theos/bin/ldid

<code class=’bash’>curl -s http://dl.dropbox.com/u/3157793/ldid > ~/Desktop/ldid
chmod +x ~/Desktop/ldid
mv ~/Desktop/ldid $THEOS/bin/ldid</code>

Alternatively, if you can get it to work properly, do it like DHowett suggests and download it directly into place.

<code class=’bash’>curl -s http://dl.dropbox.com/u/3157793/ldid > $THEOS/bin/ldid; chmod +x $THEOS/bin/ldid</code>

Step 5: Install dpkg

Dpkg is a tool to bundle up your app into a Debian package for distribution in a Cydia repository. You can install it through Macports.

<code class=’bash’>sudo port install dpkg</code>

Step 6: Creating A New Project

theos uses a tool called nic (new instance creator) to create a new project. Simply run nic by typing:

<code class=’bash’>$THEOS/bin/nic.pl</code>

and it starts the new instance creator. Here is a sample of making a jailbroken application.

<code class=’bash’>brandon-trebitowskis-macbook-pro:Desktop brandontreb$ $THEOS/bin/nic.pl
NIC 1.0 - New Instance Creator
——————————
  [1.] iphone/application
  [2.] iphone/library
  [3.] iphone/preference_bundle
  [4.] iphone/tool
  [5.] iphone/tweak
Choose a Template (required): 1
Project Name (required): FartLight
Package Name [com.yourcompany.fartlight]: com.brandontreb.fartlight
Author/Maintainer Name [Brandon Trebitowski]: 
Instantiating iphone/application in fartlight/…
Done.</code>

This will create a new folder with a basic template called fartlight (killer project, I know). In addition to the usual files it will contain a Makefile (for building the application) and a control file (information about the application when it’s in a Cydia repository).

This should now give you the basis for creating a jailbroken application/tweak/hack. In the next tutorial we will go over building, signing, and deployment. For now, you can check out the project I created with nic called inPulseNotifier. It’s a combination of a tweak (5) and a preference bundle (3) for the app settings.

Feel free to ask me a question in the comments and check out #theos on IRC.

Update Check out the next tutorial in this series here.

Happy coding!

Jailbroken iPhone Development – Would You Be Into It?

As of recent I have had a ton of interest in doing development for Jailbroken iPhones. I love the power, being able to hack anything on the device. It opens up a whole new world of possibilities.

My most current project (inPulseNotifier) is a Mobile Substrate hack which allows the iPhone to interface with an inPulse watch. It uses BTStack and boots up during the init method of your springboard. I will do a full writeup on this in the near future, but basically it forwards all of your phone’s notifications (SMS, Local, Push, Calendar) to your watch!

Serious Lack Of Resources

InPulseNotifier was a blast to create, however I found it incredibly challenging to find many resources about doing jailbroken development. I finally found theos which was a total lifesaver. Also, I had the code for mobileNotifier to follow along with.

IRC (yeah I’m a true hacker ;)) was also huge help, but there simply aren’t enough tutorials/examples on the web related to jailbroken iPhone dev. My guesses are either 1. it’s quite hard, 2. there’s not enough <font color”green”>$$$</font> in it, or 3. jailbreakers like to stay “underground”.

I haven’t quite figured it out, but I was curious what YOU thought about it as I’m considering doing some jailbroken iOS development tutorials on my blog. Please let me know in the comments. Are you down to “Hack the planet”?

Officially Running On Jekyll

Well, I have finally made the switch from WordPress to Jekyll and couldn’t be happier. Here are some of the bonuses I have seen thus far.

  1. SPEED: Just click around on my site. It is screaming fast now.
  2. Resources: Checking top on my server reveals that I have a TON of extra resources (which makes sense since Jekyll sites are way more lightweight).
  3. Ease of blogging: Ok, WordPress was pretty easy too, however, I was really starting to get sick of the post interface. I switch to Tumblr at some point simply for it’s minimalist interface. WordPress’ is gross and TinyMCE (the WYSIWG editor) is terrible. I love writing in TextMate!
  4. Offline publishing. I can write my posts anywhere since they are just .md (markdown) files. Check out Daring Fireball’s great writeup on this.
  5. Portability: Have you have tried to move your WordPress site? Yeah, it’s about as fun as chewing on tin foil with metal fillings.
  6. Focus on content: WordPress has quite a bit of focus on using rich media in your posts which tends to take away from the content if you are not careful. There is something about writing in a text editor that makes you forget about images/video/etc… unless it’s totally needed. So don’t be surprised if my posts aren’t as “rich”. (Hopefully they will be more clever :) )

I really urge you to see for yourself what it’s like blogging with Jekyll. I will do a writeup on my conversion process in the near future to help aid others in the switch. Until then, you can google around and find tons of great resources.

Considering Leaving WordPress For Jekyll

So, after my 6 year relationship with WordPress, I have been having some strong feelings for another (blog engine). Jekyll does everything that I want my wordpress to do.

  1. Not suck at security
  2. Not be bloated
  3. Not have a sucky post editor
  4. Expense – I have a few blogs hosted on Rackspace and my bill has gotten pretty pricey. I’m hoping to host my Jekyll site on App Engine for frizzle (free).

That’s about it. In case you live in a box (which most of us do since most houses are relatively square) and haven’t hear of it, Jekyll is a new blogging engine written in Ruby. Simply put, you write posts, run a command and it spits out static pages. You just upload these pages to your server (how old skool right?) Now you no longer have a dependancies on any server side language, fancy server configs, etc…

Jekyll has no(minimal) features, no comments, track backs etc… and no built-in SEO. It doesn’t even have an admin (since you are serving up static content). Sounds like a blast right? I’ll blog a bit about it as I make the migration and you will see, it’s going to be great!

I just finished reading this post from Hacker News, which was pretty much the nail in the coffin.

Huge Update To Smart Lockscreen Creator + Promo Codes

I have just updated Smart Lockscreen Creator and am giving away 10 copies!

Download It Here

I know you probably aren’t reading this as you race to see if any of the promos aren’t taken but…

Here is what’s new:

Misc

  • Added ability to generate a new image on startup. Just turn Auto-Start on in the settings

Weather

  • Toggle Fahrenheit and Celsius
  • Added missing weather images
  • Updated weather icons
  • Improved performance and stability of retrieving weather

Customization

  • Customize separator color and height
  • Customize which day of the week to highlight for a calendar
  • Ability to customize the background color of each widget

Minor Bug Fixes

The Promo Codes

METL6KNXW6TL
TWFHLKT7RYWK
J6JXJ7JPNJRN
XLP9FF9RAEA9
L74ATPTYXJ4F
A6KJPTLWE97P
HNWP6L7F6JW9
XEHNFKJPMR6Y
MFH3MNHKXF3A
FENRH4M9PAEA

Please leave a 5 star review :)

Download It Here