Champagne and fireworks not your thing? Instead of partying it up this New Year’s Eve weekend, why not take the time to do a little hacking instead?
Every so often, we like to feature a “weekend project” here on ReadWriteWeb. These generally consist of the kind of things you’ll want to try out and play with when you have some free time, like over a weekend. Past projects have included things like hacking Nike+ for automatic Foursquare check-ins, a resource list on how to get started hacking Microsoft Kinect, experimenting with a customized, third-party version of Chrome OS called “Vanilla,” and more.
This weekend, we’ve decided to round up a few resources detailing how to peek inside your mobile applications.
Breaking into iOS Apps
Thanks to a guide we found on Appstorm, we discovered that you can “break into” your iPhone/iPad/iPod Touch applications, so you can see what’s inside of them. Why on earth would you want to do this? Well, Appstorm says it could be useful if you wanted to get to the content they contain – like video tutorials that are taking up more space on your phone than you would like, and that you want to watch on a larger screen. Or maybe there’s a soundtrack to a game that you want to grab and mix, mashup or turn into a ringtone.
Of course, you should proceed carefully here – that content doesn’t belong to you, and the rights associated with it should be observed.
However, we have a perfectly good reason you should try this out: because you can. And c’mon, fellow geeks – isn’t that good enough for you? Consider this a guide meant for “educational purposes only.” Something you learn about, not something you do because you want to steal code, music, videos, images or anything else an app contains.
A short how-to on the break-in process is below, but we recommend checking out the more detailed guide on Appstorm if you run into trouble. We added some tips for Windows users, too, since Appstorm only focused on Mac systems.
- Find your apps in iTunes, right-click on the app, select “Show in Finder” or in Windows “Show in Windows Explorer.” (Alternately, you can just navigate to the iTunes folder “Mobile Applications” to see your apps).
- Copy the app from its original location to somewhere else, like your desktop.
- Change the file extension from .ipa to .zip
- Unzip the file.
- On Mac, go into the Payload folder, right-click on the .app file and choose “Show Package Contents.” This will open a second Finder window showing everything contained in the app. On Windows, you can just double-click on the .app file to do the same (tested on Windows 7).
That’s it! You’re inside your app!
Breaking into Android Apps
Have an Android phone instead? There’s a similar – OK, slightly more tricky – procedure for breaking into Android apps. This procedure involves accessing the contents in the .dex file – the single file that contains all of an app’s resources, assets, code and its manifest file.
Again, may we remind you: educational purposes only!
- Locate the Android app on your computer and change the file extension from .apk to .zip.
- Unzip the zip file. (Alternately, you can use a program like 7Zip to open an .apk file).
- Inside the file contents, find the file classes.dex, this contains all the Java files, but it’s encrypted.
- To decrypt the file, download Dex2Jar from here and a Java compiler like JD from here. (Yep, we told you this was a bit harder).
- Copy classes.dex to the folder where you unzipped Dex2Jar and run from the command line: “dex2jar.bat classes.dex” – this will convert the classes.dex file to a JAR file.
- This creates a file with an odd name like classes.dex.dex2jar.jar.
- Launch JD decompiler.
- Open the classes.dex.dex2jar.jar file and view the .class files.
At least, those are the steps according to WebageSolutions. AndroidGuys says you can stop at #6 then just use WinRAR to open the file.
There’s also another method using a tool called apktool, hosted here on Google Code. This software is designed for reengineering Android apps. It can decode resources to nearly original form and rebuild them after making some modifications. As noted on the Google Code site, this tool is not meant for piracy or illegal uses, but can be helpful in “localizing, adding some features or support for custom platforms and other GOOD purposes.”
Or, you know, because you can?
To go this route instead, follow the detailed instructions on the project home page.
Whichever way you find easier, the end result is the same: you can break into your Android apps, too.
Some people don’t like when tutorials like this are posted online, because they could encourage piracy. But frankly, people who are going to pirate apps don’t need our help – they’ll find a way on their own. However, for budding developers – maybe those who want to try out Google’s DIY App Inventor, for example – being able to peer inside an app’s folders is a good first step in beginning to understand mobile software’s structure.
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.