WinterBoardSettings
*.deb
Optimize
-UIImages
winterboard
(_GSFontGetUseLegacyFontMetrics == NULL ? YES : _GSFontGetUseLegacyFontMetrics())
static bool Debug_ = false;
+static bool UIDebug_ = false;
static bool Engineer_ = false;
static bool SummerBoard_ = true;
static bool SpringBoard_;
if (NSString *path = $pathForFile$inBundle$(name, _UIKitBundle(), true))
image = $getImage$(path);
[UIImages_ setObject:(image == nil ? [NSNull null] : reinterpret_cast<id>(image)) forKey:key];
- return image == nil ? __UIImageWithName(name) : image;
+ if (image != nil)
+ return image;
+
+ image = __UIImageWithName(name);
+
+ if (UIDebug_) {
+ NSString *path([@"/tmp/UIImages/" stringByAppendingString:name]);
+ if (![Manager_ fileExistsAtPath:path])
+ [UIImagePNGRepresentation(image) writeToFile:path atomically:YES];
+ }
+
+ return image;
}
}
// }}}
}
// }}}
+ if (Debug_ && [Manager_ fileExistsAtPath:@"/tmp/UIImages"])
+ UIDebug_ = true;
+
[pool release];
}
+++ /dev/null
-#import <Foundation/Foundation.h>
-#import <CoreGraphics/CoreGraphics.h>
-
-#import <UIKit/UIKeyboard.h>
-#import <UIKit/UIImage.h>
-
-extern "C" {
- #include <mach-o/nlist.h>
-}
-
-extern "C" NSData *UIImagePNGRepresentation(UIImage *image);
-
-template <typename Type_>
-static void nlset(Type_ &function, struct nlist *nl, size_t index) {
- struct nlist &name(nl[index]);
- uintptr_t value(name.n_value);
- if ((name.n_desc & N_ARM_THUMB_DEF) != 0)
- value |= 0x00000001;
- function = reinterpret_cast<Type_>(value);
-}
-
-int main(int argc, char *argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- struct nlist nl[4];
-
- memset(nl, 0, sizeof(nl));
- nl[0].n_un.n_name = (char *) "___mappedImages";
- nl[1].n_un.n_name = (char *) "__UISharedImageInitialize";
- nl[2].n_un.n_name = (char *) "_LoadMappedImageRef";
- nlist("/System/Library/Frameworks/UIKit.framework/UIKit", nl);
-
- NSMutableDictionary **images;
- nlset(images, nl, 0);
-
- void (*__UISharedImageInitialize)(bool);
- nlset(__UISharedImageInitialize, nl, 1);
-
- CGImageRef (*_LoadMappedImageRef)(CFStringRef);
- nlset(_LoadMappedImageRef, nl, 2);
-
- __UISharedImageInitialize(false);
-
- NSArray *keys = [*images allKeys];
- for (int i(0), e([keys count]); i != e; ++i) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- NSString *key = [keys objectAtIndex:i];
- CGImageRef ref;
- if (_LoadMappedImageRef == NULL)
- ref = reinterpret_cast<CGImageRef>([*images objectForKey:key]);
- else
- ref = _LoadMappedImageRef(reinterpret_cast<CFStringRef>(key));
- UIImage *image = [UIImage imageWithCGImage:ref];
- NSData *data = UIImagePNGRepresentation(image);
- [data writeToFile:[NSString stringWithFormat:@"%@", key] atomically:YES];
- [pool release];
- }
-
- [pool release];
- return 0;
-}
substrate := -I../mobilesubstrate -L../mobilesubstrate -lsubstrate
-all: WinterBoard WinterBoard.dylib UIImages WinterBoardSettings Optimize
+all: WinterBoard WinterBoard.dylib WinterBoardSettings Optimize
clean:
- rm -f WinterBoard WinterBoard.dylib UIImages
+ rm -f WinterBoard WinterBoard.dylib
WinterBoardSettings: Settings.mm makefile
$(target)g++ -dynamiclib -g0 -O2 -Wall -o $@ $(filter %.mm,$^) -framework UIKit -framework CoreFoundation -framework Foundation -lobjc -framework CoreGraphics -framework Preferences -F$(PKG_ROOT)/System/Library/PrivateFrameworks
$(target)g++ -dynamiclib -g0 -O2 -Wall -o $@ $(filter %.mm,$^) -framework CoreFoundation -framework Foundation -lobjc -I/apl/inc/iPhoneOS-2.0 -framework CoreGraphics -framework ImageIO -framework GraphicsServices -framework Celestial $(substrate) -framework UIKit -framework WebCore -framework WebKit -F$(PKG_ROOT)/System/Library/PrivateFrameworks
ldid -S $@
-UIImages: UIImages.mm makefile
- $(target)g++ -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -framework UIKit -framework Foundation -framework CoreFoundation -lobjc -I/apl/inc/iPhoneOS-2.0 $(substrate)
- ldid -S $@
-
WinterBoard: Application.mm makefile
$(target)g++ -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -framework UIKit -framework Foundation -framework CoreFoundation -lobjc -framework CoreGraphics -I/apl/sdk -framework Preferences -F$(PKG_ROOT)/System/Library/PrivateFrameworks
ldid -S $@
find winterboard -name .svn | while read -r line; do rm -rf "$${line}"; done
cp -a extrainst_ preinst prerm winterboard/DEBIAN
sed -e 's/VERSION/$(shell ./version.sh)/g' control >winterboard/DEBIAN/control
- cp -a Test.sh Icon-Small.png icon.png icon-72.png icon@2x.png WinterBoard.dylib WinterBoard UIImages Info.plist winterboard/Applications/WinterBoard.app
+ cp -a Test.sh Icon-Small.png icon.png icon-72.png icon@2x.png WinterBoard.dylib WinterBoard Info.plist winterboard/Applications/WinterBoard.app
file="winterboard_$$(grep ^Version: winterboard/DEBIAN/control | cut -d ' ' -f 2)_iphoneos-arm.deb"; echo "$$file"; ln -sf "$$file" winterboard.deb
dpkg-deb -b winterboard winterboard.deb