flexn-io / renative

🚀🚀🚀 Unified Development Platform for iOS, tvOS, Android, Android TV, Android Wear, Web, Tizen TV, Tizen Watch, Tizen Mobile, LG webOS, macOS/OSX, Windows, KaiOS, FirefoxOS Firefox TV platforms
https://renative.org
MIT License
1.82k stars 180 forks source link

rnv shows wrong steps to add crypto key on Windows #1294

Closed pauliusguzas closed 3 months ago

pauliusguzas commented 11 months ago

Describe the bug rnv shows wrong steps to add crypto key on Windows

To Reproduce

  1. go to app-harness
  2. run npx rnv crypto decrypt -> rnv says that you need to add crypto key
  3. follow rnv instructions and run decrypt again -> rnv throws It seems like you provided invalid decryption key

Expected behavior rnv should show correct instructions how to add crypto on windows and decrypting should work

Screenshots or copy&paste image

Desktop (please complete the following information):

pauliusguzas commented 8 months ago

rc.10: followed steps as per cli but still can't decrypt

C:\Users\dev\Desktop\renative\packages\app-harness>npx rnv crypto decrypt

┌──────────────────────────────────────────────────────────────────────────────┐
│                                                                              │
│        ██████╗ ███████╗███╗   ██╗ █████╗ ████████╗██╗██╗   ██╗███████╗       │
│        ██╔══██╗██╔════╝████╗  ██║██╔══██╗╚══██╔══╝██║██║   ██║██╔════╝       │
│        ██████╔╝█████╗  ██╔██╗ ██║███████║   ██║   ██║██║   ██║█████╗         │
│        ██╔══██╗██╔══╝  ██║╚██╗██║██╔══██║   ██║   ██║╚██╗ ██╔╝██╔══╝         │
│        ██║  ██║███████╗██║ ╚████║██║  ██║   ██║   ██║ ╚████╔╝ ███████╗       │
│        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═══╝  ╚══════╝       │
│                                                                              │
│        Version: 1.0.0-rc.10                                                  │
│        https://renative.org                                                  │
│        RNV Firing up!...                                                     │
│        $ npx rnv crypto decrypt                                              │
│        Start Time: 22/02/2024, 11:40:39                                      │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

