iphone - 读取越狱 iPhone 中的 SIM 卡联系人

标签 iphone jailbreak sim-card

我正在开发一个需要从 SIM 卡读取联系人的应用程序。 我知道使用官方Apple SDK是不可能的。 我正在为越狱的 iPhone开发这个应用程序。

我进行了很多搜索,但我得到的唯一答案是不可能。

任何对这条道路的帮助都将不胜感激。

最佳答案

NSString *addressbookDatabasePath = @"/private/var/wireless/Library/AddressBook/addressbook.db";
addressbookFileExist = [fileManager fileExistsAtPath:addressbookDatabasePath];
[fileManager release];
NSMutableArray *addressbook = [[NSMutableArray alloc] init];

if(addressbookFileExist) {
if ([fileManager isReadableFileAtPath:addressbookDatabasePath]) {
    sqlite3 *database;
    if(sqlite3_open([addressbookDatabasePath UTF8String], &database) == SQLITE_OK) {
        sqlite3_stmt *compiledStatement;
        NSString *sqlStatement = [NSString stringWithString:@"SELECT * FROM call;"];

        int errorCode = sqlite3_prepare_v2(database, [sqlStatement UTF8String], -1,
                                            &compiledStatement, NULL);
        if( errorCode == SQLITE_OK) {
            int count = 1;

            while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
                // Read the data from the result row
                NSMutableDictionary *addressbookItem = [[NSMutableDictionary alloc] init];
                int numberOfColumns = sqlite3_column_count(compiledStatement);
                NSString *data;
                NSString *columnName;

                for (int i = 0; i < numberOfColumns; i++) {
                    columnName = [[NSString alloc] initWithUTF8String:
                                (char *)sqlite3_column_name(compiledStatement, i)];
                    data = [[NSString alloc] initWithUTF8String:
                            (char *)sqlite3_column_text(compiledStatement, i)];

                    [addressbookItem setObject:data forKey:columnName];

                    [columnName release];
                    [data release];
                }
                [callHistory addObject:callHistoryItem];
                [callHistoryItem release];
                count++;
            }
        }
        else {
            NSLog(@"Failed to retrieve table");
            NSLog(@"Error Code: %d", errorCode);
        }
        sqlite3_finalize(compiledStatement);
    }
}
}

关于iphone - 读取越狱 iPhone 中的 SIM 卡联系人,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9733049/

相关文章:

iphone - 如何通过 IOHIDEvent 模拟触摸事件?

android - 如何检索设备是否支持 SimCard?

android - 检测来电的目标电话号码是 SIM 1 还是 SIM 2?

iphone - awakeFromNib 对面?

iphone - 翻转时如何恢复保存的变换

iphone - 适用于 iPad 的网格状控件

Android 电话 - 双 SIM 卡与具有多个 IMSI 的单 SIM 卡

iphone - iOS IMAP 库

iphone - 如何在 PC 上重启越狱的 iPhone

ios - 如何将 Theos 项目安装到设备?