From af8d8e0949257649d0a6ac29745d0fe24ed47106 Mon Sep 17 00:00:00 2001 From: Ty Rauber Date: Tue, 24 Sep 2024 09:01:01 +0200 Subject: [PATCH 1/4] fix: add generic expo config plugin to remove MapLibre.xcframework-ios.signature --- CHANGELOG.md | 4 ++++ package.json | 2 +- plugin/src/withMapLibre.ts | 29 +++++++++++++++++++++++++---- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c394939e9..4b1c4c15f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ PR Title ([#123](link to my pr)) ``` +## 10.0.0-alpha.17 + +fix: add generic expo plugin to remove Duplicated Signature in Xcode 15/16 + ## 10.0.0-alpha.16 fix: [another attempt to disable code signing](<[#451](https://github.com/maplibre/maplibre-react-native/pull/451)>) diff --git a/package.json b/package.json index 9d304ad44..38b13b9f5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@maplibre/maplibre-react-native", "description": "A MapLibre GL Native plugin for creating maps in React Native", - "version": "10.0.0-alpha.16", + "version": "10.0.0-alpha.17", "publishConfig": { "access": "public" }, diff --git a/plugin/src/withMapLibre.ts b/plugin/src/withMapLibre.ts index 328da103c..04169d645 100644 --- a/plugin/src/withMapLibre.ts +++ b/plugin/src/withMapLibre.ts @@ -43,7 +43,7 @@ const withCocoaPodsInstallerBlocks: ConfigPlugin = (c) => { await promises.writeFile( file, applyCocoaPodsModifications(contents), - "utf-8", + "utf-8" ); return config; }, @@ -63,7 +63,7 @@ export function applyCocoaPodsModifications(contents: string): string { export function addInstallerBlock( src: string, - blockName: InstallerBlockName, + blockName: InstallerBlockName ): string { const matchBlock = new RegExp(`${blockName}_install do \\|installer\\|`); const tag = `${blockName}_installer`; @@ -96,7 +96,7 @@ export function addInstallerBlock( export function addMapLibreInstallerBlock( src: string, - blockName: InstallerBlockName, + blockName: InstallerBlockName ): string { return mergeContents({ tag: `@maplibre/maplibre-react-native-${blockName}_installer`, @@ -129,6 +129,27 @@ export function setExcludedArchitectures(project: XcodeProject): XcodeProject { return project; } +const withoutSignatures: ConfigPlugin = (config) => { + const shellScript = ` + echo "Remove signature files (Xcode workaround)"; + rm -rf "$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature"; + `; + return withXcodeProject(config, async (config) => { + const xcodeProject = config.modResults; + xcodeProject.addBuildPhase( + [], + "PBXShellScriptBuildPhase", + "Remove signature files (Xcode workaround)", + null, + { + shellPath: "/bin/sh", + shellScript, + } + ); + return config; + }); +}; + const withExcludedSimulatorArchitectures: ConfigPlugin = (c) => { return withXcodeProject(c, (config) => { config.modResults = setExcludedArchitectures(config.modResults); @@ -137,7 +158,7 @@ const withExcludedSimulatorArchitectures: ConfigPlugin = (c) => { }; const withMapLibre: ConfigPlugin = (config) => { - config = withExcludedSimulatorArchitectures(config); + config = withoutSignatures(withExcludedSimulatorArchitectures(config)); return withCocoaPodsInstallerBlocks(config); }; From 4139fc2fca3661d353c3f491ba7be93ab6b64dcd Mon Sep 17 00:00:00 2001 From: Ty Rauber Date: Tue, 24 Sep 2024 09:07:45 +0200 Subject: [PATCH 2/4] fix: revert code signing changes --- ios/RCTMLN.xcodeproj/project.pbxproj | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ios/RCTMLN.xcodeproj/project.pbxproj b/ios/RCTMLN.xcodeproj/project.pbxproj index aaa1ccc0d..e2f4d5d4b 100644 --- a/ios/RCTMLN.xcodeproj/project.pbxproj +++ b/ios/RCTMLN.xcodeproj/project.pbxproj @@ -656,10 +656,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = ""; - CODE_SIGNING_REQUIRED = NO; - CODE_SIGN_ENTITLEMENTS = ""; - CODE_SIGNING_ALLOWED = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -708,10 +705,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = ""; - CODE_SIGNING_REQUIRED = NO; - CODE_SIGN_ENTITLEMENTS = ""; - CODE_SIGNING_ALLOWED = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; From 99d81c71e6d74dfcf98d5ebfd268dd300885fe4b Mon Sep 17 00:00:00 2001 From: Ty Rauber Date: Tue, 24 Sep 2024 09:08:54 +0200 Subject: [PATCH 3/4] fix: lint errors --- plugin/src/withMapLibre.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/src/withMapLibre.ts b/plugin/src/withMapLibre.ts index 04169d645..b98b49be0 100644 --- a/plugin/src/withMapLibre.ts +++ b/plugin/src/withMapLibre.ts @@ -43,7 +43,7 @@ const withCocoaPodsInstallerBlocks: ConfigPlugin = (c) => { await promises.writeFile( file, applyCocoaPodsModifications(contents), - "utf-8" + "utf-8", ); return config; }, @@ -63,7 +63,7 @@ export function applyCocoaPodsModifications(contents: string): string { export function addInstallerBlock( src: string, - blockName: InstallerBlockName + blockName: InstallerBlockName, ): string { const matchBlock = new RegExp(`${blockName}_install do \\|installer\\|`); const tag = `${blockName}_installer`; @@ -96,7 +96,7 @@ export function addInstallerBlock( export function addMapLibreInstallerBlock( src: string, - blockName: InstallerBlockName + blockName: InstallerBlockName, ): string { return mergeContents({ tag: `@maplibre/maplibre-react-native-${blockName}_installer`, @@ -144,7 +144,7 @@ const withoutSignatures: ConfigPlugin = (config) => { { shellPath: "/bin/sh", shellScript, - } + }, ); return config; }); From 01be3991f27c6a06adf5af9be5733d24f50855c3 Mon Sep 17 00:00:00 2001 From: Ty Rauber Date: Tue, 24 Sep 2024 11:06:16 +0200 Subject: [PATCH 4/4] chore: update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b1c4c15f..f1facc1cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ PR Title ([#123](link to my pr)) ## 10.0.0-alpha.17 -fix: add generic expo plugin to remove Duplicated Signature in Xcode 15/16 +fix: [add generic expo plugin to remove Duplicated Signature in Xcode 15/16](<[#453](https://github.com/maplibre/maplibre-react-native/pull/453)>) ## 10.0.0-alpha.16