热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

iOS钥匙串中的项目能否在应用程序卸载和重新安装后生效?-WillitemsiniOSkeychainsurviveappuninstallandreinstall?

IamlookingfordocumentationabouttheiOSkeychainitems.Myspecificquestionisifkeychainite

I am looking for documentation about the iOS keychain items. My specific question is if keychain items will survive an app uninstall and reinstall cycle. It seems to work that way since iOS 4 (or maybe even iOS 3), but I cannot find any documentation from Apple stating that this actually is supposed to work this way.

我正在寻找有关iOS钥匙串项目的文档。我的具体问题是,如果钥匙串项目在应用程序卸载和重新安装周期后仍然存在。它似乎从iOS 4(或者甚至iOS 3)那样工作,但我找不到Apple的任何文档,说明这实际上应该以这种方式工作。

What I am trying to figure out is if I can TRUST (not "hope for" or "guess") that items in the keychain will survive the app uninstall.

我想弄清楚的是,如果我可以信任(不是“希望”或“猜测”),钥匙串中的项目将在应用程序卸载后继续存在。

EDIT: I realize that the question is a bit unclear as pointed out by Daij-Djan. What I am looking for is official documentation that backs up the well-known behaviour.

编辑:我意识到Daij-Djan指出的问题有点不清楚。我正在寻找的是备份众所周知的行为的官方文档。

UPDATE 2017-04-04: See my answer below, the behaviour change in iOS 10.3 beta. It works as usual in iOS 10.3 but may probably change in future versions.

更新2017-04-04:请参阅下面的答案,iOS 10.3测试版中的行为更改。它在iOS 10.3中照常工作,但在将来的版本中可能会有所改变。

3 个解决方案

#1


10  

I dug around on the Apple developer forums, and a Apple developer (eskimo1, aka Quinn) states at 2012-08-27 that this is the current behaviour but it's a far as he knows not /documented/ behaviour, so this might change in the future. He also says that deleting shared keychain items is always going to be tricky, which is one of the reasons this it hasn't been addressed yet.

我在Apple开发者论坛上挖掘,而Apple开发人员(eskimo1,又名Quinn)在2012-08-27表示这是当前的行为,但这是他知道没有/记录/行为,所以这可能会改变未来。他还说删除共享的钥匙串项总是很棘手,这也是它尚未解决的原因之一。

So I guess that this leaves the question open: there is no definitive answer. It is not documented and can change at any point in time. Relying on it MAY cause problems in the future.

所以我想这会让问题悬而未决:没有明确的答案。它没有记录,可以随时更改。依赖它可能会在将来引起问题。

UPDATE 2017-04-04:

更新2017-04-04:

In iOS 10.3 beta, keychain info for an app is removed when the app is uninstalled, but this behaviour seems to have been removed in the final 10.3 version. At Apple Documentation It is suggested that this is about to change and we should NOT rely on keychain access data being intact after an app uninstallation. See also iOS 10.3 beta 3 doesn't persist data of KeychainItem.

在iOS 10.3测试版中,卸载应用程序时会删除应用程序的钥匙串信息,但在最终的10.3版本中似乎已删除此行为。在Apple文档中建议这是即将更改,我们不应该依赖于卸载应用程序后完整的钥匙串访问数据。另请参阅iOS 10.3 beta 3不会保留KeychainItem的数据。

#2


7  

Perhaps this is what you are looking for.
Apple Documentation

也许这就是你要找的东西。 Apple文档

Note: On iPhone, Keychain rights depend on the provisioning profile used to sign your application. Be sure to consistently use the same provisioning profile across different versions of your application.

注意:在iPhone上,Keychain权限取决于用于签署应用程序的配置文件。确保在不同版本的应用程序中始终使用相同的配置文件。

#3


4  

yes they will.

是他们会。

see a correspondinng question of mine:

看到我的相关问题:

How to find out WHEN a user bought the app / installed it for the first time (possible without UDID?)

如何找出用户第一次购买应用程序/安装它(可能没有UDID?)


AS I SEE IT:

照我看来:

'Officially' it is implied by the fact that the keychain is for multiple apps.. and that it 'belongs' to the os:

'正式'这是因为钥匙串适用于多个应用程序......并且它“属于”操作系统:

Apple Documentation

Apple文档

A keychain is an encrypted container that holds passwords for multiple applications and secure services.

钥匙串是一个加密容器,用于存放多个应用程序和安全服务的密码。

=> ergo the keychain survives the app

=> ergo钥匙串幸存了应用程序

PLUS

a keychain item can be shared between multiple apps

钥匙串项目可以在多个应用程序之间共享


推荐阅读
author-avatar
草莓顽子该_589
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有