0

I am trying to access the favorite contacts via the private frameworks. I followed the siphon code and got the frameworks from iOS-Runtime-Headers

The code that I wrote to access the list is:

    NSBundle *b = [NSBundle bundleWithPath:@"/System/Library/Frameworks/AddressBookUI.framework"];
  BOOL success = [b load];

  Class favs = NSClassFromString(@"ABFavoritesList");

  id favList = [favs sharedInstance];

  NSLog(@"Favs count = %d", [[favList entries] count]);

For some reason the the entries are being fetched as nil. Any help would be appreciated.

Vibhor Goyal
  • 2,405
  • 2
  • 22
  • 35

1 Answers1

0

I just tried your code and success is equals to NO, and favs and favList are equals to nil, I guess the AddressBookUI.framework fail to load.

After that, I tried adding (linking) my project with the AddressBook.framework and AddressBookUI.framework frameworks, and executing this code (note that the bundle load part is removed):

Class favs = NSClassFromString(@"ABFavoritesList");
id favList = [favs sharedInstance];
NSLog(@"Favs count = %d", [[favList entries] count]);

and it works. Maybe you can try that.

By the way, you probably know it, but it is never a good idea to directly use private code (in this case ABFavoritesList), as this code may change in the future.

Pierre-David Belanger
  • 1,004
  • 1
  • 11
  • 19