Codesign capabilities
Summary: Add codesign capabilities to Flipper Server Cocoa app. Also, push the version to the build step instead of overriding once built. Otherwise, the Info.plist will be marked as 'being tampered with'. Note: we are still not using the signing, but the capability is there. Reviewed By: antonk52 Differential Revision: D51547008 fbshipit-source-id: 33abcd2fce33a7daf2ae8941b54989dba82fc0e3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
72a92e1380
commit
d22d362c31
@@ -754,7 +754,11 @@ async function setUpMacBundle(
|
||||
platform === BuildPlatform.MAC_AARCH64
|
||||
? BuildArchitecture.MAC_AARCH64
|
||||
: BuildArchitecture.MAC_X64;
|
||||
const outputPath = await buildFlipperServer(architecture);
|
||||
const outputPath = await buildFlipperServer(
|
||||
architecture,
|
||||
versionNumber,
|
||||
false,
|
||||
);
|
||||
console.log(
|
||||
`⚙️ Successfully built platform: ${platform}, output: ${outputPath}`,
|
||||
);
|
||||
@@ -766,47 +770,47 @@ async function setUpMacBundle(
|
||||
} else {
|
||||
const template = path.join(staticDir, 'flipper-server-app-template');
|
||||
await fs.copy(template, outputDir);
|
||||
}
|
||||
|
||||
function replacePropertyValue(
|
||||
obj: any,
|
||||
targetValue: string,
|
||||
replacementValue: string,
|
||||
): any {
|
||||
if (typeof obj === 'object' && !Array.isArray(obj) && obj !== null) {
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
obj[key] = replacePropertyValue(
|
||||
obj[key],
|
||||
targetValue,
|
||||
replacementValue,
|
||||
);
|
||||
function replacePropertyValue(
|
||||
obj: any,
|
||||
targetValue: string,
|
||||
replacementValue: string,
|
||||
): any {
|
||||
if (typeof obj === 'object' && !Array.isArray(obj) && obj !== null) {
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
obj[key] = replacePropertyValue(
|
||||
obj[key],
|
||||
targetValue,
|
||||
replacementValue,
|
||||
);
|
||||
}
|
||||
}
|
||||
} else if (typeof obj === 'string' && obj === targetValue) {
|
||||
obj = replacementValue;
|
||||
}
|
||||
} else if (typeof obj === 'string' && obj === targetValue) {
|
||||
obj = replacementValue;
|
||||
return obj;
|
||||
}
|
||||
return obj;
|
||||
|
||||
console.log(`⚙️ Writing plist`);
|
||||
const plistPath = path.join(
|
||||
outputDir,
|
||||
'Flipper.app',
|
||||
'Contents',
|
||||
'Info.plist',
|
||||
);
|
||||
|
||||
/* eslint-disable node/no-sync*/
|
||||
const pListContents: Record<any, any> = plist.readFileSync(plistPath);
|
||||
replacePropertyValue(
|
||||
pListContents,
|
||||
'{flipper-server-version}',
|
||||
versionNumber,
|
||||
);
|
||||
plist.writeBinaryFileSync(plistPath, pListContents);
|
||||
/* eslint-enable node/no-sync*/
|
||||
}
|
||||
|
||||
console.log(`⚙️ Writing plist`);
|
||||
const plistPath = path.join(
|
||||
outputDir,
|
||||
'Flipper.app',
|
||||
'Contents',
|
||||
'Info.plist',
|
||||
);
|
||||
|
||||
/* eslint-disable node/no-sync*/
|
||||
const pListContents: Record<any, any> = plist.readFileSync(plistPath);
|
||||
replacePropertyValue(
|
||||
pListContents,
|
||||
'{flipper-server-version}',
|
||||
versionNumber,
|
||||
);
|
||||
plist.writeBinaryFileSync(plistPath, pListContents);
|
||||
/* eslint-enable node/no-sync*/
|
||||
|
||||
const resourcesOutputDir = path.join(
|
||||
outputDir,
|
||||
'Flipper.app',
|
||||
|
||||
Reference in New Issue
Block a user