Under the Bridge

Tools: Reverse Engineering

So let’s round up resources for reverse engineering iPhone executables today, just for grins, shall we?

If you’ve been around the Cocoa world for a while you’ve probably heard of class-dump, and there’s a version of it that’s iPhone-executable savvy called class-dump-x. That gives you class interfaces; if you want to dig directly into disassembling the code, your tool of choice is otx. If you want to dig around and see just what the environment is like at runtime, the usefully named Runtime Browser is your tool, source now up at Google Code.

And for digging through the output of an iPhone application or the system itself, don’t miss the invaluable iPhone/iPod touch Backup Extractor for turning opaque iTunes backups into individual files and SQLite databases just right for mucking with.

Here’s a selection of other useful tidbits and background:

How to classdump SpringBoard header files and patch it

Armchair Guide To Cocoa Reverse Engineering

Reverse engineering Apple’s OS X

[EDIT: Check out this post on reverse engineering system_profiler!]

Now, there should be just about nothing that can be kept a secret from you! Any other useful little tools or tidbits to suggest, anyone?

Continue Reading →
0

Tips: Site Design

Here’s a blog post worth reading if  you’re planning to make your website more iPhone-friendly than “yeah, installed WPTouch, there we go then”, like we’re going to get around to doing one of these days — no, really! — discussing how the dejal.com website looks so good on the iPhone. (Seriously, it does. Go check it out. A model for us all!) and most thoughtfully providing the CSS that enables all the nifty formatting discussed in this earlier post. Good stuff!

Continue Reading →
0

Social Platform: OpenFeint

Whoops, we’re really not on top of the iPhone gaming industry that well; we just noticed that a whole whack of the cool kids have put together a social networking platform for iPhone gaming called OpenFeint. And it has a bunch of nifty features:

  • cross-promotion between participating games
  • Facebook & Twitter integration
  • cross-game lobbies
  • leaderboards
  • game chat rooms
  • privacy controls

Whew! That’s quite the list. Now, I can see a few issues here, for starters how does their per registered user cost account for the 50% to 90% or so of users that seems to be the general consensus are pirates? — but since they say it’s free to join for free games, well, we’ll certainly look into trying this out with a free game sometime!

h/t: TechCrunch!

UPDATE: So ok, there’s a variety of social platform options! Let’s line them up:

Anyone have direct experience with any of these? And are we still missing any?

POSTSCRIPT: OTHER ROUNDUPS

09.06.17: scoreloop vs open feint vs plus+
09.07.13: iPhone Social Gaming Service Roundup
09.07.15: iPhone Social Platforms Compared
09.07.17: Social Platforms Revisited

Continue Reading →
3

Tools: Accessorizer

This looks like it might be a handy tool for the Xcode programmer: Accessorizer!

Accessorizer saves you tons of time … Those minutes add up  to hours, days and weeks over the lifetime of a project.

Accessorizer selects the appropriate property specifiers based on ivar type – and can also generate explicit accessors (1.0) automagically …  but Accessorizerdoes much, much more …

Accessorizer will help provide you with the init, keypath, keyed-archiving, indexed accessors, accessors for unordered collections such as NSSet, copyWithZone, KVO, key-validation, singleton overrides, dealloc, setNilForKey, non-standard attribute persistence (Core Data), locking, headerdoc, convert method to selector, NSUndoManager methods and more.

Well, it does sound handy, doesn’t it now. Anyone out there tried it? Worth the price you figure?

h/t: iPhone Development Blog!

Continue Reading →
3

Custom Fonts

So we have an occasion to be interested in embedding custom fonts in an iPhone application. Specifically, this DS-Digital font. It turns out that custom fonts are not quite as easy as one would hope to work with in an iPhone application. As a matter of fact, if you look around the ‘net, you’ll find opinions ranging from “it would be really hard” to “it’s not actually possible”, with people doing things like rendering fonts into UIImages to do that kind of thing since they can’t sort it out from the documentation. Yoiks! We’re looking for something rather more transparent than that! (Although we do note that the tool linked there would be quite handy indeed for using custom fonts in actual OpenGL work, like games … as would that author’s texture creator here.)

