Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9e2bd02

Browse files
committed
prepare for SaaS
Signed-off-by: 21pages <sunboeasy@gmail.com>
1 parentdb42965 commit9e2bd02

File tree

94 files changed

+4127
-306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+4127
-306
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name:'Modify Source Code'
2+
description:'Modify source code based on client type'
3+
inputs:
4+
appname:
5+
description:'App name'
6+
required:true
7+
8+
runs:
9+
using:'composite'
10+
steps:
11+
-name:Modify source code for ${{ inputs.appname }}
12+
shell:bash
13+
if:${{ inputs.appname != 'RustDesk' }}
14+
run:|
15+
APP_NAME_LOWER=$(echo "${{ inputs.appname }}" | awk '{print tolower($0)}')
16+
echo "Modifying source code for ${{ inputs.appname }}, app name in lowercase: ${APP_NAME_LOWER}"
17+
18+
# libs/hbb_common/src/config.rs
19+
if [[ "$OSTYPE" == "darwin"* ]]; then
20+
sed -i '' "s/pub static ref APP_NAME: RwLock<String> = RwLock::new(\"RustDesk\".to_owned());/pub static ref APP_NAME: RwLock<String> = RwLock::new(\"${{ inputs.appname }}\".to_owned());/g" libs/hbb_common/src/config.rs
21+
else
22+
sed -i "s/pub static ref APP_NAME: RwLock<String> = RwLock::new(\"RustDesk\".to_owned());/pub static ref APP_NAME: RwLock<String> = RwLock::new(\"${{ inputs.appname }}\".to_owned());/g" libs/hbb_common/src/config.rs
23+
fi
24+
echo "Modified APP_NAME in libs/hbb_common/src/config.rs"
25+
26+
# libs/portable/src/main.rs
27+
if [[ "$OSTYPE" == "darwin"* ]]; then
28+
sed -E -i '' 's/const APP_PREFIX: &str = "([^"]*)".*/const APP_PREFIX: \&str = "${APP_NAME_LOWER}";/g' libs/portable/src/main.rs
29+
else
30+
sed -E -i 's/const APP_PREFIX: &str = "([^"]*)".*/const APP_PREFIX: \&str = "${APP_NAME_LOWER}";/g' libs/portable/src/main.rs
31+
fi
32+
echo "Modified APP_PREFIX in libs/portable/src/main.rs"
33+
34+
# android/app/src/main/AndroidManifest.xml
35+
if [[ "$OSTYPE" == "darwin"* ]]; then
36+
sed -i '' "s/RustDesk/${{ inputs.appname }}/g" flutter/android/app/src/main/AndroidManifest.xml
37+
sed -i '' "s/rustdesk/${APP_NAME_LOWER}/g" flutter/android/app/src/main/AndroidManifest.xml
38+
else
39+
sed -i "s/RustDesk/${{ inputs.appname }}/g" flutter/android/app/src/main/AndroidManifest.xml
40+
sed -i "s/rustdesk/${APP_NAME_LOWER}/g" flutter/android/app/src/main/AndroidManifest.xml
41+
fi
42+
echo "Modified AndroidManifest.xml"
43+
44+
# android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt
45+
if [[ "$OSTYPE" == "darwin"* ]]; then
46+
sed -i '' "s/RustDesk/${{ inputs.appname }}/g" flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt
47+
sed -i '' "s/rustdesk/${APP_NAME_LOWER}/g" flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt
48+
else
49+
sed -i "s/RustDesk/${{ inputs.appname }}/g" flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt
50+
sed -i "s/rustdesk/${APP_NAME_LOWER}/g" flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt
51+
fi
52+
echo "Modified MainService.kt"
53+
54+
# flutter/android/app/build.gradle - modify applicationId
55+
# https://developer.android.com/guide/topics/manifest/manifest-element
56+
APP_NAME_UNDERSCORE=$(echo "${APP_NAME_LOWER}" | sed 's/-/_/g')
57+
if [[ "$OSTYPE" == "darwin"* ]]; then
58+
sed -i '' "s/applicationId \"com.carriez.flutter_hbb\"/applicationId \"com.carriez.flutter_hbb.${APP_NAME_UNDERSCORE}\"/g" flutter/android/app/build.gradle
59+
else
60+
sed -i "s/applicationId \"com.carriez.flutter_hbb\"/applicationId \"com.carriez.flutter_hbb.${APP_NAME_UNDERSCORE}\"/g" flutter/android/app/build.gradle
61+
fi
62+
echo "Modified applicationId in build.gradle to com.carriez.flutter_hbb.${APP_NAME_UNDERSCORE}"
63+
64+
# src/server/dbus.rs - modify DBUS_NAME
65+
# https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names
66+
if [[ "$OSTYPE" == "darwin"* ]]; then
67+
sed -i '' "s/const DBUS_NAME: \&str = \"org.rustdesk.rustdesk\";/const DBUS_NAME: \&str = \"com.rustdesk.${APP_NAME_UNDERSCORE}\";/g" src/server/dbus.rs
68+
else
69+
sed -i "s/const DBUS_NAME: \&str = \"org.rustdesk.rustdesk\";/const DBUS_NAME: \&str = \"com.rustdesk.${APP_NAME_UNDERSCORE}\";/g" src/server/dbus.rs
70+
fi
71+
echo "Modified DBUS_NAME in src/server/dbus.rs to com.rustdesk.${APP_NAME_UNDERSCORE}"
72+

