I hacked Doodle Jump!

Ok, so… nobody had hacked the high scores on Doodle Jump (iTunes link) yet, (as far as I can tell) so… I decided to give it a shot. I knew they’d have scores hashed before sending over the internet, and all this other stuff that would be a waste of time to try and crack, so I just went for manually setting my score in memory. Turns out… it works! There’s not really an easy way for them to stop it. Which kinda stinks, so please don’t abuse this hack like I did and post dumb messages on the All Time scoreboards.

Anyway, they probably won’t leave my score up there for long if they find out I may have slightly broken the rules. So catch it while you can, the name is “blog.aaronash.c”, the .com is cut off :( .

If they take it down and ask me to stop hacking Doodle Jump for the All Time high score, I’ll do it. Probably…

“Pics or it didn’t happen”

Update Janurary 25, 2010, 14:14 EST: They apparently took it down already. :( Nice response time.









Smoothboard – Source and Explanation

If you haven’t seen my Smoothboard tweak yet, check it out on the BigBoss repo. It eliminates SpringBoard’s pages, allowing you to scroll through all your icons with one swipe or stop in between pages.

The code for this tweak is extremely short, but I’ve found it’s quite useful. Thanks to the Logos/Theos framework by Dustin Howett, using mobile substrate is much less of a hassle.

So what am I waiting for? Here’s the source!

%hook SBUIController
– (id)init {
%orig;
[[[MSHookIvar<UIView *>(self, "_iconsView") subviews] objectAtIndex:1] setPagingEnabled:0];
return self;
}

What!? It’s like, 8 lines! Yeah, that’s right.

So what’s going on? How does this work? It doesn’t look like other MobileSubstrate code! Well, that’s because the Theos/Logos framework does all the dirty work to get things going. After you run make it’ll fix it up to look like normal MS tweaks.

So what does this code do?

%hook SBUIController

Ah, nice. See how easy that was? That line hooks the SBUIController class. Much easier than how you’d have to do it without Logos.

- (id)init {

This hooks the init method, allowing you to rewrite your own. In Smoothboard we actually want to run the original method, then make a small change with SpringBoard’s scroll view.

%orig;

This calls the original method. See how easy that was? Logos makes things very neat.

[[[MSHookIvar<UIView *>(self, "_iconsView") subviews] objectAtIndex:1] setPagingEnabled:0];

Ah, here we go. That was the bulk of the tweak. What does it do? It finds the instance variable called _iconsView in SBUIController, then grabs the second view in it’s subviews (which is a scroll view) and turns off paging. That’s it, the whole tweak is just flipping that switch. But we’re not done yet, we need to return something since the method requires that we do so.

return self;

Returns self, the original _iconsView.

And that’s it! If you thought writing MobileSubstrate tweaks was hard, you were wrong. (Ok, nevermind, actually most of the time it’s pretty hard. This is probably the easiest tweak ever). Anyway, you can’t really use or compile this code with Logos. (Well you could, but you’d have to tweak it).

When I first wrote Smoothboard I used the above code, but it has become apparent to me that there’s an even better way to disable paging, and it should work even if Apple updates/rearranges SpringBoard. Here is what you’d do:

%hook SBIconListScrollView
-(void)setPagingEnabled:(BOOL)enabled {
%orig(NO);
}
%end

Basically what this should do is always call setPagingEnabled:NO, even if it’s told to enable it.

So, head over to the Logos homepage and check it out!

New Wordpress Theme!

I’ve been meaning to change my theme from the default Wordpress one to something a bit cooler. This theme is called “Piano Black” and I’m hoping I’ll stick with it.

I found this theme here: http://wordpress.org/extend/themes/piano-black

Learning IDA

Just recently I found some handy scripts that help in reverse engineering iPhone binaries. KennyTM wrote the scripts, check out his blog post on it here: http://networkpx.blogspot.com/2010/01/two-ida-pro-5x-scripts-for-iphoneos.html

Picture: http://grab.by/1Vn6

Let’s hope I find something interesting!

multifl0w now on Rock!

I have just released the first version of multifl0w on Rock! There is a free 10 day trial. Check it out!

Posted a multifl0w video! – an iPhone multitasking interface

I’ve been working on a multitasking interface for the iPhone for the past couple of weeks, and I now have something to show for the work that I’ve done. Check out the video here: http://www.youtube.com/watch?v=YrGLGoB88So (or below).

I plan on putting this up for sale on the Cydia store within a few days, if not sooner. I’d love to hear any comments anyone might have on it.

Tweet about this using #multifl0w hashtag!
I’ll be tweeting about my progress on this, follow me for updates: twitter.com/aaronash

Edit: I just posted a shorter video, check it out here: http://www.youtube.com/watch?v=e-jcclXaUk4

How to Make iPhone apps on any OS, on the iPhone itself, for free

Yep, that’s right. Now let’s clear up some questions. (By the way, I’m doing all this from Windows 7 RC). There are several other tutorials that show how to do this, but most of them were quickly written with little or no explanation. I try it explain things a little bit more here, if you have any more questions you can comment at the bottom. I suggest you read through this post (and probably the comments too) before you actually start so you know what’s ahead of you.

Do you need to be apart of the Apple Developers program?

Nope.

Do you need to pay $100 to Apple to run YOUR app on YOUR phone?

Nope.

Do you have to have a mac?

Nope.

What about hackintosh?

Nope.

Does this cost money?

Nope.

Do you have to jailbreak your iphone?

Yep.

What do I have to know to do this?

Some basic unix commands, how to ssh, how to ctrl-c ctrl-v (copy/paste), maybe some basic objective C knowledge (you can learn as you go, that’s what I’m doing), how to use google.

What do I need to do this?

An ipod touch/iphone, (jailbroken, this guide is for iphone OS 3), a wireless AP, a computer on the same network as your iphone. (actually not required, I think you could do this whole thing without a computer except the jailbreaking part).

Here’s the general idea:

1. Jailbreak iphone.

2. Install open toolchain, get headers, get various Cydia packages

3. SSH into your iphone, code an app, compile and install the app, test it!

4. There is no step 4, it’s that easy.

5. This is the 5th and final step. On this step you learn Objective C, the iphone APIs, how to code, whatever. (Just make apps!).

Ok, so what’s the catch?

There is no catch!

Ok, well maybe some minor drawbacks, but nothing too big. You can’t use .nib or .xib files created by interface builder on a mac, because the open toolchain can’t use/compile them. This is no big deal, really. It just requires a bit more coding, and some people that develop with the Apple SDK do this anyway. You’ll be fine.

The other “catch” is that you can’t submit apps to the app store. But, you can to a Cydia repo!

Ok, lets get started. But first, so we don’t have a holdup waiting for the super huge download later, go a head and download the latest Apple SDK. We will extract the headers out of this. (Or, you can find them on the internet somewhere – it is technically illegal to host them, but you can download them from Apple legally. This is what I did.)

1. Jailbreak your iphone.

Sorry, I’m not going to tell you how to do this, it’s on the internet. Use google. I assume you’ve already done this.

2. Install stuff from Cydia

Here we start getting to the good stuff. You may be wondering, “How the heck is this going to work!?” and the answer is simple: hackers!!

<rant>
That is, hackers in the intended use of the word (see this). Not the people that go around and “hack” into your computer and steal passwords. These people have extended the functionality of the iPhone, and are willing to share it with you for free.

Why? Because that’s the way the iphone should be. Your iPhone is a full blown computer, and it can and should be used that way. You should be able to get to the command line. You should be able to write your own apps. You should be able to customize the way your computer phone looks. You should be able to ssh into your phone. You should be able to write a better Stocks app, a better email app, a better SMS app, a better tethering app, a better camera app, a video camera app (period), a better browser app, a better maps app, a better settings app, and even YOUR OWN app, for free. If there’s an app, you should be able to make it, and make it better. And, for free. After all, it’s your phone. It’s not Apple’s phone, it’s not AT&T’s phone, it’s your own darn phone. Do what you want with it.
</rant>

(edit) Thanks to “ziffer” for reminding me that another package needs to be installed before the full iPhone 2.0 toolchain can be installed. It is called “fake-libgcc”, as an “official” libgcc package has not been released for 3.0, but the toolchain can still be installed on the iphone anyway. (I found this here: http://modmyi.com/forums/iphone-ipod-touch-sdk-development-discussion/655111-compiling-iphone-3-0-a.html#post4898409)

I have uploaded a mirror of the package on my site, just in case the original creator moves/removes the package from his dropbox. You can install this package by running the following commands (on the iphone, either ssh into it or use the mobile terminal, you must be logged in as root):

wget http://aaronash.com/iphone/fake-libgcc_1.0_iphoneos-arm.deb
dpkg -i fake-libgcc_1.0_iphoneos-arm.deb

If you type the first command in and it says “command not found”, then you don’t have wget installed. Search for it on Cydia. So anyway after you have installed “fake-libgcc”, open up Cydia and download the following packages:

  • iPhone 2.0 Toolchain – This is the important one!!
  • MobileTerminal (if you haven’t already)
  • OpenSSH

Those 3 packages alone should get you going. After you install the iPhone 2.0 Toolchain package, there will be many more packages installed because the open toolchain depends on them. The Mobile Terminal is not technically needed, but it can be quite useful.

Here are some packages that are handy for development, though not necessarily required:

  • Vi IMproved
  • nano
  • wget
  • adv-cmds
  • shell-cmds
  • top
  • Tape Archive

You should now be able to compile a basic C program, so lets check it out and make sure! (This is a fun part, but not required).

  1. SSH into your iphone. If you’re on Windows I recommend PuTTy. This is most easily done by going on the same WiFi network as your iphone and find it’s IP address by typing ifconfig in the Mobile Terminal (if you have that package installed) or by simply loading up SBSettings (if you don’t have it installed, I would HIGHLY recommend it, open it by sliding your finger accross the little bar on top) and looking at the WiFi ip address you see there. Also, you can find it by going to Settings > WiFi > YourSSIDName (tap the blue arrow) and that screen will show it. The first ssh might take a bit because the iphone is generating some crypto keys and it’s a tad bit on the slow side. Login as root, the default password is ‘alpine’. Change it using the passwd command.
  2. After you’ve ssh’d into it, type these commands:

    echo ‘int main(int argc, char *argv[]) { printf(“Hello, iPhone!\n”); return 0; }’ > test.c
    gcc test.c -o test
    ldid -S test
    ./test

    After you run the “gcc test.c -o test” test part it may say something like:

    test.c: In function ‘main’:
    test.c:2: warning: incompatible implicit declaration of built-in function ‘printf’

    But this is ok, it still works for some reason. (It should, it does on mine).”
    After you run ./test it should print out “Hello, iPhone!”. Congrats! This is exactly what we want. You just compiled a C program ON your iPhone. Now THAT is cool stuff.

    (If you had some weird problem, it may have been because you copied and pasted it. If it doesn’t work type it up by hand into the terminal and you shouldn’t have any problems).

  3. That’s it! You have gcc working on your iphone. Now you’re ready for a native Objective C app, or code in normal C.

Since we’re still technically on step two “Install open toolchain, get headers, get various Cydia packages” we might as well go ahead and grab the headers. This part isn’t so much fun, unless you find somewhere that they’ve already been ripped and uploaded (hint hint). Otherwise, go download the Official Apple SDK (it’s like, 2GB), and save it somewhere. Also install 7-zip. Then open it with 7-zip and keep clicking until you find where they are, check out this post if you’re going to do this manually. (Also, you can check out this).

3. SSH into your iphone, code an app, compile and install the app (this is done on the phone itself), test it!

  1. SSH into your phone. Also, for easy file transfer, you probably want to use something like WinSCP. It’s a great program, I’d recommend using it.
  2. Download our Hello World program code, here: http://aaronash.com/iphone/HelloWorld.zip
  3. Unzip it, (you can use 7-zip) and then drag/drop it to your iphone. I keep all my code in /var/root/Code, it’s a good place to keep everything.
  4. In your SSH session (or even on the mobile terminal) cd into the directory you copied the code to. “cd /var/root/Code”
  5. Type “make”.
  6. Type “make install”.
  7. Wait for Springboard to reboot.
  8. Test the app!

If it works, great! You just compiled an app on your iphone, for free. How dare you.

4. There is no step 4, it’s that easy.

Actually there is a step 4, and that is to remember everything you did, backup your work, tell someone else how to do it, and take a break.

5. This is the 5th and final step. On this step you learn Objective C, the iphone APIs, how to code, whatever. (Just make apps!).

Self explanatory, I hope you’ve made it this far and you can start coding for your iPhone. If you have any problems, just use google or post here. Good luck!

Saving streamed/downloaded files – the cool way

Sometimes I see a video, song, or other streamed object I want to easily save, but even good firefox plugins can’t rip them. Maybe the video is hard-coded into the swf and there’s no easy way to rip it out, or an online radio station plays a song I like that I want to save for later. But a good firefox plugin can do that right? Sometimes, but not always. A guaranteed way to save everything that comes to you over the wire is simple – rip it straight out of the TCP stream!

Here’s how you do it:

  1. Load up Wireshark and start capturing packets.
  2. Go to the page with your video/song on it and refresh it, so that your browser will download the media again.
  3. Wait for it to fully download, then stop the capture in Wireshark.
  4. Save the capture somewhere as a .pcap file. (Your media is in there, now you just have to rip it out).
  5. Load it with Network Miner. (File>Open)
  6. Click the Files tab. (This shows all of the files that were transferred during the capture, exactly what we want!)
  7. Find your file in the list, organizing it by Size makes it easier to find.
  8. Right click on it and choose “Open Folder”. This will shows where it was extracted to on your computer.
  9. There it is! Copy it somewhere handy and rename it so you know what it is.

The only downfall to this method is that Nework Miner only works on Windows. I’m sure there are probably linux equivalents out there though.

Network Miner can also find other nifty things, like passwords, DNS info, Hosts, and other things. Play around with it, it’s a really nice tool.

Note: This can indeed be used to save songs downloaded by Pandora (or similar sites) for later use. I’m not sure about the legality of doing this however, so don’t do it. (Unless you know it’s legal).

Wordpress!

“Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!”

So, what’s the first thing I should blog about? How easy it was to install wordpress!

As I expected, installing wordpress was a breeze. My current webhost (1and1) makes it fairly easy to setup a MySQL database, and this subdomain (blog.aaronash.com) didn’t take long to setup either. I was going to use my dreamhost account because they had an easier one click install for wordpress, but I didn’t take the time to setup blog.aaronash.com to forward to dreamhost’s servers.

If you’re ever interested in starting a blog, so far my experience with Wordpress has been excellent. It has a solid reputation and I’m sure it’ll live up to my expectations.

Return top

Hey!

My current favorite hobby is iPhone development for jailbroken phones. I hope you enjoy my blog!