简体   繁体   English

在32位设备上以不同的权利重新签名iOS应用失败

[英]Re-sign iOS app with different entitlements fails on 32bit devices

I've got this idea whereby I want to build my app once on our build server, and distribute it to multiple environments before finally landing in the iTunes store. 我有一个想法,我想在构建服务器上一次构建我的应用程序,然后将其分发到多个环境,然后最终登陆iTunes商店。

One of the issues I'm running into is entitlements. 我遇到的问题之一是权利。 If I copy the $ENVIRONMENT.plist entitlements into the app, and re-sign with it, the app will install and run as expected on a 64bit device . 如果我将$ENVIRONMENT.plist权利复制到应用程序中,然后重新签名,则该应用程序将按预期在64位设备上安装并运行。 The issue I have is the fact that the doesn't run on a 32bit device (ARMv7 / ARMv7S), and because it was originally built for Ad-Hoc (HockeyApp), it doesn't carry the beta entitlements. 我遇到的问题是,它们不能在32位设备(ARMv7 / ARMv7S)上运行,并且由于它最初是为Ad-Hoc(HockeyApp)构建的,因此不包含Beta版权利。

So essentially I have different plist files for different environments 所以本质上我在不同环境下有不同的plist文件

dev.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>XXXXX.com.mydomain.mobile</string>
    <key>keychain-access-groups</key>
    <array>
        <string>XXXXX.com.mydomain.mobile</string>
    </array>
    <key>get-task-allow</key>
    <false/>
</dict>
</plist>

prod.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>XXXXX.com.mydomain.mobile</string>
    <key>keychain-access-groups</key>
    <array>
        <string>XXXXX.com.mydomain.mobile</string>
    </array>
    <key>get-task-allow</key>
    <false/>
    <key>beta-reports-active</key>
    <true/>
</dict>
</plist>

I then copy the plist files over during deployment, and attempt to re-sign 然后,我在部署过程中复制了plist文件,并尝试重新签名

cp $ENVIRONMENT.plist "${APPFOLDER}/Entitlements.plist"
/usr/bin/codesign -f -v -v -s "$CERTIFICATE_NAME" --entitlements="${APPFOLDER}/entitlements.plist" "${APPFOLDER}/Payload/$APPNAME.app" 
pushd ${APPFOLDER} 
zip -qr ~/Desktop/Archive/$ENVIRONMENT_NAME/$APPNAME-$APP_VERSION.ipa Payload
popd

When I do that approach, I can launch the app on an iPhone 6+ without issue, but when I try to launch the app on an iPhone 4S or iPhone 5, I get a startup crash without any crash logs. 当我采用这种方法时,可以毫无问题地在iPhone 6+上启动该应用程序,但是当我尝试在iPhone 4S或iPhone 5上启动该应用程序时,会出现启动崩溃,而没有任何崩溃日志。

What is the right way to re-sign an app with different entitlements for different environments? 在不同的环境下重新签名具有不同权利的应用程序的正确方法是什么? Again, the crash only occurs on 32bit devices, 64bit runs as expected even after resigning. 同样,崩溃仅发生在32位设备上,即使退出后64位也可以按预期运行。

EDIT: 编辑:

If I just build the app using Visual Studio and don't unpack/update/resign, then the app works as expected on all platforms. 如果我只是使用Visual Studio构建应用程序,而没有解包/更新/辞职,则该应用程序将在所有平台上都能正常工作。

EDIT: 编辑:

Here is the only error output I can get. 这是我可以获得的唯一错误输出。 It's from the XCode Device Console. 它来自XCode设备控制台。

