Decompiling iOS Objective-C binaries [duplicate] - iphone

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
decompile an app binary to get back to source code
I've got an iPhone/iPad application, what is kinda interesting. It uses a special internal XML format for the stuff it does, but without a device, I can't see how it works. I want to recreate this function for Android phones (freeware and opensource maybe) but for that I would like to see how the reading part works, actually, I would like to know the XML format itself. It is very hard to re-create from scratch (using only the XML files) as they aren't commented and the names aren't telling anything particular about their function.
All I want to see is how the files are read, what specific tags do, etc, so I can write a converter to convert the iOS output files for my same purpose Android app. And yes, I've checked the Market, there's no such application like the one I want to recreate (and is actually almost totally recreated, I only need a converter or a parser for these iOS specific files).

The binary of all apps from the iOS App store, and on the filesystems of stock OS devices, is encrypted.
Try writing the authors of the app very politely, and see if they'll give or offer to sell you source code for the parser in which you're interested.

As noted here, you can get the assembly code, but you'll never be able to get the source code since there are an indefinite number of ways to represent the assembly.

Related

How can i access iPhone files via Objective-c?

I noticed that there is software (such as iExplorer) that allows you to access files on an iPhone-device from your Mac.
Now my question is: How can I access iPhone files via Objective-c?
This is only for educational purposes.
I found this: https://github.com/Chronic-Dev/libirecovery but I'm not sure if I'm on the right track.
So it seems that you're looking for an API which makes it possible to access the filesystem of the iPhone from a computer. Well, this API exists, and it's called the MobileDevice framework.
Unfortunately, there's no easy or legal way to access files on your iPhone, especially through Objective-C.
The applications installed on iOS are sandboxed, which means they can only access files in their own directory tree; they have no access/knowledge of other files.
Like you said, you can access files using software like iExplorer, but not programmatically from the iPhone itself.
Here is an old project to browse the iphone. You may be able to get some pointers from it on building an application to do the same with the latest info.
http://code.google.com/p/iphonelist/
Couple that with carbonic acid's post about the Mobile Device Framework and you should be able to do some good stuff.
if I find more unique info ill post it here.

iPhone .ipa and file extraction

I am writing an app for the iphone platform. My code is mostly C++ with some Objective-C code to interface with ios sdk apis. I am not very versed on iphone programming and this is my first app, so problem is that i need to read a binary file, using C++ code, containing some data but i don't kown how to do it. My concern is: can i use directly fopen/fread? Which path should i use? I come from Android development. The .apk is a simple .zip archive, so one just need to extract in memory the needed file and process it, or extract the file in a temporary directory and read it in the usual way, but i do not know how to to the same in the case of an iPhone application. Thanks.
I believe the core question you're asking has already been asked and answered. You want to read and write files, but aren't confident about how/where to do so: Write a file on iOS

Fortran Editor in iPhone

