Implement signing for React Native core (#51919)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51919

Implement signing for the React Native core XCFramework

The implementation follows the same approach we used for the ReactNativedependencies archive

## Changelog
[Internal] -

Reviewed By: cortinico

Differential Revision: D76337972

fbshipit-source-id: 74f61c087b31e4087752cd60bea59db15f00321b
This commit is contained in:
Riccardo Cipolleschi
2025-06-11 04:48:54 -07:00
committed by Facebook GitHub Bot
parent 3ac8c0d218
commit ecec7f324e
2 changed files with 21 additions and 1 deletions
+7 -1
View File
@@ -71,7 +71,13 @@ async function main() {
if (cli.tasks.compose) {
const productsFolder = computeProductsFolder(outputFolder);
const frameworkPaths = computeFrameworkPaths(productsFolder);
buildXCFrameworks(root, buildFolder, frameworkPaths, buildType);
buildXCFrameworks(
root,
buildFolder,
frameworkPaths,
buildType,
cli.identity,
);
}
// Done!
@@ -138,6 +138,10 @@ function buildXCFrameworks(
fs.mkdirSync(outputFolder, {recursive: true});
execSync(`cp -r ${symbol} ${outputFolder}`);
});
if (identity) {
signXCFramework(identity, outputPath);
}
}
function copyHeaderFiles(
@@ -353,6 +357,16 @@ function extractDestinationFromPath(symbolPath /*: string */) /*: string */ {
`Impossible to extract destination from ${symbolPath}. Valid destinations are iphoneos, iphonesimulator and catalyst.`,
);
}
function signXCFramework(
identity /*: string */,
xcframeworkPath /*: string */,
) {
console.log('Signing XCFramework...');
const command = `codesign --timestamp --sign "${identity}" ${xcframeworkPath}`;
execSync(command, {stdio: 'inherit'});
}
module.exports = {
buildXCFrameworks,
};