@@ -238,46 +238,6 @@ - (BOOL) copyAppIconToResources: (NSString *)iconFilename
238238 return success;
239239}
240240
241- - (NSString *) createSafeIconCopy : (NSString *)iconFilename
242- {
243- if (iconFilename == nil || [iconFilename rangeOfString: @" " ].location == NSNotFound )
244- {
245- // No spaces, return original filename
246- return nil ;
247- }
248-
249- NSFileManager *mgr = [NSFileManager defaultManager ];
250- NSString *productName = [_target name ];
251- NSString *assetsDir = [productName stringByAppendingPathComponent: @" Assets.xcassets" ];
252- NSString *appIconDir = [assetsDir stringByAppendingPathComponent: @" AppIcon.appiconset" ];
253- NSString *sourcePath = [appIconDir stringByAppendingPathComponent: iconFilename];
254-
255- // Create safe filename by replacing spaces with underscores
256- NSString *safeFilename = [iconFilename stringByReplacingOccurrencesOfString: @" " withString: @" _" ];
257- NSString *safePath = [appIconDir stringByAppendingPathComponent: safeFilename];
258-
259- xcputs ([[NSString stringWithFormat: @" \t * Creating safe icon copy: %@ -> %@ " , iconFilename, safeFilename] cString ]);
260-
261- // Copy original to safe filename
262- NSError *error = nil ;
263- if ([mgr fileExistsAtPath: safePath])
264- {
265- [mgr removeItemAtPath: safePath error: NULL ];
266- }
267-
268- BOOL success = [mgr copyItemAtPath: sourcePath toPath: safePath error: &error];
269- if (success)
270- {
271- xcputs ([[NSString stringWithFormat: @" \t * Successfully created safe icon copy: %@ " , safeFilename] cString ]);
272- return safeFilename;
273- }
274- else
275- {
276- xcputs ([[NSString stringWithFormat: @" \t * ERROR: Failed to create safe icon copy: %@ " , error ? [error localizedDescription ] : @" Unknown error" ] cString ]);
277- return nil ;
278- }
279- }
280-
281241- (NSString *) processAssets
282242{
283243 NSString *filename = [self discoverAppIcon ];
@@ -665,32 +625,18 @@ - (BOOL) generate
665625 NSString *iconPath = [self discoverAppIconPath ];
666626 xcputs ([[NSString stringWithFormat: @" \t * Discovered app icon: %@ " , iconFile ? iconFile : @" (none)" ] cString ]);
667627
668- // Store app icon information in build context for makefile generation
669- GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext ];
670- if (iconFile != nil )
671- {
672- [context setObject: iconFile forKey: @" APP_ICON_FILE" ];
673- xcputs ([[NSString stringWithFormat: @" \t * Stored app icon in build context: %@ " , iconFile] cString ]);
674- }
675-
676628 // Add icon file to resources if found
677629 if (iconPath != nil )
678630 {
679631 NSString *escapedIconPath = [self escapeFilenameForMakefile: iconPath];
680632 xcputs ([[NSString stringWithFormat: @" \t * Adding app icon to resources: %@ " , iconPath] cString ]);
681633 [resources addObject: escapedIconPath];
682634
683- // Copy app icon to resources directory with safe filename
684- NSString *safeIconFile = [self createSafeIconCopy: iconFile];
685- BOOL iconCopied = [self copyAppIconToResources: safeIconFile ? safeIconFile : iconFile];
635+ // Copy app icon to resources directory
636+ BOOL iconCopied = [self copyAppIconToResources: iconFile];
686637 if (iconCopied)
687638 {
688- xcputs ([[NSString stringWithFormat: @" \t * Copied app icon to resources: %@ " , safeIconFile ? safeIconFile : iconFile] cString ]);
689- // Store the safe filename for makefile generation
690- if (safeIconFile != nil )
691- {
692- [context setObject: safeIconFile forKey: @" APP_ICON_SAFE_FILE" ];
693- }
639+ xcputs ([[NSString stringWithFormat: @" \t * Copied app icon to resources: %@ " , iconFile] cString ]);
694640 }
695641 else
696642 {
0 commit comments