简体   繁体   English

来自Cydia的应用程序的Settings.bundle和钥匙串不起作用

[英]Settings.bundle & keychain for applications from Cydia doesn't work

I'm working on app which is distributed with Cydia. 我正在开发与Cydia一起分发的应用程序。 So it is installed in /Applications folder, not /var/mobile/Applications/ as usual AppStore apps. 因此,它通常安装在/ Applications文件夹中,而不是通常的AppStore应用程序中的/ var / mobile / Applications /中。 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. 最初,用著名的Apple的KeychainItemWrapper进行钥匙串读写根本不起作用。 Also, my settings.bundle doesn't work too. 另外,我的settings.bundle也无法正常工作。 App settings don't displayed in Settings.app. 应用程序设置未显示在Settings.app中。

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. 当我在Simulator中测试应用程序或什至将其从Xcode直接部署到设备(部署到/ var / mobile / Applications /)时,所有功能都像魅力一样。

I tried moving installed .app to var/mobile/Applications/XXXXXX/myapp.app with making mobile:mobile as it's owner. 我尝试通过将mobile:mobile作为所有者将已安装的.app移至var / mobile / Applications / XXXXXX / myapp.app。 It didn't help. 它没有帮助。

Any solution for making this work? 任何解决方案,使这项工作?

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. 您需要执行常规Settings.bundle 类似的操作,但有一些不同。

See here for some information on that . 有关此信息,请参见此处

And here 和这里

And here 和这里

You should make your app depend on the preferenceloader package, which helps jailbreak apps manage Settings. 您应该使您的应用程序依赖于preferenceloader软件包,这有助于越狱应用程序管理设置。 So, you'll have something like this in your DEBIAN/control file: 因此,您的DEBIAN /控制文件中将包含以下内容:

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

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). 我发现需要哪些权利的方法是先以正常方式构建应用程序(不是越狱应用程序,只是使用Xcode的普通第三方应用程序商店应用程序)。 Then, I inspected the entitlements in the binary built by Xcode: 然后,我检查了Xcode构建的二进制文件中的权利:

ldid -e MyApp.app/MyApp

And then spliced those entitlements into a new entitlements.xml file. 然后将这些权利拼接为新的entitlements.xml文件。 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>

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. 但是,由于其他原因,我正在添加其他权利,并且无法通过Xcode做到这一点。

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

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