Jul  7 11:01:02 Company-iPhone-4S SpringBoard[48] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Jul  7 11:01:02 Company-iPhone-4S SpringBoard[48] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Jul  7 11:01:02 Company-iPhone-4S SpringBoard[48] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Jul  7 11:01:02 Company-iPhone-4S securityd[86] <Error>:  secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul  7 11:01:02 Company-iPhone-4S securityd[86] <Error>:  secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul  7 11:01:02 Company-iPhone-4S amfid[312] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Jul  7 11:01:02 Company-iPhone-4S securityd[86] <Error>:  secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul  7 11:01:02 Company-iPhone-4S securityd[86] <Error>:  secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul  7 11:01:02 Company-iPhone-4S amfid[312] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Jul  7 11:01:02 Company-iPhone-4S kernel[0] <Notice>: xpcproxy[359] Container: /private/var/mobile/Containers/Data/Application/877013A4-BF2A-4AC9-8CEA-1598EA2CD336 (sandbox)
Jul  7 11:01:02 Company-iPhone-4S com.apple.xpc.launchd[1] <Error>: assertion failed: 13F69: launchd + 85529 [083E000D-4C31-3B98-A2C4-6FADB4D1940F]: 0x3
Jul  7 11:01:02 Company-iPhone-4S MyCompMyAppMobileiOS[359] <Warning>: Found new TLS offset at 176
Jul  7 11:01:02 Company-iPhone-4S MyCompMyAppMobileiOS[359] <Warning>: The assembly mscorlib.dll was not found or could not be loaded.
Jul  7 11:01:02 Company-iPhone-4S MyCompMyAppMobileiOS[359] <Warning>: It should have been installed in the `/Users/builder/data/lanes/3412/3cf8aaed/source/maccore/builds/install/target7/lib/mono/2.1/mscorlib.dll' directory.
Jul  7 11:01:02 Company-iPhone-4S com.apple.xpc.launchd[1] (UIKitApplication:com.MyComp.mobile[0x3eca][359]) <Warning>: Service exited with abnormal code: 1
Jul  7 11:01:02 Company-iPhone-4S SpringBoard[48] <Warning>: Application 'UIKitApplication:com.MyComp.mobile[0x3eca]' exited voluntarily.
Jul  7 11:01:03 Company-iPhone-4S kernel[0] <Notice>: xpcproxy[360] Container: /private/var/mobile/Containers/Data/Application/877013A4-BF2A-4AC9-8CEA-1598EA2CD336 (sandbox)
Jul  7 11:01:03 Company-iPhone-4S com.apple.xpc.launchd[1] <Error>: assertion failed: 13F69: launchd + 85529 [083E000D-4C31-3B98-A2C4-6FADB4D1940F]: 0x3
Jul  7 11:01:03 Company-iPhone-4S MyCompMyAppMobileiOS[360] <Warning>: Found new TLS offset at 176
Jul  7 11:01:03 Company-iPhone-4S MyCompMyAppMobileiOS[360] <Warning>: The assembly mscorlib.dll was not found or could not be loaded.
Jul  7 11:01:03 Company-iPhone-4S MyCompMyAppMobileiOS[360] <Warning>: It should have been installed in the `/Users/builder/data/lanes/3412/3cf8aaed/source/maccore/builds/install/target7/lib/mono/2.1/mscorlib.dll' directory.
Jul  7 11:01:03 Company-iPhone-4S com.apple.xpc.launchd[1] (UIKitApplication:com.MyComp.mobile[0xc803][360]) <Warning>: Service exited with abnormal code: 1
Jul  7 11:01:03 Company-iPhone-4S SpringBoard[48] <Warning>: Application 'UIKitApplication:com.MyComp.mobile[0xc803]' exited voluntarily.

note: I have re-generated my distribution profile so that it has the beta stuff in it, and I'm using sigh to grab the latest copy of my provisioning profiles. 注意:我已经重新生成了分发配置文件,以便其中包含Beta版内容,并且我感叹不已地获取了我的配置文件的最新副本。

note: The reason for resigning is that I have some XML config that points the app to different servers per environment (dev, test, production), and it gets updated before resigning. 注意:辞职的原因是我有一些XML配置,该配置将应用程序指向每个环境(开发,测试,生产)的不同服务器,并且在辞职之前进行了更新。

I'd like to make one thing clear: the codesign is just to create a signature to verify that every byte within the .app file is exactly the same as when it was signed by it's creator (specified by the signing identity). 我想澄清一件事:codesign只是创建一个签名,以验证.app文件中的每个字节与它的创建者对其签名(由签名身份指定)完全相同。 So theoretically this should have nothing to do with which platform the app is deployed on. 因此,从理论上讲,这与应用程序部署在哪个平台上无关。

And I also want to understand your scenario more clearly: Do you want to test your app through TestFlight or just for ad-hoc testing via HockeyApp? 我还想更清楚地了解您的情况:您要通过TestFlight来测试您的应用程序还是仅通过HockeyApp进行即席测试? Since the beta entitlement is only a requirement for beta testing through TestFlight. 由于Beta权利仅是通过TestFlight进行Beta测试的要求。 It also has nothing to do with your crash on 32bit platform. 它也与您在32位平台上发生的崩溃无关。

Then for your issue, my suggestion is: 那么对于您的问题,我的建议是:

1) Check your app's configuration, especially its target platforms to verify whether ARMV7 is supported; 1)检查您应用的配置,尤其是其目标平台,以验证是否支持ARMV7;

2)Test your app via Xcode to exclude any other signing/profile issues. 2)通过Xcode测试您的应用,以排除其他任何签名/配置文件问题。 This can verify whether your app could work correctly both on 64 bits and 32 bits in development mode. 这可以验证您的应用在开发模式下是否可以在64位和32位上正常工作。

3)Last and most important, it would be appreciated to attach the error log created both from Xcode output or from the device during the deploy. 3)最后也是最重要的一点是,将在部署期间附加从Xcode输出或从设备创建的错误日志,将不胜感激。 It would be of great help for the trouble shooting. 这对于排除故障很有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM