设置和捆绑来自Cydia的应用程序的钥匙串不起作用 [英] Settings.bundle & keychain for applications from Cydia doesn't work

查看:114
本文介绍了设置和捆绑来自Cydia的应用程序的钥匙串不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发与Cydia一起分发的应用程序。因此,它通常安装在/ Applications文件夹中,而不是通常的AppStore应用程序中的/ var / mobile / Applications /中。我认为安装给我带来了一些大问题。
首先,钥匙串阅读&用著名的Apple的KeychainItemWrapper进行书写根本不起作用。
另外,我的settings.bundle也不起作用。应用程序设置未显示在Settings.app中。

I'm working on app which is distributed with Cydia. So it is installed in /Applications folder, not /var/mobile/Applications/ as usual AppStore apps. And I assume that installation give me some huge problems. At first, keychain read & write with famous Apple's KeychainItemWrapper doesn't work at all. Also, my settings.bundle doesn't work too. App settings don't displayed in Settings.app.

当我在Simulator中测试应用程序甚至将其从Xcode直接部署到设备时(部署到/ var / mobile / Applications /)一切都像个魅力。

When I test application in Simulator or even deploy it from Xcode to device directly (it is deployed to /var/mobile/Applications/) everything works like a charm.

我尝试将已安装的.app移到var / mobile / Applications / XXXXXX / myapp.app中,并使用mobile:mobile所有者。没用。

I tried moving installed .app to var/mobile/Applications/XXXXXX/myapp.app with making mobile:mobile as it's owner. It didn't help.

有任何解决方案?

推荐答案

设置包



对于越狱应用程序,设置的工作方式略有不同。您需要执行与常规Settings.bundle类似的操作,但有区别。

Settings Bundle

Settings work a little differently for jailbreak apps. You need to do something similar to the normal Settings.bundle, but there are differences.

请参见此处提供了一些相关信息

这里

这里

您应该使您的应用依赖于 preferenceloader 软件包,可帮助越狱应用程序管理设置。因此,您的DEBIAN /控制文件中将包含以下内容:

You should make your app depend on the preferenceloader package, which helps jailbreak apps manage Settings. So, you'll have something like this in your DEBIAN/control file:

package: com.mycompany.MyApp
Name: MyApp
Version: 2.2-2
Architecture: iphoneos-arm
Depends: preferenceloader
Description: Do something for jailbreak iPhones
...



钥匙扣



在为了使钥匙串对我的应用程序有效,我需要在二进制文件中添加 entitlements 。我发现需要哪些权利的方法是先以正常方式构建应用程序(不是越狱应用程序,只是使用Xcode的普通第三方应用程序商店应用程序)。然后,我检查了Xcode构建的二进制文件中的权利:

Keychain

In order to make the keychain work for my app, I needed to add entitlements to my binary. The way I found out which entitlements were needed was to first build the app in the normal way (not a jailbreak app, just a normal 3rd-party app store app using Xcode). Then, I inspected the entitlements in the binary built by Xcode:

ldid -e MyApp.app/MyApp

然后将这些权利拼接为新的entitlements.xml文件。 请参见此处,了解如何应用权利。我相信您的应用程序的权利应如下所示:

And then spliced those entitlements into a new entitlements.xml file. See here for an example of applying entitlements. I believe the entitlements for your app should look something like this:

  <key>application-identifier</key>
  <string>L44W4W8ABC.com.mycompany.MyApp</string>
  <key>aps-environment</key>
  <string>development</string>
  <key>com.apple.developer.team-identifier</key>
  <string>L44W4W8ABC</string>

这种添加权利的方法可能是不必要的。请参阅您问题下方的评论,以获取其他选择。但是,由于其他原因,我要添加其他权利,并且无法通过Xcode做到这一点。

It's possible that this method of adding entitlements isn't necessary. See comments below your question for other options. However, I was adding other entitlements for other reasons, and could not do that through Xcode.

这篇关于设置和捆绑来自Cydia的应用程序的钥匙串不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