From 2b8156e86c72fe4df15e2c714663d4aa432019bf Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Tue, 21 Jun 2022 18:59:57 -0700 Subject: [PATCH] [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 --- Audio/PluginController.mm | 12 +++++++++++- Info.plist | 2 +- Plugins/Hively/Hively/HVLDecoder.m | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Audio/PluginController.mm b/Audio/PluginController.mm index 2b1f6ab61..c04f7d0f0 100644 --- a/Audio/PluginController.mm +++ b/Audio/PluginController.mm @@ -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\t1\n\ \t\t\tCFBundleTypeName\n\ \t\t\t"]; - [stringList addObject:[type objectAtIndex:0]]; + [stringList addObject:xmlEscapeString([type objectAtIndex:0])]; [stringList addObject:@"\n\ \t\t\tCFBundleTypeRole\n\ \t\t\tViewer\n\ diff --git a/Info.plist b/Info.plist index 7fb6f7b33..f212449f6 100644 --- a/Info.plist +++ b/Info.plist @@ -825,7 +825,7 @@ CFBundleTypeIconSystemGenerated 1 CFBundleTypeName - Monkey's Audio File + Monkey's Audio File CFBundleTypeRole Viewer LSHandlerRank diff --git a/Plugins/Hively/Hively/HVLDecoder.m b/Plugins/Hively/Hively/HVLDecoder.m index 319735c51..79326fa82 100644 --- a/Plugins/Hively/Hively/HVLDecoder.m +++ b/Plugins/Hively/Hively/HVLDecoder.m @@ -185,7 +185,7 @@ static void oneTimeInit(void) { + (NSArray *)fileTypeAssociations { return @[ @[@"Hively Tracker File", @"song.icns", @"hvl"], - @[@"Abyss' Highest eXperience File", @"song.icns", @"ahx"] + @[@"Abyss' Highest eXperience File", @"song.icns", @"ahx"] ]; }