iOS IPA Re-packagin /重新签名AppStore应用程序

前端之家收集整理的这篇文章主要介绍了iOS IPA Re-packagin /重新签名AppStore应用程序前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
问题描述

我需要在iOS设备上控制任意应用程序,我的计划是向IPA注入可执行文件(实现远程控制逻辑),然后重新打包它.

由于应用程序应在受控环境(特定设备)中运行,因此我计划将我的配置文件与我的开发证书一起用于重新打包/签名.

首先,我试图重新打包第三方应用程序没有注入任何代码,这是通过以下方式完成的:

1. Unzip the existing IPA
 2. Copy the provisioning profile to %APP_NAME%.app/embedded.mobileprovisioning
 3. export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate"
 4. signcode --force --deep -s "%Dev Cert Name%" "%Path/To/APP_NAME%.app"
 5. zip the re-signed code back together

Above对于我使用Xcode手动构建的应用程序非常有用,但是,当使用从AppStore下载的IPA时,这不适用于以下设备日志错误

<Debug>: AppleFairplayTextCrypterSession::fairplayOpen() Failed,error -42112

检查应用程序的’Mach-O’可执行文件,我已经验证相关体系结构的“代码签名”部分已完全更改(通过’signcode’工具).

问题

>为什么我不能重新打包我从AppStore下载的应用程序,而我手动创建w / Xcode的应用程序成功重新打包/签名?
>如何使用我的开发证书和&amp ;;重新打包/签署AppStore应用程序配置文件
> FairPaly如何区分我手动制作的应用程序(使用Xcode)和从appstore下载的应用程序? appstore应用程序有哪些残差,手动制作的应用程序没有?

参考

> https://stackoverflow.com/questions/25737711/ios-undocumented-api-using-uiautomation-framework-on-ios7
> http://macsecurity.net/view/55/
> https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/codesign.1.html

解决方法

来自AppStore的应用程序不仅仅是签名,binary is also encrypted.

App Store binaries are signed by both their developer and Apple. This encrypts the binary so that decryption keys are needed in order to make the binary readable. When iOS executes the binary,the decryption keys are used to decrypt the binary into a readable state where it is then loaded into memory and executed. iOS can tell the encryption status of a binary via the cryptid struture member of LC_ENCRYPTION_INFO MachO load command. If cryptid is a non-zero value then the binary in encrypted.

猜你在找的Xcode相关文章