前期准备
将rustdesk与hbb_common下载下来,建同名仓库,仓库选择私有(因为代码中放了一些密钥信息)
https://github.com/rustdesk/rustdesk
https://github.com/rustdesk/hbb_common
申请一个github 的 token
1、修改 hbb_common 仓库中的内容
在文件 src/config.rs 下修改
将字段RENDEZVOUS_SERVERS RS_PUB_KEY 改为自己的地址

将字段 HARD_SETTINGS 改为如下
pub static ref HARD_SETTINGS: RwLock<HashMap<String, String>> = {
let mut map = HashMap::new();
map.insert("password".to_string(), "这是密码".to_string());
RwLock::new(map)
};
将以上修改 push 即可
2、修改 rustdesk 仓库中的内容
删除libs/hbb_common文件夹,添加上面自己修改过的 hbb_common 子模块
git submodule add https://github.com/WishMelz/hbb_common libs/hbb_common
git submodule sync
查找到 rustdesk 仓库中 src/common.rs 文件的 get_custom_rendezvous_server 这个函数,下面有个官方的 api 地址,将其替换成自己的
修改几个脚本文件的权限
git update-index --chmod=+x ./flutter/build_android_deps.sh
git update-index --chmod=+x ./build.py
git update-index --chmod=+x ./flutter/build_android.sh
git update-index --chmod=+x ./flutter/build_fdroid.sh
由于是私有仓库,所以需要设置token,因为Actions获取不到仓库内容
全局搜索 actions/checkout@v4,会有很多个,每个地址都加上
添加一行:token: ghp_WzxczxcfsdfsdfLNUry30IUGW (ghp_就是你的github token)
3、github 操作
找到 Settings → Actions → General,确保勾选 Allow all actions and reusable workflows 和 Read and write permissions 两项
编译有两种,tag/分支
1、tag
git tag -a TagName -m "message"
git push --tags2、分支
直接main分支即可
转至:https://linux.do/t/topic/742121 优化了其中 Actions 编译的问题