‎.github/scripts/custom_res.sh‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# RustDesk - Custom resources script for Linux only
4+
5+
app_name0=$1
6+
app_name=$2
7+
8+
# Update flatpak configuration
9+
sed -i's/..\/res\/scalable.svg/..\/res\/128x128@2x.png/g' flatpak/rustdesk.json
10+
sed -i's/*.desktop",/*.desktop","install -Dm644 128x128@2x.png \/app\/share\/icons\/hicolor\/256x256\/apps\/com.rustdesk.RustDesk.png"/g' flatpak/rustdesk.json
11+
12+
# Process resource directories
13+
forpin res appimage flatpak;do
14+
if [-d"$p" ];then
15+
find$p -type f -exec sed -i'/rustdesk.svg/d' {}\;
16+
find$p -type f -exec sed -i'/scalable.svg/d' {}\;
17+
find$p -type f -exec sed -i"s/RustDesk/${app_name0}/g" {}\;
18+
find$p -type f -exec grep -l"rustdesk" {}\;| xargs -I{} sh -c'sed -i "/com\.rustdesk/!s/rustdesk/'${app_name}'/g" {}'
19+
else
20+
echo"Directory$p does not exist, skipping"
21+
fi
22+
done
23+
24+
mv res/rustdesk.service res/${app_name}.service
25+
mv res/rustdesk.desktop res/${app_name}.desktop
26+
mv res/rustdesk-link.desktop res/${app_name}-link.desktop
27+
mv flatpak/com.rustdesk.RustDesk.metainfo.xml flatpak/com.rustdesk.${app_name0}.metainfo.xml

‎.github/workflows/bridge.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ name: Build flutter-rust-bridge
44

55
on:
66
workflow_call:
7+
inputs:
8+
artifact-name:
9+
description:'Artifact name'
10+
required:false
11+
type:string
12+
default:'bridge-artifact'
713

814
env:
915
CARGO_EXPAND_VERSION:"1.0.95"
@@ -88,7 +94,7 @@ jobs:
8894
-name:Upload Artifact
8995
uses:actions/upload-artifact@master
9096
with:
91-
name:bridge-artifact
97+
name:${{ inputs.artifact-name }}
9298
path:|
9399
./src/bridge_generated.rs
94100
./src/bridge_generated.io.rs

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp