如何删掉某个应用在keychain中创建的内容?


#1

如何删掉某个应用在keychain中创建的内容?
没有越狱的情况下,能实现么?
越狱的情况下,能实现么?


#2

越狱的话是可以实现的,直接把keychain删掉就好了;不越狱的话我不确定


#3

直接把keychain删掉?请问怎么样才能把keychain删掉呢?
我hook了下面的方法
%hook SFHFKeychainUtils
+ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error
{
NSLog(@"getPasswordForUsername:%@,%@",username,serviceName);
return %orig;
}
%end

这样得到username,serviceName之后,我想就可以再想办法删掉了,
大神,你怎么做的呢?


#4

下面是我从某个清痕App上扒下来的代码:

	sqlite3 *database;
	int openResult = sqlite3_open("/var/Keychains/keychain-2.db", &database);
	if (openResult == SQLITE_OK)
	{
		int execResult = sqlite3_exec(database, "DELETE FROM genp WHERE agrp <> 'apple'", NULL, NULL, NULL);
		if (execResult != SQLITE_OK) NSLog(@"Failed to exec DELETE FROM genp WHERE agrp <> 'apple', error %d", execResult);

		execResult = sqlite3_exec(database, "DELETE FROM cert WHERE agrp <> 'lockdown-identities'", NULL, NULL, NULL);
		if (execResult != SQLITE_OK) NSLog(@"Failed to exec DELETE FROM cert WHERE agrp <> 'lockdown-identities', error %d", execResult);

		execResult = sqlite3_exec(database, "DELETE FROM keys WHERE agrp <> 'lockdown-identities'", NULL, NULL, NULL);
		if (execResult != SQLITE_OK) NSLog(@"Failed to exec DELETE FROM keys WHERE agrp <> 'lockdown-identities'', error %d", execResult);

		execResult = sqlite3_exec(database, "DELETE FROM inet", NULL, NULL, NULL);
		if (execResult != SQLITE_OK) NSLog(@"Failed to exec DELETE FROM inet, error %d", execResult);

		execResult = sqlite3_exec(database, "DELETE FROM sqlite_sequence", NULL, NULL, NULL);
		if (execResult != SQLITE_OK) NSLog(@"Failed to exec DELETE FROM sqlite_sequence, error %d", execResult);

		sqlite3_close(database);
	}


#5

你好,我把Keychains文件夹下的所有文件和子目录都删除了,应该怎么恢复啊?还是说有什么方法自动生成啊


#6

重启一遍应该就自动生成了


#7

嗯,谢谢,重启后的确自动生成了


#8

我刚才试了一下我的设备,iphone5c+ios9.0系统删除掉/var/Keychains下的文件后,重启之后wifi密码之类的确实没有了;但是另一台设备,iphone5+ios8.3删除掉后重启,并没有重新生成,一些密码还是有效的。
请问是系统差别导致的吗?


#9

请问解决了吗


#10

我把 Keychains 这个文件夹删了 然后白苹果了...


#12

我写了一个root级别的app, 但是代码中删除不成功, 非要写成脚本, 放到手机里, 才能删除成功