forked from rustdesk/rustdesk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·75 lines (66 loc) · 1.57 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
set -e
MODE=${1:---debug}
TYPE=${2:-linux}
MODE=${MODE/*-/}
build(){
pwd
$WORKDIR/entrypoint $1
}
build_arm64(){
CWD=$(pwd)
cd $WORKDIR/flutter
flutter pub get
cd $WORKDIR
$WORKDIR/flutter/ndk_arm64.sh
cp $WORKDIR/target/aarch64-linux-android/release/liblibrustdesk.so $WORKDIR/flutter/android/app/src/main/jniLibs/arm64-v8a/librustdesk.so
cd $CWD
}
build_apk(){
cd $WORKDIR/flutter
MODE=$1 $WORKDIR/flutter/build_android.sh
cd $WORKDIR
}
key_gen(){
if [ ! -f $WORKDIR/flutter/android/key.properties ]
then
if [ ! -f $HOME/upload-keystore.jks ]
then
$WORKDIR/.devcontainer/setup.sh key
fi
read -r -p "enter the password used to generate $HOME/upload-keystore.jks\n" password
echo -e "storePassword=${password}\nkeyPassword=${password}\nkeyAlias=upload\nstoreFile=$HOME/upload-keystore.jks" > $WORKDIR/flutter/android/key.properties
else
echo "Believing storeFile is created ref: $WORKDIR/flutter/android/key.properties"
fi
}
android_build(){
if [ ! -d $WORKDIR/flutter/android/app/src/main/jniLibs/arm64-v8a ]
then
$WORKDIR/.devcontainer/setup.sh android
fi
build_arm64
case $1 in
debug)
build_apk debug
;;
release)
key_gen
build_apk release
;;
esac
}
case "$MODE:$TYPE" in
"debug:linux")
build
;;
"release:linux")
build --release
;;
"debug:android")
android_build debug
;;
"release:android")
android_build release
;;
esac