跳过内容

加密

本文档解释了如何迁移到加密v2系统。了解更多关于加密v2系统的信息,请参阅 博客文章.

终端窗口
npx @capgo/cli key create

安全存储私钥。永远不要将其提交到源代码控制或与不信任的方共享。

此命令:

  • 在您的应用程序中创建新密钥对
  • 从您的Capacitor配置中删除旧密钥
  • 保留旧密钥文件以实现向后兼容

当提示“是否要使用新频道设置加密,以便支持旧应用程序并简化迁移?”时,选择是。这会向您的__CAPGO_KEEP_0__配置中添加一个新选项。 defaultChannel 当提示“是否要使用新频道设置加密,以便支持旧应用程序并简化迁移?”时,选择是。这会向您的Capacitor配置中添加一个新选项。

capacitor.config.ts
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.example.app',
appName: 'Example App',
plugins: {
CapacitorUpdater: {
// ... other options
defaultChannel: 'encryption_v2' // New apps will use this channel
}
}
};
export default config;

3. 将打包文件上传到新频道

标题:3. 将打包文件上传到新频道
终端窗口
npx @capgo/cli bundle upload --channel encryption_v2

4. 启用自我赋值

标题:4. 启用自我赋值
终端窗口
npx @capgo/cli channel set encryption_v2 --self-assign

5. 上传到旧频道

标题:5. 上传到旧频道
终端窗口
npx @capgo/cli bundle upload --channel production

6. 清理(3-4个月后)

标题:6. 清理(3-4个月后)

一旦所有用户都更新了他们的应用:

  1. 移除 defaultChannel 从你的Capacitor配置中
  2. 删除旧频道:
终端窗口
npx @capgo/cli channel delete encryption_v2

If you are using __CAPGO_KEEP_0__ for security and compliance, connect it with __CAPGO_KEEP_0__ for the implementation detail in __CAPGO_KEEP_0__, __CAPGO_KEEP_1__ for the implementation detail in __CAPGO_KEEP_1__, __CAPGO_KEEP_2__ Security Scanner for the product workflow in __CAPGO_KEEP_2__ Security Scanner, __CAPGO_KEEP_3__ Security for the product workflow in __CAPGO_KEEP_3__ Security, and __CAPGO_KEEP_4__ Trust Center 東为突了 to plan security and compliance connect it with for the implementation detail in for the implementation detail in __CAPGO_KEEP_2__ Security Scanner Capgo Security Scanner for the product workflow in Capgo Security Scanner, Capgo Security for the product workflow in Capgo Security, and Capgo 为产品工作流程在Capgo信任中心中.