[ task ] registerEngine:engine-core[1]
[ task ] configureRuntimeDefaults[1] appId:undefined
[ task ] checkAndMigrateProject[1]
[ task ] loadPluginTemplates[1]
[ task ] parseRenativeConfigs[1]
[ task ] getWorkspaceDirPath[1]
[ task ] generatePlatformTemplatePaths[1]
[ task ] checkAndBootstrapIfRequired[1]
[ task ] loadIntegrations[1]
[ task ] loadEngines[1]
[ task ] loadEnginePluginDeps[1]
[ task ] loadEnginePackageDeps[1]
[ task ] findSuitableTask[1]
[ info ] Current Engine: engine-core path: C:\Users\dev\Desktop\renative\packages\engine-core\lib
[ task ] registerMissingPlatformEngines[1]
[ task ] registerEngine:engine-rn[1]
[ task ] registerEngine:engine-rn-tvos[1]
[ task ] registerEngine:engine-rn-next[1]
[ task ] registerEngine:engine-rn-web[1]
[ task ] registerEngine:engine-rn-electron[1]
[ task ] initializeTask[1] crypto decrypt
[ task ] => [crypto decrypt]
[ task ] [crypto decrypt] checkIfProjectAndNodeModulesExists[1]
[ hook ] [crypto decrypt] executePipe ('crypto:decrypt:before')
[ task ] [crypto decrypt] taskRnvCryptoDecrypt[1]
[ task ] => [crypto decrypt] => [project configure]
[ hook ] [project configure] executePipe ('project:configure:before')
[ task ] [project configure] taskRnvProjectConfigure[1]
[ task ] [project configure] checkAndMigrateProject[2]
[ task ] [project configure] loadPluginTemplates[2]
[ task ] [project configure] parseRenativeConfigs[2]
[ task ] [project configure] getWorkspaceDirPath[2]
[ task ] [project configure] generatePlatformTemplatePaths[2]
[ task ] => [project configure] => [workspace configure]
[ task ] [workspace configure] taskRnvWorkspaceConfigure[1]
[ task ] <= [project configure] <= workspace configure
[ task ] [project configure] checkIfTemplateConfigured[1]
[ task ] => [project configure] => [install]
[ hook ] [install] executePipe ('install:before')
[ task ] [install] taskRnvInstall[1] requiresInstall:false:true
[ hook ] [install] executePipe ('install:after')
[ task ] <= [project configure] <= install
[ task ] [project configure] configureRuntimeDefaults[2] appId:harness
[ task ] [project configure] applyTemplate[1] @rnv/template-starter=>undefined
[ task ] [project configure] _applyTemplate[1] current:@rnv/template-starter selected:undefined
[ task ] [project configure] configureRuntimeDefaults[3] appId:harness
[ task ] => [project configure] => [install]
[ hook ] [install] executePipe ('install:before')
[ task ] [install] taskRnvInstall[2] requiresInstall:false:true
[ hook ] [install] executePipe ('install:after')
[ task ] <= [project configure] <= install
[ task ] => [project configure] => [app configure]
[ hook ] [app configure] executePipe ('app:configure:before')
[ task ] [app configure] taskRnvAppConfigure[1]
[ task ] [app configure] listAppConfigsFoldersSync[1] ignoreHiddenConfigs:true
[ task ] [app configure] loadPluginTemplates[3]
[ task ] [app configure] parseRenativeConfigs[3]
[ task ] [app configure] getWorkspaceDirPath[3]
[ task ] [app configure] generatePlatformTemplatePaths[3]
[ task ] [app configure] getWorkspaceDirPath[4]
[ task ] [app configure] generateLocalConfig[1] resetAppId:false
[ info ] [app configure] Current App Config: harness
[ hook ] [app configure] executePipe ('app:configure:after')
[ task ] <= [project configure] <= app configure
[ task ] [project configure] versionCheck[1]
[ task ] [project configure] versionCheck:rnvRunner:1.0.0-rc.10,rnvProject:1.0.0-rc.10[1]
[ task ] [project configure] configureEngines[1]
[ task ] [project configure] resolvePluginDependants[1]
[ task ] [project configure] configurePlugins[1]
[ task ] [project configure] configureRuntimeDefaults[4] appId:harness
[ task ] [project configure] copyRuntimeAssets[1]
[ task ] [project configure] configureTemplateFiles[1]
[ task ] [project configure] checkAndCreateGitignore[1]
[ task ] [project configure] generateRuntimeConfig[1]
[ task ] [project configure] overrideTemplatePlugins[1]
[ task ] [project configure] parsePlugins[1]
[ task ] [project configure] parseFonts[1]
[ task ] [project configure] parsePlugins[2]
[ hook ] [project configure] executePipe ('project:configure:after')
[ task ] <= [crypto decrypt] <= project configure
? How to decrypt to C:\Users\dev\.rnv\@rnv\app-harness ? Yes - override (recommended)
┌──────────────────────────────────────────────────────────────────────────────┐
│  RNV  SUMMARY | 22/02/2024, 11:40:41                                         │
│  $ npx rnv crypto decrypt                                                    │
├──────────────────────────────────────────────────────────────────────────────┤
│  ReNative Version: 1.0.0-rc.10                                               │
│  Project Name ($package.name): @rnv/app-harness                              │
│  Project Version ($package.version): 1.0.0-rc.10                             │
│  Workspace ($.workspaceID): rnv                                              │
│  Engine: engine-core                                                         │
│  Template: @rnv/template-starter@1.0.0-rc.10                                 │
│  App Config (-c): harness                                                    │
│  Build Scheme (-s): debug                                                    │
│  Supported Platforms: ios, android, androidtv, firetv,                       │
│  androidwear, web, webtv, tizen, tvos, webos, macos, windows,                │
│  tizenwatch, tizenmobile, kaios, chromecast                                  │
│  Env Info: win32 | x64 | node v18.19.0                                       │
│  Executed Time: 0h:0m:2s:718ms                                               │
│                                                                              │
│ [ error ] [crypto decrypt] It seems like you provided invalid decryption key.

Error: Authentication failed while decrypting content
    at C:\Users\dev\Desktop\renative\node_modules\iocane\dist\node\encryption.js:69:23
    at step (C:\Users\dev\Desktop\renative\node_modules\iocane\dist\node\encryption.js:33:23)
    at Object.next (C:\Users\dev\Desktop\renative\node_modules\iocane\dist\node\encryption.js:14:53)
    at C:\Users\dev\Desktop\renative\node_modules\iocane\dist\node\encryption.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\dev\Desktop\renative\node_modules\iocane\dist\node\encryption.js:4:12)
    at decryptCBC (C:\Users\dev\Desktop\renative\node_modules\iocane\dist\node\encryption.js:52:12)
    at Session.<anonymous> (C:\Users\dev\Desktop\renative\node_modules\iocane\dist\base\Session.js:83:47)
    at step (C:\Users\dev\Desktop\renative\node_modules\iocane\dist\base\Session.js:46:23)
    at Object.next (C:\Users\dev\Desktop\renative\node_modules\iocane\dist\base\Session.js:27:53)
    at fulfilled (C:\Users\dev\Desktop\renative\node_modules\iocane\dist\base\Session.js:18:58)

SUGGESTION:

STEP 1:
check if your ENV VAR is correct: setx CRYPTO_RNV_RNV_APP_HARNESS "***********"
or if someone did not encrypt C:\Users\dev\Desktop\renative\packages\app-harness\secrets\privateConfigs.enc with a different key

STEP 2:
run crypto decrypt again

IF ALL HOPE IS LOST:
Raise new issue and copy this SUMMARY box output at:
https://github.com/flexn-io/renative/issues
and we will try to help!

│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

C:\Users\dev\Desktop\renative\packages\app-harness>
pauliusguzas commented 8 months ago

if we use single quotes, logs should be changed as well