2
發現這個SO約gethostuuid depreciated
,但它在這種情況下幫助不大。gethostuuid用sqlite/sqlcipher折舊 - iOS
目標是iOS6.0,在compil時間sqlite3.c(v3.7.2):
static int proxyGetHostID(unsigned char *pHostID, int *pError){
struct timespec timeout = {1, 0}; /* 1 sec timeout */
assert(PROXY_HOSTIDLEN == sizeof(uuid_t));
memset(pHostID, 0, PROXY_HOSTIDLEN);
if(gethostuuid(pHostID, &timeout)){
= >>警告:'gethostuuid' is deprecated: first deprecated in iOS 5.0 - gethostuuid() is no longer supported
int err = errno;
if(pError){
*pError = err;
}
return SQLITE_IOERR;
}
#ifdef SQLITE_TEST
/* simulate multiple hosts by creating unique hostid file paths */
if(sqlite3_hostid_num != 0){
pHostID[0] = (char)(pHostID[0] + (char)(sqlite3_hostid_num & 0xFF));
}
#endif
return SQLITE_OK;
}
- 我明白gethostuuid有在iOS 5.0中已經deprecated。
- 而且,API gethostuuid()已被刪除,不會被接受提交給商店,無論目標操作系統如何。對於在iOS 7上運行的現有應用程序,該函數將返回供應商標識的uuid_t表示( - [UIDevice identifierForVendor])。
如何將呼叫替換爲gethostuuid
sqlite3.c
?
更好地爲sqlite3.c文件被通過化妝覆蓋改變它放在src/os_unix.c。 –