How to use Xcode to open decrypted IPA contents - iphone

I have a decrypted IPA file. How do I use Xcode to open the contents of this file and make code modifications to it?

An IPA is just a zip file containing a "Payload" folder, which in turn contains the app bundle. As such there is no code in an IPA - just the compiled executable. You can unzip it and look in the "Payload" folder, but all you'll see is executable code. You could possibly disassemble the code (don't ask me how - I've never tried such a thing), but if you need to do that I wonder why you don't have access to the source in the first place...

You can't get the source from an IPA file. It's an executable. See Stack Overflow question
Is it possible to reverse-engineer my iPhone application?.

Xcode compiles apps from Objective C to machine code, then they are packaged with all the other resources (images, nibs) into an IPA file. So you can't get it back to source code, only machine code.

Related

How to copy files in iPhone /var/mobile/Container/Data/Application/Document

I develop a test app for iPhone which needs to read some file. In simulator I copied those files showed by NSSearchPathForDirectoriesInDomains. Now I try to run the same app in iPhone and it is showing /var/mobile/Containers/Data/Application/ED49734D-0E61-4BB4-B3CC-D462F3BF9215/Documents/
location, but I don't know how to put my files in Documents folder so it can be read by my app.
Please help
To copy your files, you need to:
Make sure your iPhone is jail-braked (otherwise, you wont be able to access this folder)
Install tweak from Cydia: Apple File Conduit "2" (this is version for iOS 8/9)
Transfer files with one of the following PC tools:
iTools
iFunbox
Hope this helps

ipa file contains illegal characters?

I am trying to upload an ipa file (written in Swift) to our MDM console (AirWatch). The console is .Net, and when I try to upload I get a message saying the path contains illegal characters. The path does not, and I can upload other ipa files to MDM, so I'm left with something wrong with the ipa itself. The MDM software reads the IPA when it's uploading it to determine version and other information. Anyone got any ideas?
-MJC
I've found that one of the folders embedded in the .ipa file has the 'cross' character (hex=10, ascii=16, DLE) in the 'LaunchScreen.storyboardc' folder.
This can be seen by opening the .ipa file using 7zip in Windows.
When we remove this folder using 7zip, Airwatch accepts the ipa file.

Upload iOS build online

I am uploading ios build on testflight till now. But I am getting the following error on uploading any build (I also tried uploading the previous build again which I already uploaded on it).
Invalid IPA: Couldn't find executable specified in Info.plist - check the value of your CFBundleExecutable key.
I need to upload the build. Can someone suggest me a site other than testflight where I may upload the ios build or ipa file?
The other site you can use is http://diawi.com, i use it on my project now, very helpfull.
We had a problem with CFBundleExecutable ${EXECUTABLE_NAME}. Our iOS app was for example called OurAppName.
Ran fine in Simulator but when archived and deployed via organizer said CFBundleExecutable was not an executable file.
We checked the plist and the value for CFBundleExecutable was 'ourappname'. we unzipped the ipa > app folder (see how below) and there was a fie called ourappname but it was smaller than expected and not a exe (USE:ls -l should have x at end of -rwxr-xr-x ).
Bug was caused by a text file called 'ourappname' and when archive was built it took that as the exe and not OurAppName. Answer was to rename and or delete the file with same name as our exe. Do full clean build. and recheck final ipa.
To see contents of OurAppName.ipa :
Rename to OurAppName_ipa.zip (ignore warnings):
DOUBLE CLICK on OurAppName_ipa.zip to open (creates Payload folder containing OurAppName.app):
rename OurAppName.app to OurAppName_app (ignore warnings will change app bundle to folder).
Open OurAppName_app folder look for ...info.plist for app.
Check CFBundleExecutable is pointing to OurAppName.
Find OurAppName in folder do ls -l make sure it executable (USE:ls -l should have x at end of -rwxr-xr-x).
TIP FOR TEST FLIGHT:
If testflight download fails after 80% with UNABLE TO DOWNLOAD then drag the archive you built to a iOS device using Organizer.
Click on Device > applications and + at the bottom (i think dragging the ipa to the device in the organizer installs it as well).
in your info.plist file open as source code form and check CFBundleExecutable key is there or not and make sure it is written as
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>

How to install a Ad Hoc provisioning app on windows itunes?

