Created
May 1, 2010 19:15
-
-
Save Sakurina/386588 to your computer and use it in GitHub Desktop.
transitional theme tool for iPhone OS 3.2
This file contains 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
/* | |
* springroll 2: the return of SpringRoll | |
* | |
* Copyright (c) 2010 Yanik Magnan <[email protected]> | |
* | |
* Permission to use, copy, modify, and/or distribute this software for any | |
* purpose with or without fee is hereby granted, provided that the above | |
* copyright notice and this permission notice appear in all copies. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
* | |
* ----- | |
* | |
* WinterBoard runs on 3.2, but all icon-related methods | |
* have changed so you can't exactly theme icons with it yet, | |
* which makes it slightly less useful. | |
* | |
* Just put your icons in /Library/Themes/_springroll/Icons | |
* and name them the same way you would have with SummerBoard | |
* or WinterBoard (iPod = iPod.png, Safari = Safari.png) and | |
* run the script. Icons will be themed until the next respring. | |
* | |
* Don't run the script multiple times in one respring or it | |
* will crash and throw you into Safe Mode. This isn't a replacement | |
* for WinterBoard; it is merely a transitional tool. | |
* | |
* UPDATE (May 9th): | |
* While WinterBoard /is/ available now, I updated this to serve | |
* as example code for Fairchild. This Cycript assumes Fairchild | |
* has already been injected into SpringBoard. | |
*/ | |
FCMethod("SBIcon", "getIconImage:", function(size) { | |
if (size == 2) { | |
var img = [UIImage imageWithContentsOfFile:@"/Library/Themes/_springroll/Icons/"+[this displayName]+".png"]; | |
if (img) return img; | |
} | |
return FCSuper["SBIcon"]["getIconImage:"].call(this, size); | |
}); | |
for (var i in [[SBIconModel sharedInstance] visibleIconIdentifiers]) { | |
var id = [[SBIconModel sharedInstance] visibleIconIdentifiers][i]; | |
var icon = [[SBIconModel sharedInstance] iconForDisplayIdentifier:id]; | |
[icon reloadIconImage]; | |
if ([icon isInDock]) | |
[icon setShadowsHidden:YES]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment