mirror of
https://github.com/DKJone/DKWechatHelper.git
synced 2025-05-29 07:16:11 +08:00
61 lines
1010 B
Plaintext
61 lines
1010 B
Plaintext
// See http://iphonedevwiki.net/index.php/Logos
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
@interface CustomViewController
|
|
|
|
@property (nonatomic, copy) NSString* newProperty;
|
|
|
|
+ (void)classMethod;
|
|
|
|
- (NSString*)getMyName;
|
|
|
|
- (void)newMethod:(NSString*) output;
|
|
|
|
@end
|
|
|
|
%hook CustomViewController
|
|
|
|
+ (void)classMethod
|
|
{
|
|
%log;
|
|
|
|
%orig;
|
|
}
|
|
|
|
%new
|
|
-(void)newMethod:(NSString*) output{
|
|
NSLog(@"This is a new method : %@", output);
|
|
}
|
|
|
|
%new
|
|
- (id)newProperty {
|
|
return objc_getAssociatedObject(self, @selector(newProperty));
|
|
}
|
|
|
|
%new
|
|
- (void)setNewProperty:(id)value {
|
|
objc_setAssociatedObject(self, @selector(newProperty), value, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
}
|
|
|
|
- (NSString*)getMyName
|
|
{
|
|
%log;
|
|
|
|
NSString* password = MSHookIvar<NSString*>(self,"_password");
|
|
|
|
NSLog(@"password:%@", password);
|
|
|
|
[%c(CustomViewController) classMethod];
|
|
|
|
[self newMethod:@"output"];
|
|
|
|
self.newProperty = @"newProperty";
|
|
|
|
NSLog(@"newProperty : %@", self.newProperty);
|
|
|
|
return %orig();
|
|
}
|
|
|
|
%end
|