-
-
Save KiranPanesar/aa96b63a93f7811597a0 to your computer and use it in GitHub Desktop.
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
/* | |
We're directly including this file into Tweak.xmi at build time. | |
Tweak.xmi includes/defines the following things: | |
*/ | |
#import "../CallTracer.h" | |
#import "../SQLiteStorage.h" | |
#import "../PlistObjectConverter.h" | |
%hook NSString | |
+ (id)stringWithFormat:(NSString *)format { | |
NSString *origResult = %orig(format); | |
SQLiteStorage *traceStorage = [SQLiteStorage new]; | |
CallTracer *tracer = [[CallTracer alloc] initWithClass:@"NSString" andMethod:@"stringWithFormat:"]; | |
[tracer addArgFromPlistObject:format withKey:@"string"]; | |
[tracer addReturnValueFromPlistObject:[PlistObjectConverter convertNSString: origResult]]; | |
[traceStorage saveTracedCall: tracer]; | |
[tracer release]; | |
return origResult; | |
} | |
%end | |
/* vim: set filetype=objc : */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment