sea.getRawAsset(key)


此方法可用于检索在构建时配置为打包到单一可执行应用中的资源。找不到匹配的资源时会抛出错误。

【This method can be used to retrieve the assets configured to be bundled into the single-executable application at build time. An error is thrown when no matching asset can be found.】

sea.getAsset()sea.getAssetAsBlob() 不同,这个方法不会返回副本。相反,它返回打包在可执行文件中的原始资源。

【Unlike sea.getAsset() or sea.getAssetAsBlob(), this method does not return a copy. Instead, it returns the raw asset bundled inside the executable.】

目前,用户应避免写入返回的数组缓冲区。如果注入的部分未标记为可写或未正确对齐,写入返回的数组缓冲区很可能会导致崩溃。

【For now, users should avoid writing to the returned array buffer. If the injected section is not marked as writable or not aligned properly, writes to the returned array buffer is likely to result in a crash.】

  • key <string> 在单个可执行应用配置中,由 assets 字段指定的字典中该资源的键。
  • 返回:<ArrayBuffer>