【问题标题】:Resigning appstore exported IPA's with development certificate使用开发证书退出应用商店导出的 IPA
【发布时间】:2018-01-08 00:13:33
【问题描述】:

问题

是否可以使用开发证书和配置文件为 AppStore 导出/提供 IPA?

我可以进行实际的辞职,并且经过手动验证,一切似乎都很好,但是我在启动时尝试此操作的任何应用程序都崩溃了。我不想退出从 AppStore 下载的应用程序,这些是在我的计算机上构建的应用程序。

似乎也没有一种流行的工具能做到这一点。有没有人成功过,或者由于某种原因不可能?

调查结果

在设备日志中,我没有看到 App 进程本身报告的任何内容,因此操作系统必须在启动之前将其杀死。我确实看到了:

securityd[101] <Notice>: cert[0]: CheckLeafMarkerOid =(leaf)[]> 0
securityd[101] <Notice>: cert[0]: SubjectCommonName =(leaf)[]> 0
securityd[101] <Notice>: cert[0]: IssuerCommonName =(path)[]> 0
amfid(Security)[196] <Notice>:  [leaf CheckLeafMarkerOid IssuerCommonName SubjectCommonName]
amfid(libmis.dylib)[196] <Info>: Blacklist does not exist.
amfid(libmis.dylib)[196] <Info>: Using empty blacklist.
amfid(libmis.dylib)[196] <Info>: CreateMISAuthListWithStream: open stream failed (may be non-existing)
amfid(libmis.dylib)[196] <Info>: CreateMISAuthListWithStream: creating empty auth list
assertiond[66] <Notice>: Unable to obtain a task name port right for pid 1683: (os/kern) failure (5)
SpringBoard(FrontBoard)[57] <Error>: Unable to register for exec notifications: No such process
SpringBoard(BaseBoard)[57] <Error>: Unable to get short BSD proc info for 1683: No such process
SpringBoard(BaseBoard)[57] <Error>: Unable to get proc info for 1683: No such process
SpringBoard(BaseBoard)[57] <Error>: Unable to obtain a task name port right for pid 1683: (os/kern) failure (0x5)
SpringBoard(BaseBoard)[57] <Error>: Unable to get short BSD proc info for 1683: No such process
SpringBoard(FrontBoard)[57] <Error>: Unable to obtain a process handle for <FBApplicationProcess: 0x10bc26cd0; com.company.product.name; pid: 1683>

这似乎表明权利存在问题。但是,当我从我安装的 IPA 手动打印它们 (/usr/libexec/PlistBuddy -x -c "print :Entitlements " /dev/stdin <<< $(security cms -D -i "$1"/embedded.mobileprovision) > entitlements.plist ) 时,我有:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>application-identifier</key>
        <string>TEAMID.*</string>
        <key>com.apple.developer.default-data-protection</key>
        <string>NSFileProtectionComplete</string>
        <key>com.apple.developer.team-identifier</key>
        <string>TEAMID</string>
        <key>get-task-allow</key>
        <true/>
        <key>keychain-access-groups</key>
        <array>
                <string>TEAMID.*</string>
        </array>
</dict>
</plist>

这清楚地表明get-task-allow 权利是true

工具

无论我尝试哪种工具,我都会得到相同的结果,例如

类似问题

更新 1

(对@Yoshkebab 的反应)

otool 的输出表明二进制文件未加密: otool -l App/Payload/App.app/App | grep -A 4 -i encrypt:

          cmd LC_ENCRYPTION_INFO
      cmdsize 20
     cryptoff 0
    cryptsize 0
      cryptid 0
--
          cmd LC_ENCRYPTION_INFO_64
      cmdsize 24
     cryptoff 0
    cryptsize 0
      cryptid 0

但是,例如Hopper 无法反汇编... 有没有参考苹果在 Xcode 中应用加密?这是否表明他们在用户的系统上有一个密钥?此外,我没有看到可以表明这一点的构建步骤(代码设计只是添加签名,不是吗?)

Clutch 看不到我的应用程序,并且 Stefan Esser 的 dumpdecrypted 库无法工作,因为我怀疑应用程序立即崩溃(我的设置没问题,因为它适用于其他应用程序)。

【问题讨论】:

  • 您仅使用 plistbuddy 打印配置文件中的权利,要在应用程序本身中查找权利,您需要使用 codesign -d --entitlements - [path to app binary]
  • 提供配置文件的权利是用于对二进制文件进行签名的权利,因此在签署后两者的输出将(应该)相同。
  • 你不能。确保您看到 herehere

标签: ios xcode code-signing provisioning-profile entitlements


【解决方案1】:

AppStore 签名的应用程序不仅由开发者的证书签名,而且二进制文件也由 Apple 的私钥加密。 因此,您可以辞职应用程序,但除非您解密二进制文件,否则您将无法运行它们。 查看二进制文件的 LC_ENCRYPTION_INFO 加载命令(最简单的方法是使用MachoView),如果看到标记 Crypt ID != 0,则二进制文件已加密。

假设它是,你仍然可以这样做,这有点乏味,你需要一个安装了应用程序的越狱设备。

  1. 使用 SSH 连接到您的设备。使用gandalf 的最简单方法
  2. 获取 Clutch 并将其安装在您的设备上 - 按照他们的说明进行操作(我发现编译它的最简单方法是更改​​包名称)
  3. 将解密的应用转储到新的 IPA 中(Clutch -d "YOUR_PACKAGE_ID")

现在你有一个可以辞职的解密 IPA

【讨论】:

  • 在开发者为 App Store 导出时,您是否有任何关于 Apple 应用 DRM 的参考资料?上传后他们在云端执行此操作是否有意义?我将更新我的帖子,提供有关加密等的更多信息。
猜你喜欢
  • 2015-05-13
  • 1970-01-01
  • 1970-01-01
  • 2019-02-27
  • 2014-05-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多