-
Notifications
You must be signed in to change notification settings - Fork 182
ControlPlane Hacking
dustinrue edited this page Nov 6, 2011
·
8 revisions
##ControlPlane Hacking Guide
###Adding a new Evidence Source
- Pick a short name for the evidence source; no spaces, starting with a letter
- Create an Objective-C class called FooEvidenceSource in the same style as the other sources. It should inherit from one of these:
EvidenceSource GenericEvidenceSource LoopingEvidenceSource GenericLoopingEvidenceSource
(the simplest)Use custom nib? Yes No Yes No Use simple loop? No No Yes Yes * Create FooRule.nib * From your -init, call: * [super initWithNibNamed:@"FooRule"]; Extend: * (NSMutableDictionary *)readFromPanel; * (void)writeToPanel:(NSDictionary *)dict usingType:(NSString *)type If not using custom nib: Override (implement): * (NSString *)getSuggestionLeadText:(NSString *)type * (NSArray *)getSuggestions If using a simple loop: Extend: * (void)doUpdate * (void)clearCollectedData If not using simple loop: Override (implement): * (void)start * (void)stop
3 Add mention of it in MPController.m, around line 61:
[appDefaults setValue:@"YES" forKey:@"EnableFooEvidenceSource"];
4 Add mention of it in the three places in EvidenceSource.m, from ~ line 268:
#import "FooEvidenceSource.h" ... [FooEvidenceSource class], ... NSLocalizedString(@"Foo", @"Evidence source");
Pick a short name for the action; no spaces, starting with a letter (e.g. Foo) Create an Objective-C class called FooAction in the same style as the other actions Add mention of it in the three places in Action.m (from around line 146):
#import "FooAction.h" ... [FooAction class], ... NSLocalizedString(@"Foo", @"Action type")