feat(CodeSigningPlugin): auto-embed public key into native project files#1381
feat(CodeSigningPlugin): auto-embed public key into native project files#1381bartekkrok wants to merge 3 commits intocallstack:mainfrom
Conversation
Add publicKeyPath and nativeProjectPaths options to CodeSigningPlugin. When publicKeyPath is set, the plugin automatically embeds the public key into iOS Info.plist and Android strings.xml during compilation, removing the need for manual setup. Also exports embedPublicKey as a standalone utility.
|
@bartekkrok is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: a6948b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
MikitasK
left a comment
There was a problem hiding this comment.
very solid work done 👍👍
I verified both Android & iOS platforms & auto-embeding works perfectly fine 🚀
iOS
Screen.Recording.2026-04-20.at.18.33.16.mp4
Android
Screen.Recording.2026-04-20.at.19.39.58.mp4
here are just a few things to consider before merge:
|
@bartekkrok please check the linting 🙏 |
| publicKeyPath, | ||
| projectRoot, | ||
| iosInfoPlistPath: this.config.nativeProjectPaths?.ios | ||
| ? path.isAbsolute(this.config.nativeProjectPaths.ios) |
There was a problem hiding this comment.
nitpick: maybe we could adjust some of this to avoid many nested ternaries
maybe a getInfoPlistPath function?
| * can verify signed bundles without manual file editing. | ||
| */ | ||
| export function embedPublicKey(config: EmbedPublicKeyConfig): EmbedPublicKeyResult { | ||
| const publicKey = fs.readFileSync(config.publicKeyPath, 'utf-8').trim(); |
There was a problem hiding this comment.
any possibility this readFile could error? and would that cause any issue if this throws?
Linked to: #1323
Summary
Setting up code signing with
CodeSigningPluginrequired users to manually add the RSA public key to native projectfiles (
Info.pliston iOS andstrings.xmlon Android). This is error-prone, easy to forget, and creates amaintenance burden every time the key is rotated.
This PR adds two new optional config options —
publicKeyPathandnativeProjectPaths— that automate public keyembedding during the build:
When publicKeyPath is set the plugin:
The embedding logic lives in the new embedPublicKey.ts module, also exported publicly for standalone use.
Both platforms are idempotent — re-running the build updates the existing entry rather than duplicating it.
Test plan
Live demo iOS
Changes were tested on: https://github.com/callstack/super-app-showcase
Screen.Recording.2026-04-16.at.15.mp4