iOS Enterprise:使用新证书重新认证现有 IPA

发布于 2024-12-19 22:52:04 字数 209 浏览 4 评论 0原文

我们已加入 iOS 企业计划。用于我们发布的应用程序的配置文件即将过期,因此我获得了新的证书和配置文件。

我需要使用新的配置文件重新分发我们的一些应用程序,而无需重新构建它们。如何?

(我依稀记得看到一个实用程序正是这样做的:您选择一个 IPA 和一个配置文件,它将使用新的配置文件和证书创建一个新的 IPA。该工具的名称是什么,我在哪里可以获得它?)

We are enrolled in the iOS Enterprise Program. The provisioning profile used for our released apps is about to expire, so I got a new certificate and provisioning profile.

I need to re-distribute some of our apps with the new provisioning profile, without building them anew. How?

(I vaguely remember seeing a utility program that did exactly this: You choose an IPA and a provisioning profile, and it would create a new IPA using the new profile and certificate. What was the tool’s name, and where can I get it?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

小嗲 2024-12-26 22:52:04

理论上,无论谁在 XCode 中构建了最后一个 IPA,都应该使用 Archive - 这会创建一个构建,您可以通过签名来创建 IPA(使用 XCode)。

您还可以尝试使用命令行签名工具XCRun对现有IPA中捆绑的应用程序进行重新签名:

http://skabber.com/package-your-ios-application-with-xcrun

In theory whoever built the last IPA in XCode should have used Archive - this creates a build you can sign to create an IPA (using XCode).

You could also try using the command line signing tool XCRun to re-sign the App bundled in your existing IPA:

http://skabber.com/package-your-ios-application-with-xcrun

江挽川 2024-12-26 22:52:04

好吧,事实证明,当您知道Google 的术语时,就会发现有很多优秀的资源…

它们都指向xcrun。我使它与这个 shell 片段一起工作,改编自

APP_FILENAME=MyApp.app
BUILD_DIRECTORY=/Path/To/Target/Dir
IPA_FILENAME=MyApp.ipa
DISTRIBUTION_CERTIFICATE='iPhone Distribution'
PROVISIONING_PROFILE_PATH='/Path/To/Profile.mobileprovision'
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "$APP_FILENAME" -o "$BUILD_DIRECTORY/$IPA_FILENAME" --sign "$DISTRIBUTION_CERTIFICATE" --embed "$PROVISIONING_PROFILE_PATH"

OK, turns out when you know what term to google, there‘s lots of excellent resources…

They all point to xcrun. I made it work with this shell snippet, adapted from this promising build script:

APP_FILENAME=MyApp.app
BUILD_DIRECTORY=/Path/To/Target/Dir
IPA_FILENAME=MyApp.ipa
DISTRIBUTION_CERTIFICATE='iPhone Distribution'
PROVISIONING_PROFILE_PATH='/Path/To/Profile.mobileprovision'
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "$APP_FILENAME" -o "$BUILD_DIRECTORY/$IPA_FILENAME" --sign "$DISTRIBUTION_CERTIFICATE" --embed "$PROVISIONING_PROFILE_PATH"
萤火眠眠 2024-12-26 22:52:04

iOS SDK 工具中包含的 codesign 命令行实用程序将允许添加/更改开发人员构建的应用程序签名所用的证书和配置。

The codesign command-line utility, included with the iOS SDK tools, will allow adding/changing the certificate and provision with which a developer built app is signed.

何时共饮酒 2024-12-26 22:52:04

正如 hotpaw2 的 anwaswer 所说。您还可以使用协同设计工具辞职。

我这样做的方式(这可能不是最有效的,但它有效)

  1. 将 .ipa 重命名为 .zip 并解压

  2. 运行以下:

    /usr/bin/codesign -f -s "iPhone 发行版:公司名称" "Payload/MyApp.app"
    
  3. 重新压缩 Payload 文件夹并重命名为 .ipa

注意:您还可以使用此方法来编辑 embedded.mobileprovisioning 文件!如果您使用 finder,请记住删除 .DS_Store (rm Payload/.DS_Store)。

As hotpaw2's anwaswer states. You can also resign using the codesign tool.

The way I do it (this may not be the most efficient, but it works)

  1. Rename the .ipa to a .zip and extract

  2. Run The following:

    /usr/bin/codesign -f -s "iPhone Distribution: Company Name" "Payload/MyApp.app"
    
  3. Re-zip the Payload folder and rename to .ipa

Note: You can also use this method to edit the embedded.mobileprovisioning file! Just remember to remove the .DS_Store (rm Payload/.DS_Store) if you are using finder.

谈下烟灰 2024-12-26 22:52:04

如果您只是按照以下步骤从同一帐户退出应用程序,则可以采用手动方式

所有这一切都使用 shell 脚本,并且非常简单,只要您知道如何使用 shell 命令。

  1. 重命名 IPA 以 zip
  2. 将此文件解压到临时文件夹
  3. 从所有目标中删除旧的 _CodeSignature 文件夹(如果您有多个目标,如 main、watch、watch extn、siri、widget、message 等)
  4. 将所有目标 prov-profiles 放在一个文件夹中并将每个目标的所有embedded.provisioningprofile文件替换为新文件,
  5. 删除存档的....xccent文件,因为这是旧的(可选)
  6. 代码符号,其中包含为所有权利创建的entitlements.plist如果应用程序使用了任何内容。
  7. 代码签名后将文件夹压缩回来,一切顺利,没有错误
  8. 将 zip 重命名为 IPA

注意:要在上传到 Apple 之前验证 IPA,您可以使用内置 XCode App Loader 中的 altool 来检查新的 IPA 。

参考:命令的步骤也解释如下:
http://www.enterpriseios.com/forum/topic/Resigning_3rd_party_apps

如果您愿意要摆脱手动签名,请使用 fastlane 工具,因为它非常简单且易于配置。https://fastlane.tools/

You can do manual way if you just resigning app from same account with following steps.

All this is using shell script and super easy provided you know how to use shell commands.

  1. Rename IPA to zip
  2. unzip this file to temp folder
  3. Remove the old _CodeSignature folder from all targets (if you have multiple targets like main,watch, watch extn, siri, widget, message, etc)
  4. bring all the targets prov-profiles in one folder and replace all the embedded.provisioningprofile files for each target with the new ones
  5. remove the archived....xccent file as this is old one (optional)
  6. code sign with the entitlements.plist created for all the entitlements if any used by the app.
  7. Zip the folder back after code sign all okay with no errors
  8. Rename the zip to IPA

Note: To validate the IPA before upload to apple you can just use the altool from inbuild XCode App Loader to check the new IPA.

Reference: The steps for commands is also explained here:
http://www.enterpriseios.com/forum/topic/Resigning_3rd_party_apps

If you want to get rid of manual sign use the fastlane tool as its quite simple and easy to configure.https://fastlane.tools/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文