簡體   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