I'm developing a small tweak that changes some files in /var/preferences
. Here is my constructor:
%ctor
{
NSLog(@"\n\n\n Tweak Loading... \n\n\n ");
NSError *error = [[NSError alloc] init];
BOOL success = [[NSFileManager defaultManager] copyItemAtPath:somePath toPath:someOtherPath error:&error];
if (success)
{
NSLog(@"\n\n\n Success:) \n\n\n ");
} else {
NSLog(@"\n\n\n Failure! \n\n\n ");
}
//Method hook initialization
%init;
}
As /var/preferences/
is not accessible for mobile
user the tweak should be loaded in a root process. With a little bit search I found out that wifid
has root privileges. So I changed my filter to com.apple.wifid
filter for bundle identifiers.
After I restarted wifid daemon nothing happens and the tweak isn't loaded. I thought it's a problem with this specific daemon so I wrote a simple command line tool for test that has a runloop in it (it's just like a launch daemon instead it doesn't have a plist to run at startup). Then I modified the plist to this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Filter</key>
<dict>
<key>Executables</key>
<array>
<string>myExecutableName</string>
</array>
</dict>
</dict>
</plist>
Again nothing happens and the tweak is not loaded. How can I solve this problem? Why doesn't this tweak load in those processes?