forked from Polidea/ios-class-guard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CDCoreDataModelParser.m
36 lines (27 loc) · 1.09 KB
/
CDCoreDataModelParser.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#import "CDCoreDataModelParser.h"
#import "GDataXMLNode.h"
@implementation CDCoreDataModelParser
- (void)addSymbolsFromNode:(GDataXMLElement *)element toArray:(NSMutableArray *)symbolsArray {
NSArray *childNodes = element.children;
// Get the class name
GDataXMLNode *className = [element attributeForName:@"representedClassName"];
if (className) {
[symbolsArray addObject:[NSString stringWithFormat:@"!%@", className.stringValue]];
}
// Get the class name
GDataXMLNode *parentClassName = [element attributeForName:@"parentEntity"];
if (parentClassName) {
[symbolsArray addObject:[NSString stringWithFormat:@"!%@", parentClassName.stringValue]];
}
// Recursively process rest of the elements
for (GDataXMLElement *childNode in childNodes) {
// Skip comments
if ([childNode isKindOfClass:[GDataXMLElement class]]) {
[self addSymbolsFromNode:childNode toArray:symbolsArray];
}
}
}
- (void)obfuscateElement:(GDataXMLElement *)element usingSymbols:(NSDictionary *)symbols {
// TODO implement later
}
@end