Created
February 22, 2020 17:33
-
-
Save MTACS/77e318d883f1b96f506627ffaedb6a94 to your computer and use it in GitHub Desktop.
Solution to libcolorpicker not saving values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>items</key> | |
<array> | |
<dict> | |
<key>cell</key> | |
<string>PSLinkCell</string> | |
<key>cellClass</key> | |
<string>PFSimpleLiteColorCell</string> | |
<key>libcolorpicker</key> | |
<dict> | |
<key>defaults</key> | |
<string>com.mtac.tweakcolors</string> <!-- Use a different identifier here, I use original + colors: com.mtac.tweak -> com.mtac.tweakcolors --> | |
<key>key</key> | |
<string>colorKey</string> <!-- Key to be used in Tweak.xm --> | |
<key>fallback</key> | |
<string>#ffffff</string> | |
<key>alpha</key> | |
<false/> | |
</dict> | |
<key>label</key> | |
<string>Picker Label</string> | |
</dict> | |
</array> | |
</dict> | |
</plist> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <libcolorpicker.h> | |
NSMutableDictionary *colorDictionary = [NSMutableDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.mtac.tweakcolors.plist"]; // Replace the identifier with the one used in .plist file | |
%hook ClassName | |
- (void)setBackgroundColor:(UIColor *)arg1 { // Example method to set background color | |
%orig(LCPParseColorString([colorDictionary objectForKey:@"colorKey"], @"#ffffff")); // Grab color from key in color dictionary using LCPParseColorString and set a fallback color. Make sure it's the same as the fallback used in the .plist file | |
} | |
%end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment