Would it be possible to create a custom property in a hooked method using theos/logos?
example:
//define my custom property
@interface SBAwayController : NSObject {
UIView *myCustomView;
}
@property (nonatomic, retain) UIView *myCustomView;
@end
%hook SBAwayController
- (void)activate {
//call original method
%orig;
//use my custom property
if (tweakEnabled)
[self.awayView addSubview:myCustomView];
}
%end
I've tried it as exampled above, but no success.
An alternative is to create a singleton class that will hold your object/context. Take this example from this Introspy hook class.
tracerStorage
is a variable defined outside the class and all hooks access it.To apply it to your case, you can have an external variable NSMutableDictionary with the current
SBAwayController
as key and the propertymyCustomView
as value.