从 .ipa 或可执行文件中提取 Xcode 项目文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15651970/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:46:41  来源:igfitidea点击:

Extract Xcode project file from an .ipa or executable file

xcode

提问by Ramu Pasupuleti

Is there any way to extract an Xcode Project file from an .ipa (executable file)?

有没有办法从 .ipa(可执行文件)中提取 Xcode 项目文件?

I tried the following:

我尝试了以下方法:

Make a copy of the .ipa file and change .ipa to .zip. Double click on the Payloadfolder and open project folder. Right-click on that folder and select Show Package Contents.

复制 .ipa 文件并将 .ipa 更改为 .zip。双击Payload文件夹并打开项目文件夹。右键单击该文件夹并选择Show Package Contents

Everything seems to be okay, but I want to see the code, which is now showing as executable files. Is there any tool or any way to achieve this?

一切似乎都没问题,但我想看看现在显示为可执行文件的代码。有没有任何工具或任何方法可以实现这一目标?

采纳答案by Sebastian

The .ipa file contains, as you have noticed, your compiled project. So no, you can't get the Xcode project file or the source code. (Unless of course, someone deliberately copied those files in).

如您所见,.ipa 文件包含已编译的项目。所以不,您无法获得 Xcode 项目文件或源代码。(当然,除非有人故意复制这些文件)。

回答by Stuart M

No, you can't convert a compiled executable back into source code.

不,您不能将编译后的可执行文件转换回源代码。

An .ipais an archive of a compiled iOS application, containing the compiled executable plus any resources (images, property lists, etc.). You can't easily translate compiled code back into the human-readable source code that produced it, and you certainly cannot get the Xcode project file that defined the build process for the app. While there are machine code disassemblers out there, they will only give you rough approximations of the original code and can lose valuable information such as the original variable names, comments, etc.

An.ipa是已编译的 iOS 应用程序的存档,包含已编译的可执行文件以及任何资源(图像、属性列表等)。您无法轻松地将编译后的代码转换回生成它的人类可读的源代码,而且您当然无法获得定义应用程序构建过程的 Xcode 项目文件。虽然有机器代码反汇编器,但它们只会为您提供原始代码的粗略近似值,并且可能会丢失有价值的信息,例如原始变量名称、注释等。

回答by Dmitri R117

Actually, you can unpack it and see a lot of included files that may be helpful. For me, I needed to see what cordova version and cordova plugin version were in the .ipa file.

实际上,您可以解压缩它并查看许多可能有用的包含文件。对我来说,我需要查看 .ipa 文件中的cordova 版本和cordova 插件版本。

After you use XCode to export a previous submission, change the .ipa file to .zip. Inside "Payload" directory right click on your app name and click Show Package Contentsand voila.

使用 XCode 导出以前的提交后,将 .ipa 文件更改为 .zip。在“Payload”目录中,右键单击您的应用程序名称,然后单击Show Package Contents,瞧。

To see the cordova version navigate to www/cordova.js, you will see PLATFORM_VERSION_BUILD_LABEL

要查看cordova 版本,请导航到www/cordova.js,您将看到 PLATFORM_VERSION_BUILD_LABEL

For plugins, check the very BOTTOMof the file cordova_plugins.js

对于插件,检查文件的最底部cordova_plugins.js

Thanks to oxdaily.com for the tip about converting to zip file.

感谢 oxdaily.com 提供有关转换为 zip 文件的提示。

回答by hariszaman

Yes Stuart is right we cannot extract the code from its binary so easily the reverse engineering process is very hard to do and even if done it has a lot of complication and the code is not exactly in the same form and more importantly not understandable

是的,斯图尔特是对的,我们不能轻易地从它的二进制文件中提取代码,逆向工程过程很难做到,即使完成它也有很多复杂性,而且代码的形式并不完全相同,更重要的是无法理解