[Info Plist] Auto format XML escapes

Automatically format any XML escapes of file type association names.
Adjust Info.plist to account for this change.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
swiftingly
Christopher Snowhill 2022-06-21 18:59:57 -07:00
parent d59b5335e9
commit 2b8156e86c
3 changed files with 13 additions and 3 deletions

View File

@ -348,6 +348,16 @@ static PluginController *sharedPluginController = nil;
}
}
static NSString *xmlEscapeString(NSString * string) {
CFStringRef textXML = CFXMLCreateStringByEscapingEntities(kCFAllocatorDefault, (CFStringRef)string, nil);
if(textXML) {
NSString *textString = (__bridge NSString *)textXML;
CFRelease(textXML);
return textString;
}
return @"";
}
- (void)printPluginInfo {
ALog(@"Sources: %@", self.sources);
ALog(@"Containers: %@", self.containers);
@ -504,7 +514,7 @@ static PluginController *sharedPluginController = nil;
\t\t\t<integer>1</integer>\n\
\t\t\t<key>CFBundleTypeName</key>\n\
\t\t\t<string>"];
[stringList addObject:[type objectAtIndex:0]];
[stringList addObject:xmlEscapeString([type objectAtIndex:0])];
[stringList addObject:@"</string>\n\
\t\t\t<key>CFBundleTypeRole</key>\n\
\t\t\t<string>Viewer</string>\n\

View File

@ -825,7 +825,7 @@
<key>CFBundleTypeIconSystemGenerated</key>
<integer>1</integer>
<key>CFBundleTypeName</key>
<string>Monkey's Audio File</string>
<string>Monkey&apos;s Audio File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>

View File

@ -185,7 +185,7 @@ static void oneTimeInit(void) {
+ (NSArray *)fileTypeAssociations {
return @[
@[@"Hively Tracker File", @"song.icns", @"hvl"],
@[@"Abyss&apos; Highest eXperience File", @"song.icns", @"ahx"]
@[@"Abyss' Highest eXperience File", @"song.icns", @"ahx"]
];
}