I want to make a Fortran editor in iPhone. User can code with Fortran in an iOS app and are also able to run that code on iPhone.
Can anyone guide me with correct approach?
I had a look to the gFortran, but its not available for ARM architecture.
Thankyou..
Apple doesn't allow for compilers or interpreters on the iPhone, but there technically isn't any reason you can't setup a server based compiler, that also allows users to run their compiled apps. In fact, there are multiple sites that already do just this, but it wouldnt be a good idea to write an app that points to their site or uses their services; you would need to setup your own service.
Not insurmountable, but I would move onto other app ideas.
Given Apple's snarly attitude about language interpreters running under iOS you're better off coding this as service that runs on a remote server, maybe with the editing part on the phone or tablet.
Updating this old thread for the sake of current and future searches:
Apple has changed their attitude over the past year or so. There are currently many interpreters available for iOS, including for Lua (https://itunes.apple.com/us/app/iluabox/id398073834?mt=8) and several for Python (https://itunes.apple.com/us/app/python-2.7-for-ios/id485729872?mt=8, http://itunes.com/apps/pythonmath).
One significant remaining restriction is that these apps may not load scripts from outside the app, for example, from Dropbox or iTunes file sharing. (This is part of Apple's efforts -- along with code signing and 100% app review -- to minimize malware.) Such apps are allowed to have an editor that allows the user to copy and paste code into the editor from outside the app.
As far as I know, there aren't any apps for compiled languages such as FORTRAN.
Meanwhile, FORTRAN compiler is available for iOS only as a jailbroken application.
[Disclaimer: I am the author of Python Math. Apple removed it from the store for a short time until I removed iTunes file sharing and "Open In..." capability. I then added a script editor.]

Some questions about the App Store review guidelines?

I've made some iphone webapps before, using jQTouch and iUI but now i want to try out making a native Apps for iPhone. As i first step i thought of trying to port one of my webapps using Phonegap. So far it works well, but i'm a little concerned about some things in the Apple Review Guidelines and wanted to see if anyone have prior experience and could answer som questions.
2.5 Apps that use non-public APIs will be rejected
2.6 Apps that read or write data outside its designated container area will be rejected
I'm not really sure what this means. I don't think they concern me but if anyone could give me som more info about it it would be nice.
2.7 Apps that download code in any way or form will be rejected
This one is more tricky. Do they consider HTML code? What my app does is to load content into DIV-tags using jQuery.load()-function, that means much of the work in the app is performed on my server. Will it be "safer" if i generate JSON or XML of the data and process it with JavaScript inside the app instead of loading the formated HTML-code?
2.12 Apps that are not very useful or do not provide any lasting entertainment value may be rejected
This one together with the quote:
If your App looks like it was cobbled together in a few days, or you're trying to get your first practice App into the store to impress your friends, please brace yourself for rejection. We have lots of serious developers who don't want their quality Apps to be surrounded by amateur hour.
Made me wonder what they consider a useful app and what lasting entertainment means. This is my first app and i dont aim for a broad audience, this is mostly a way to get to know the XCode, iPhone-development and the App Store review process before. However, the App will be really useful for me and a bunch of my friends.
2.6 Don't specifically try to access files outside your app's Bundle or Documents directory and you should be fine.
2.7 Somewhere, it explicitly says you can download and use HTML/CSS/Javascript as long as you are running it inside an iOS UIWebView container. But don't try to download, say, Lua source code at runtime and interpret it.
2.12 Don't waste the App store reviewer's time if you are just trying to "get to know" the app development or store distribution process. Read about it instead. Submit something only if you think there are people (not just your Mom) who will really want to download your app and not delete it after trying it out. Maybe at least a dozen to hundred someones. If not, distribute some Ad Hoc deployments to your buddys instead.

iPhone - Getting Started [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have found the "Getting Started" documents for developing apps on iPhone.
I wanted the community's opinion on what I should know/learn (in terms of languages or concepts)?
How long would it take for a moderate programmer to learn and build an app that manages a list, connects to certain websites, etc?
How to get an app I made onto the iPhone? Just ZIP then install with .ipa file?
I wanted the community's opinion on what I should know/learn (in terms of
languages or concepts)?
You will be using Objective-C and Cocoa. These are fairly strange concepts to crasp if you have not done MAC programming before, but after a short while you will probably fall in love with them. The most important concept to remember with iPhone development is memory management as the device has no concept of garbage collection.
How long would it take for a moderate programmer to learn and build
an app that manages a list, connects
to certain websites, etc?
Not too long. There are a multitude of example applications on the internet, and many helpful folk on stackoverflow.com
How to get an app I made onto the iPhone? Just ZIP then install with
.ipa file?
You will need to download the SDK, create an app using xcode on the mac (or similar environment for windows if there is one) - you can test with simulator without giving apple anything, but in order to legitimately test on device you need to become an apple developer.
However If you jailbreak your device, you will be able to follow one of several methods to get your application on the iphone bypassing apples restrictions.
The whole iPhone UI development (UITableView etc) is based around the MVC (Model-View-Controller) pattern, so a good understanding of that is vital.
Memory management is also vital and can be a little cumbersome to start off with. I have not long started so can not give you a good description here without making a fool of myself :). Apple Memory Management
Finally the development environment can be a little wierd to start off with. Especially hooking up the view controller and interface elements. So check that out.
Then its basically looking through the tutorials on the iPhone developer website and the internet to learn the intracacies of the different UI elements and controllers (tables, textboxes etc).
You will need to pay for the iPhone Developer program to legally use your iPhone to debug your applications (although the Xcode dev environment comes with a simulator). Submitting the application to the app store allows access by everyone. Full details for doing this are available after paying your money. There are other ways you can get apps on the iPhone but I will not provide details for doing that - search the internet.
I would say that looking through the documentation and following tutorials will get you far enough to start building applications. This should not take to long. A good book may also help you out here, try the iPhone Developers Cookbook, which gives good well discussed and broken down examples about specific issues and broader coverage of things like tables etc.
Objective-C. Pay close attention to memory management, i.e., retain, release and autorelease.
Took me about a month (part time) to get something that pretty much worked. And then another month to refactor after learning what I'd done wrong the first time. This was while the NDA was in place so it would probably be easier now.
You need to join the iPhone Developer Program. Installing a development app is just a matter of running from XCode once you have you certificates sorted. (Check the iTunes Connect documentations. It's pretty good.)
Installing on someone elses iPhone is a matter of figuring out ad-hoc deployment (hard) or uploading to iTunes (easy).
First of all: buy a mac if you don't have one already, the windows tooling pipeline is basically non-existant. And trying to run OSX on non-apple harware is illegal in most situations.
Download the iPhone SDK. http://developer.apple.com/iphone/ should have everything you need.
Objective-C is a little bit on the strange side but a moderate programmer should be able to pick it up quite quickly.
Installation: i have no idea sorry...use the app store ;)
Learn objective C and work with Cocoa. There are far more examples of that floating around than iPhone code. Depending on what environment you are used too, Xcode and the experience of developing for the iPHone can be quite a change so get ready to buy some books and spend lots of time scratching your head!
Learn how to navigate Apple's docs.
For example UIView Class Reference.
Took me a little while to get savvy. XCode also has an excellent documentation browser integrated into the IDE. Once you can translate what the docs are telling you into code, the whole API opens up.
Use the Research Assistant in XCode. (Under Help Menu) That thing rocks my world. Highlight a class like ABRecordRef and it will give you a quick synopsis of what it is and how to use it, with links to the reference docs.
The one bad thing about Apple's docs is that they don't have clear examples of how to call a method in the discussion of the method. This is a glaring oversight, IMO. So many time I just wish there was a simple example for how to use something and I wind up going to Google for it.
The above information is quite good, but I'd add that getting familiar with the documentation within XCode is very valuable. This means you need to go to the DOC SETS part of the Developer Documentation window and make sure you have the documentation for the iPhone OS you're coding for. I spent a bunch of time writing code that depended on methods in NSObject that are available in Cocoa but not on the iPhone OS.