@nativescript/windows-hermes 1.0.0-beta.17 → 1.0.0-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -32,11 +32,7 @@ namespace __PROJECT_NAME__
|
|
|
32
32
|
[DllImport(NativeScriptLibrary, EntryPoint = nameof(runtime_set_local_folder))]
|
|
33
33
|
private static extern void runtime_set_local_folder([MarshalAs(UnmanagedType.LPUTF8Str)] string localFolder);
|
|
34
34
|
|
|
35
|
-
//
|
|
36
|
-
// app.nsbundle containers). Must be called before runtime_init if used at all: apps
|
|
37
|
-
// packed with the default pepper (no --key-hex) never need to call this. Not wired to a
|
|
38
|
-
// default call site here; an app author supplies their own key material and calls this
|
|
39
|
-
// from Initialize() before runtime_init(...).
|
|
35
|
+
// Must be called before runtime_init, which opens app.nsbundle.
|
|
40
36
|
[DllImport(NativeScriptLibrary, EntryPoint = nameof(runtime_set_bundle_key))]
|
|
41
37
|
private static extern int runtime_set_bundle_key([MarshalAs(UnmanagedType.LPUTF8Str)] string keyHex);
|
|
42
38
|
|
|
@@ -252,6 +248,15 @@ namespace __PROJECT_NAME__
|
|
|
252
248
|
}
|
|
253
249
|
}
|
|
254
250
|
|
|
251
|
+
private static void ApplyBundleKey()
|
|
252
|
+
{
|
|
253
|
+
using var stream = typeof(RuntimeHost).Assembly.GetManifestResourceStream("NSBundleKey");
|
|
254
|
+
if (stream == null) return;
|
|
255
|
+
using var reader = new StreamReader(stream);
|
|
256
|
+
try { runtime_set_bundle_key(reader.ReadToEnd().Trim()); }
|
|
257
|
+
catch (EntryPointNotFoundException) { }
|
|
258
|
+
}
|
|
259
|
+
|
|
255
260
|
public void Initialize()
|
|
256
261
|
{
|
|
257
262
|
if (_initialized) return;
|
|
@@ -259,6 +264,7 @@ namespace __PROJECT_NAME__
|
|
|
259
264
|
try { attached = AttachConsole(ATTACH_PARENT_PROCESS); } catch { }
|
|
260
265
|
runtime_install_ctrlc_handler(0);
|
|
261
266
|
runtime_set_local_folder(LocalFolderPath);
|
|
267
|
+
ApplyBundleKey();
|
|
262
268
|
_runtime = runtime_init(AppContext.BaseDirectory);
|
|
263
269
|
#if DEBUG
|
|
264
270
|
TrySetDebugBuild();
|
|
@@ -87,6 +87,9 @@
|
|
|
87
87
|
<Content Include="app.nsbundle" Condition="Exists('app.nsbundle')">
|
|
88
88
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
89
89
|
</Content>
|
|
90
|
+
<!-- app.nsbundle's per-build key; RuntimeHost passes it to the runtime. -->
|
|
91
|
+
<EmbeddedResource Include="nsbundle.key" LogicalName="NSBundleKey"
|
|
92
|
+
Condition="Exists('app.nsbundle') and Exists('nsbundle.key')" />
|
|
90
93
|
<Content Include="app\**\*" Condition="!Exists('app.nsbundle')">
|
|
91
94
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
92
95
|
</Content>
|
|
Binary file
|