0

I am currently making a tweak for personal use but I don't really know a hell lot about programming. I know it isn't a smart idea to make tweaks if you don't know how to program properly but I'm only making one small tweak so I don't wan't/have time to spend months studying objective-c.

Now the problem: I have a plist located here:"/var/mobile/Applications/F5E2CB37-FC1B-46BC-8264-C7E2F17CD0EC/Library/Preferences/nl.telegraaf.ipad.plist" That .plist contains a lot of options and I only need to change one. But the value that I wanna change is located in a dictionary so you have something like this.

.plist ----> cells ---> dictionary named OpenUDID ----> value i wan't to change. The dictionary in the plist has 4 items and i only wan't to change is the first one. So I created a tweak and added this to it:

%hook SBLockScreenViewController //only for testing

NSMutableDictionary *settings = [NSMutableDictionary dictionaryWithContentsOfFile:
                                [NSString stringWithFormat:@"/var/mobile/Applications/F5E2CB37-FC1B- 46BC-8264-C7E2F17CD0EC/Library/Preferences/nl.telegraaf.ipad.plist"]]; //accessing the .plist


-(void)displayDidDisappear
{

    [settings setValue:@"test" forKey:@"PaywallAuthMethodStringKey"]; //trying to change a value from the .plist doesn't work
//NOTE this isn't a value in the dictionary in the .plist 

    %orig;
}
%end

The problems I have is that I don't know how to edit a value in a .plist in code(I searched about it on google but none of the solutions worked) Also I don't know how to get into the dictionary and than be able to change values in there.(I couldn't find any information on this on the internetz)

that guy
  • 404
  • 1
  • 7
  • 15
  • 1
    `s/than/then`, there's a very important difference. To change a plist file, just modify the underlying dictionary (or make a new, modified one if the dictionary is immutable), and write it back to file. – The Paramagnetic Croissant Oct 08 '14 at 15:57
  • 1
    Jesus, if I see another novice programmer who thinks that it's a good idea to jump right into making *tweaks*, instead of learning to write apps with public APIs first, I'm going to scream. Screw it. I'm screaming now. – Nate Oct 09 '14 at 04:10
  • possible duplicate of [Edit Info.plist programmatically in a jailbroken app](http://stackoverflow.com/questions/19593658/edit-info-plist-programmatically-in-a-jailbroken-app) – Nate Oct 09 '14 at 04:15

0 Answers0