callstack / super-app-showcase

Monorepository template for super app development with React Native and Re.Pack
MIT License
382 stars 63 forks source link

Error: ENOENT: no such file or directory, open '/supper-app-showcase/code-signing.pem #52

Closed tranvuluan closed 11 months ago

tranvuluan commented 12 months ago

This bug occur when I run "yarn run:host:android" after run "yarn start" successfully

L-Shiva-Kumar commented 11 months ago

I got the same error when following the same exact steps.

A deeper digging into packages/auth/webpack.config.mjs shows usage of CodeSigningPlugin.

new Repack.plugins.CodeSigningPlugin({ privateKeyPath: path.join('..', '..', 'code-signing.pem'), outputPath: path.join('build', 'outputs', platform, 'remotes'), }),

The privateKeyPath has reference to code-signing.pem which is not present anywhere in auth directory. @thymikee @jbroma ,it would be great if you can add it in the next commit. Thanks in advance.

jbroma commented 11 months ago

Hi @tranvuluan and @L-Shiva-Kumar,

As we wanted to show production setup in our super-app-showcase, we've recently added some features that are useful for production but not necessarily needed for development. The code-signing.pem is used for signing the release version of the super-app-showcase that we have available, and it was added to .gitignore for security reasons.

Here's what you can do about it:

  1. Generate your own key using this gist
  2. Rename your private key to code-signing.pem and place it in the root of the repository
  3. Change the public keys to your public key in the following places:
    • for Android: packages/host/android/app/src/main/res/values/strings.xml
    • for iOS: packages/host/ios/host/Info.plist

If you don't want to use code-signing you can always disable it like this:

diff --git a/packages/host/index.js b/packages/host/index.js
index ea242fc..2452698 100644
--- a/packages/host/index.js
+++ b/packages/host/index.js
@@ -44,7 +44,7 @@ ScriptManager.shared.addResolver(async (scriptId, caller) => {
     query: {
       platform: Platform.OS, // only needed in development
     },
-    verifyScriptSignature: 'strict',
+    verifyScriptSignature: 'off',
   };
 });