I drag the .mobileprovision and app.zip file in the list of applications in itunes, I also get add-cursor, but if release the mouse-button nothing happens. the list is still empty, whats wrong?
The only way I know to do this is to get the .app file in Mac, put it into a folder called "Payload". Then you have to ZIP this folder and change its name from "Payload.zip" to "MyAppName.ipa". Mac will ask if you are sure you want to change the extention, select "YES". Now you can drag and drop this file into itunes.
There's no other way to do it afaik. Windows makes problems with the macosx "fork" files (if you open the .app file there is a folder named "_MACOSX" or similar... and windows breaks this).
Unzip the app.zip. You will get a folder, e.g. MyApp.app. Now drag that folder into iTunes and it should be ok.
As mentioned - unzip it, but don't forget to drag the .mobileprovision too
If that doesn't work, check back in your provisioning so it's set to the right device.
Common mistake.
http://www.markj.net/iphone-ad-hoc-distribution-windows-mac/
You can save all this trouble though, but making a zip archive in the first place that doesn’t have the Mac resource fork. BetterZip is a handy Mac app that will do this for you. That preferences setting ‘Remove Mac specific stuff from archives’ keeps __MACOSX out of the zip, and the resulting zip will install on Mac and Windows. Another way to do this is to unzip in windows yourself, find the correct app folder, and re-zip.
Ive had this problem before. I'm pretty sure there can be no white spaces in the name as well... double check that before you try to add it.

Problem installing ad-hoc app on iphone: "resources have been modified."

I can install an app on my development iPhone compiled with "Debug" configuration using my Ad Hoc provisioning and everything works OK.
But when I build it using "Release" configuration, iTunes says:
The application XXX was not installed on the iPhone "YYYY" because its resources have been modified.
I've never seen this message before. Does anybody know what it means?
Thanks!
Antonio
We had the same problem during our first Beta. Someone on Windows dug in the xxx.app folder then Explorer created a Thumbs.db file inside and, boom, he got the message "The application XXX was not installed on the iPhone "YYYY" because its resources have been modified." when he tried to install.
He had to remove the app from iTunes, deleted all the Thumbs.db from xxx.app and then it worked.
We finally got rid of the problem. We were trying to include an image for iTunes after creating the build, but when we used this method (http://iosdevelopertips.com/xcode/itunes-icon-for-ad-hoc-distributions.html) everything went smoothly.
Just in case it helps someone: In my case, I copied the .app to a network drive, then to my Win7 computer before dragging into iTunes - then it did not work. When I zipped the .app first before copying, and then unzipped it on the other end - it worked. Of course, I have no real idea why....
Your debug configuration and your release configuration have some important differences, and release is a lot closer to what ad-hoc should look like. So you first need to duplicate the release configuration and make and call your copy "Ad-Hoc", and make sure you use your ad-hoc provisioning profile with it. Then you need to create a new entitlements file. The new version of Xcode has a cool feature where you can build and archive your app into an ipa file that includes your provisioning profile.
How to do all of this is explained here: http://www.tuaw.com/2010/05/23/devsugar-a-better-way-to-share-ad-hoc-builds/
In those instructions, when it tells you to make the entitlements plist file, it says to uncheck get-task-allow in the plist file. When I created the entitlements file, there wasn't a get-task-allow row at all, so I created one, set the type to boolean, and left it unchecked. It worked great for me.
The best solution to avoid wierdness like this is to create an IPA file. A good step-by-step guide to creating an IPA target in XCode is here:
http://idotcomllc.wordpress.com/2009/05/26/how-to-build-a-ipa-file-from-xcode/
It starts out with an introductory project so search for "Aggregate" to find the point where it starts telling you how to create a new IPA target for build.
I directly upload the app to a server where the windows can also visit. Then compress it in Windows.
I had it, did a clean build and never saw it again.
Incomplete ipa/zip archives (received at the installation end) were the cause for us.
I had this problem using a run script to cp -R the .app file to the Payload folder, for some reason when the script copied the file it modified it somehow, if I used finder and manually copied the .app file into the payload folder and manually zipped the .ipa file it worked fine. I tested it several times using codesign -v to verify the .app file. it always through the error after a build and the run script. but no error when I would copy the file manually.
For me the issue was the .Double files being added to every directory on a shared network drive. We are primarily a Windows environment, and the Mac was saving .Double file on the drive, in every directory.
Literally, to fix the issue referenced above, I simply deleted the .Double files in every directory (of the app being copied to iTunes) and it fixed it.
Hope this helps someone!
I was tasked to test some apps and for some reason was the only one on my team getting this this error. I am working on an XP. All the apps we are testing use the same provisioning file yet some would sync while others would not. Not sure what fixed it but I did go into my *My Music\iTunes\iTunes Media\Mobile Applications* folder, deleted the existing .ipa file for the app I was trying to sync and it seemed to sync fine after. It might not be the answer to your problem but give it a try.
If you work with asstes on a Mac, or have versioned content, I had the same problem with .DS_Store files and hidden .git folders. Once deleted from assets, problem gone. It might be an issue with hidden files.