But fear not — although rather (unduly, in fact, someone less gracious than ourselves might observe…) challenging, it is, indeed, perfectly possible to use honest-to-goodness embedded CGFonts for text rendering in your iPhone app! To skip over lightly all the pitfalls, simply download this fine, fine piece of work which sorts out all the issues with a FontManager class to load the fonts and a FontLabel class to display them, with a CGFontRef-savviness category on NSString to help out … and:

fontsuccess

Sweet! The only trivial bit of trickery left to use it exactly as provided is to make sure that your font file name matches the font contained therein. Which the DOS-friendly filename from the above link didn’t, of course. But that is trivially corrected by double-clicking it in the Finder and reading off the name it displays.

So now that you know how, let’s round up sources of free fonts for your embedding joy, shall we? We focus on free sources here not because we’re cheap but because common license terms of commercial fonts are going to not be happy in the slightest with redistribution through application embedding. So unless you’re absolutely 100% sure that the IP lawyersharks aren’t going to hunt you down and feed on your entrails for unauthorized distribution of commercial fonts that you have bought, it behooves you greatly to only use fonts with freely redistributable license terms. Which we believe that you’ll find in abundance — or at least here and there — at these sites:

Any other sources of license-unencumbered embeddable fonts you care to recommend, Dear Readers?

Continue Reading →
14

Displaying PDFs

So if you want to display static content from HTML and PDF in your application, you probably know that it’s pretty easy to just throw the files into a folder and display them in a UIWebView something like this:

NSString *basePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/html/"];
NSURL *baseURL = [NSURL fileURLWithPath:basePath];
NSString *dataPath = [basePath stringByAppendingString:FILENAMEHERE];
NSString *dataType = [dataPath hasSuffix:@"pdf"] ? @"application/pdf" : @"text/html" ;
NSData *infoData = [NSData dataWithContentsOfFile:dataPath];
[infoView loadData:infoData MIMEType:dataType textEncodingName:@"UTF-8" baseURL:baseURL];

which works just fine, if your data is formatted nicely for iPhone display. Which for HTML is easy to sort; but it’s rather less likely that the PDFs you’re provided are suitable for iPhone display, they may be unduly large, inappropriate compression, yadayadayada. Well, here’s how you fix that quickly: just get the handy-dandy PDF Shrink desktop utility and apply iPhone-targeted compression settings. Convenient, yes?

Now, if you’d prefer a free alternative, or if you’re interested in perhaps putting programmatic conversion into a utility of your own, here is a useful walkthrough of creating a Quartz Filter to apply to exporting from Preview.app, which presumably you could apply from within your own code as well.

But if you really want your PDFs to get displayed professionally with table of contents and everything, here’s just your thing: The fellow who published the book ‘Scientific Scripting with Python’ exclusively on the App Store has very kindly provided a detailed walkthrough of constructing the application, formatting the document for the device, providing a table of contents … all with BSD-licensed open source!

If you decide to publish your own book using the source code, here is what you will need to do:

  1. Create a document like the one I made in Pages, with the same or similar page layout and text formatting.
  2. Generate a PDF from the document, and include it in the Xcode project.
  3. Change the value of the BKPDFFileName variable in BooksViewController.m to point to your PDF file.
  4. Change the data in the TableOfContents.plist file so the table of contents is correct.
  5. Double click the ‘Python’ target, and change the name to something suitable for your book.
  6. In the Build settings of the target, change the ‘Product Name’ setting.

That should cover most of it.

Sweet! Not that we have any actual full books to publish at the moment, but hey if we ever do we certainly know where to start!

Continue Reading →
0

Libraries: Mapping

So today, let’s pull together a roundup of all the mapping options for your iPhone development, shall we?

1) First off, you’re no doubt aware from posts like this that much of the Maps.app functionality is exposed to any developer through MapKit.framework in OS 3.0 — and for earlier versions you can do more or less the same working with iphone-google-maps-component as we mentioned ages ago. However, if you’re actually planning on making any money off it, the terms of service may very well be an issue, as discussed here. We’ll have to see how that works out.

2) As an alternative to Google, there’s VirtualEarthKit for Microsoft Virtual Earth, also discussed previously here. Unless there’s some specific reason to prefer this, it would seem the path of least resistance has definitely tilted toward 1) with the imminent MapKit.framework now, though.

3) There’s the commercial/free ad-supported option of mapNinja which we mentioned when released a couple months ago, which looks interesting but again probably superseded by official SDK developments.

