在32位设备上重新签署具有不同权利的iOS应用程序

时间:2016-07-04 15:57:33

标签: ios xamarin.ios entitlements hockeyapp

我有这个想法,我想在我们的构建服务器上构建我的应用程序,并在最终登陆iTunes商店之前将其分发到多个环境。

我遇到的一个问题是权利。如果我将$ENVIRONMENT.plist权利复制到应用中并使用它重新签名,该应用将按预期在64位设备上安装并运行。我遇到的问题是,它不能在32位设备(ARMv7 / ARMv7S)上运行,并且因为它最初是为Ad-Hoc(HockeyApp)构建的,所以它不具备beta权利。

基本上我对不同的环境有不同的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>

然后我在部署期间复制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

当我采用这种方法时,我可以毫无问题地在iPhone 6+上启动应用程序,但是当我尝试在iPhone 4S或iPhone 5上启动应用程序时,我会在没有任何崩溃日志的情况下发生启动崩溃。

对于不同环境,使用不同权利重新签署应用的正确方法是什么?同样,崩溃仅发生在32位设备上,即使在辞职后也会按预期运行64位。

编辑:

如果我只是使用Visual Studio构建应用程序并且不解包/更新/辞职,那么应用程序将在所有平台上按预期工作。

编辑:

这是我能得到的唯一错误输出。它来自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.

注意:我已重新生成了我的分发配置文件,因此其中包含测试版内容,并且我使用sigh来获取我的配置文件的最新副本。

注意:辞职的原因是我有一些XML配置将应用程序指向每个环境(开发,测试,生产)的不同服务器,并在重新签名之前更新。

1 个答案:

答案 0 :(得分:0)

我想明确一点:协同设计只是创建一个签名来验证.app文件中的每个字节与它的创建者签名时的完全相同(由签名指定)身份)。所以理论上这应该与应用程序部署在哪个平台上无关。

我还想更清楚地了解您的情况:您是想通过TestFlight测试您的应用还是仅通过HockeyApp进行临时测试?由于beta权利仅是通过TestFlight进行beta测试的要求。它也与32bit平台上的崩溃无关。

那么对于你的问题,我的建议是:

1)检查应用程序的配置,尤其是其目标平台,以验证是否支持ARMV7;

2)通过Xcode测试您的应用,以排除任何其他签名/个人资料问题。这可以验证您的应用程序在开发模式下是否可以在64位和32位上正常工作。

3)最后也是最重要的,可以理解在部署期间附加从Xcode输出或从设备创建的错误日志。这对解决问题很有帮助。