繁体   English   中英

应用商店中的钥匙串和更新出现问题

[英]issue with keychain and updates from app store

我有一个非常令人沮丧的错误。 我已经通过先安装先前版本(1.0.1),然后运行版本(1.0.2)来测试应用程序升级。 一切正常。 我提交了该应用程序,然后我遇到了一些问题,人们在升级时会崩溃。 我尝试做同样的事情,先安装1.0.1,然后在应用商店中安装二进制文件,然后崩溃。 我查看了控制台和崩溃日志,并得到以下信息:

Jul  7 08:07:45 unknown MyApp[1429] <Warning>: KeychainUtils keychainValueForKey: - Error finding keychain value for key. Status code = -25300
Jul  7 08:07:45 unknown MyApp[1429] <Warning>: AccountSession readUserDataFromDisk - Error finding keychain value for key /var/mobile/Applications/997B32E7-6FFC-4696-9CAA-129BADE2FE64/Documents/instagram_json
Jul  7 08:07:45 unknown MyApp[1429] <Warning>: UISegmentedControlStyleBezeled is deprecated. Please use a different style.
Jul  7 08:07:45 unknown MyApp[1429] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: username)'
    *** First throw call stack:
    (0x33ee688f 0x367e7259 0x33ee6789 0x33ee67ab 0x33e5368b 0x14fd99 0x152319 0x1530bb 0x170299 0x3270ec59 0x32711817 0x354e7dfb 0x354e7cd0)
Jul  7 08:07:45 unknown UIKitApplication:com.firesnakelabs.pinstagram[0x14e4][1429] <Notice>: terminate called throwing an exception
> 

更新:

我想我知道问题是什么,升级所需的文件路径位于:

/var/mobile/Applications/997B32E7-6FFC-4696-9CAA-129BADE2FE64/Documents/instagram_json

而在升级(v1.0.1)之前,钥匙串的文件路径位于:

/var/mobile/Applications/CEE344F7-4FE1-4455-BD6D-A4D6EAA4F5FE/Documents/instagram_json

因此,它现在无法在钥匙串上找到钥匙,这是我确定filePath的方法:

- (NSString *)filePath {
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_json", self.identifier]];
    return filePath;
}

我只是走我发现的第一条路。 那么,如何在升级前后或始终保持一致的路径?

我基本上是使用filePath作为钥匙串名称:

[attributesDictionary setObject:filePath forKey:(id)kSecAttrAccount]; // Use the key as the account name

您的问题尚不完全清楚,但听起来其中一个版本是临时的分布式版本,另一个是应用程序商店签名的二进制版本。 如果真是这样,那么两者将具有不同的钥匙串值。 钥匙串链接到应用程序的签名,这在两种机制之间有所不同。

暂无
暂无

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

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