4) The apparently most popular current option is the BSD-licensed route-me library which, yet again, we mentioned earlier, and can use a variety of sources.

5) And finally, one we actually have not posted about before! Yes, you were starting to wonder why a post with nothing but rehashes, weren’t you? Well, this one looks particularly interesting; the great folks at CloudMade, who wrap assorted useful functionality around OpenStreetMap, now have an iPhone Maps Library!

The iPhone Maps Library lets you build interactive mapping applications for the iPhone. With this API you can

  • Build applications that give users a rich mapping experience on the iPhone
  • Benefit from our tile servers which deliver mobile optimized maps to your users
  • Easily integrate with the iPhone’s location API to show your user’s position in real time

Just like our other APIs, we don’t want to restrict the uses of this API – you are free to create applications that use our maps in any way you like, as long as they comply with the terms of the iPhone SDK agreement. What’s more, this library is open source – so you are free to extend and re-use it as you want.

Well, that’s excellent, isn’t it? The reasonably friendly LGPL for the source license, can’t beat the CC-by-SA data license anywhere, and their API appears to have good documentation, examples, and most important of all, other people have already selected it to do cool stuff with; the apparently well-regarded Trails and OffMaps are reportedly both using the CloudMade library.

So there you go; as long as you’re targeting 2.x users, we’d say that CloudMade deserves to be at the top of your short list for implementation options, and depending on licensing terms, probably even if 3.0 dependence is OK.

‘Course, what we really want to do is get our own topo maps onto the device — come now, if you’re on a ROAD, how much do you really need a map for, after all? — so whenever we get around to seriously comparing libraries, pretty much our only criterion is “so how do we swap our own local tile provider in here then?” which the existence of OffMaps seems to indicate makes the CloudMade stuff the leading candidate for that too!

Continue Reading →
0

Tip: Code Signing

So, as you may have noticed if you’ve built iPhone apps for anyone other than yourself, it’s a bit of a challenge to coordinate program memberships, distribution certificates, yadayadayada. Wouldn’t it be convenient to just build the app using your own certificate and then have them sign the build for their devices, distribution, etc. on their own, without them having to trust you with their certificates and/or account access, or you adding their devices into your account?

Well, turns out that actually is possible — if you have a signing certificate of your own installed, you can take an arbitrarily signed binary you’ve been sent by whomever and overwrite its signature with your own. Handy, that, don’t you think? Here’s full details, and the man page, but the essence is simple: start up Terminal, and

export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate

to recognize iPhone ARM binaries, then simply cd into TargetApp.app and

codesign -f -s "iPhone Developer" -vv TargetApp

It’ll say

TargetApp: signed Mach-O thin (armv6) [TargetApp]

and that’s it, you now have a re-signed binary suitable for iTunes synchronization. Besides making builds with your certificate for other people to test without needless trust and/or inconvenience, this is also a handy way to test the final distribution build of your application before submitting to Apple, besides testing application binaries signed with any other certificate that you don’t have access to. Convenient, indeed!

h/t: xcode-users!

Continue Reading →
1

Tip: Tinted Buttons

Here’s a handy tip for creating custom colored buttons on the fly for your iPhone interface: don’t make them buttons at all, make them single segmented UISegmentedControls, and muck with the “tintColor” property. Ooh, shiny!

glassbuttons

And hey, there’s something you can apply that nifty color picker we mentioned to have your users customize your color scheme on the fly. Oh, the sartorial possibilities just stagger the imagination, don’t they?
[EDIT: Since UISegmentedControls don't work quite like buttons, following this tip will make your UI just that little bit off. But here is a much better way to make your buttons shiny!]

Continue Reading →
1

Free Books

Here’s an eminently bookmarkable site we hadn’t heard of before; E-Books Directory, devoted to listing free downloadable books:

E-Books Directory is a daily growing list of freely downloadable ebooks, documents and lecture notes found all over the internet. You can submit and promote your own ebooks, add comments on already posted books or just browse through the directory below and download anything you need.

With 1796 books and counting, there’s something for probably pretty much everybody, but we’d like to draw your attention in particular to the 338 books currently in the programming category. Not to mention the rest of the ‘Computers & Internet’ category, or the quite possibly useful to a programmer mathematics and engineering categories. Good stuff!

h/t: DZone!

Continue Reading →
0
Page 91 of 116 «...6070808990919293...»