diff --git a/host/bins/cfc-0.1.0-x64.deb b/host/bins/cfc-0.1.0-x64.deb index 3605fcf..dbc0c3a 100644 Binary files a/host/bins/cfc-0.1.0-x64.deb and b/host/bins/cfc-0.1.0-x64.deb differ diff --git a/host/src/pack/dpkg/etc/rc.civ b/host/src/pack/dpkg/etc/rc.civ index 60a2d72..b9c6dc2 100755 --- a/host/src/pack/dpkg/etc/rc.civ +++ b/host/src/pack/dpkg/etc/rc.civ @@ -1,16 +1,30 @@ #!/bin/sh -e # Wait the ukui-session ready. +#while true +#do +# if pgrep -u `whoami` -x "ukui-session" > /dev/null +# then +# break +# else +# sleep 1 +# fi +#done + while true do - if pgrep -u `whoami` -x "ukui-session" > /dev/null - then - break - else - sleep 1 - fi + + num_session_process=`ps aux | grep "$USER.*gnome-session-binary.*--session=ubuntu" | grep -v grep | wc -l` + if [ $num_session_process -ge 1 ]; + then + break + else + sleep 1 + fi done +sleep 5 + CIV_PATH=/opt/civ/data/Release_Deb TEMP_LOG=$HOME/.civ.log diff --git a/host/src/pack/dpkg/etc/rc.civ.post b/host/src/pack/dpkg/etc/rc.civ.post index ccb8c84..a888294 100755 --- a/host/src/pack/dpkg/etc/rc.civ.post +++ b/host/src/pack/dpkg/etc/rc.civ.post @@ -48,19 +48,19 @@ function pause_civ() sleep 10 -is_civ_ready || exit -1 +#is_civ_ready || exit -1 ${CIV_PATH}/scripts/stream & # LG_B1_Client_input will be launched in rc.civ.pre #launch_lg_input_client -/etc/sharefolder_monitor.sh & +#/etc/sharefolder_monitor.sh & -balloon_civ +#balloon_civ /opt/lg/bin/LG_B1_Client_clipboard guestClipboard:enable=true & -pause_civ +#pause_civ exit 0 diff --git a/host/src/pack/dpkg/etc/rc.civ.pre b/host/src/pack/dpkg/etc/rc.civ.pre index c7fd7da..717e98c 100755 --- a/host/src/pack/dpkg/etc/rc.civ.pre +++ b/host/src/pack/dpkg/etc/rc.civ.pre @@ -1,15 +1,30 @@ #!/bin/sh -e +#while true +#do +# if pgrep -u `whoami` -x "ukui-session" > /dev/null +# then +# break +# else +# sleep 1 +# fi +#done +#sleep 10 + while true do - if pgrep -u `whoami` -x "ukui-session" > /dev/null - then - break - else - sleep 1 - fi + + num_session_process=`ps aux | grep "$USER.*gnome-session-binary.*--session=ubuntu" | grep -v grep | wc -l` + if [ $num_session_process -ge 1 ]; + then + break + else + sleep 1 + fi done -sleep 10 + +sleep 5 + export DISPLAY=:0 THEUSER=$(users | awk '{print $1;}') LOGPATH=/home/$THEUSER/.userdata diff --git a/host/src/pack/dpkg/opt/cfc/mwc/bin/api_test b/host/src/pack/dpkg/opt/cfc/mwc/bin/api_test index 1bd665e..fdd4337 100755 Binary files a/host/src/pack/dpkg/opt/cfc/mwc/bin/api_test and b/host/src/pack/dpkg/opt/cfc/mwc/bin/api_test differ diff --git a/host/src/pack/dpkg/opt/cfc/mwc/bin/lg_launcher.sh b/host/src/pack/dpkg/opt/cfc/mwc/bin/lg_launcher.sh index e3e33f2..4373e50 100755 --- a/host/src/pack/dpkg/opt/cfc/mwc/bin/lg_launcher.sh +++ b/host/src/pack/dpkg/opt/cfc/mwc/bin/lg_launcher.sh @@ -91,9 +91,9 @@ if [ ! -z ${ENABLE_CIV_BALLOON} ]; then fi # Pause CiV -if [ -z "$(pidof mwc_launcher)" ] && [ -z "$(pidof LG_B1_Client)" ] && [ -z "$(pgrep -ax adb | grep -v "fork-server")" ]; then - /opt/cfc/mwc/bin/pause_civ.sh -fi +#if [ -z "$(pidof mwc_launcher)" ] && [ -z "$(pidof LG_B1_Client)" ] && [ -z "$(pgrep -ax adb | grep -v "fork-server")" ]; then +# /opt/cfc/mwc/bin/pause_civ.sh +#fi exit 0 diff --git a/host/src/pack/dpkg/opt/cfc/mwc/bin/loadapp_single_lg.sh b/host/src/pack/dpkg/opt/cfc/mwc/bin/loadapp_single_lg.sh index e5900b6..1bfa6a4 100755 --- a/host/src/pack/dpkg/opt/cfc/mwc/bin/loadapp_single_lg.sh +++ b/host/src/pack/dpkg/opt/cfc/mwc/bin/loadapp_single_lg.sh @@ -41,7 +41,8 @@ then fi /opt/cfc/mwc/bin/msg_agent localhost 3000 CLOSEAPP_LASTOPENED else - /opt/lg/bin/LG_B1_Client -Q $1 -t $4 + #/opt/lg/bin/LG_B1_Client -Q $1 -t $4 + echo "Do nothing." fi exit 0 diff --git a/host/src/pack/dpkg/opt/cfc/mwc/bin/msg_agent b/host/src/pack/dpkg/opt/cfc/mwc/bin/msg_agent index 2263b10..133eabb 100755 Binary files a/host/src/pack/dpkg/opt/cfc/mwc/bin/msg_agent and b/host/src/pack/dpkg/opt/cfc/mwc/bin/msg_agent differ diff --git a/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc b/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc index dd0dd82..12dd57d 100755 Binary files a/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc and b/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc differ diff --git a/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc_hostdaemon b/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc_hostdaemon index f280cf9..098d090 100755 Binary files a/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc_hostdaemon and b/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc_hostdaemon differ diff --git a/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc_launcher b/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc_launcher index 163606e..d4f1a49 100755 Binary files a/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc_launcher and b/host/src/pack/dpkg/opt/cfc/mwc/bin/mwc_launcher differ diff --git a/host/src/pack/dpkg/opt/cfc/mwc/bin/update_lunch_ubuntu.sh b/host/src/pack/dpkg/opt/cfc/mwc/bin/update_lunch_ubuntu.sh new file mode 100755 index 0000000..543e541 --- /dev/null +++ b/host/src/pack/dpkg/opt/cfc/mwc/bin/update_lunch_ubuntu.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +sfilename=$0 + +if [ "x${sfilename}" == "x-bash" ]; then + sfilename=$BASE_SOURCE +fi + +exec_pwd=$(cd $(dirname $sfilename);pwd) + +echo "Start to update app .desktop file for Ubuntu ..." + +#dir_desktop_app=${HOME}/.local/share/applications/ +dir_desktop_app=${HOME}/applications + +cd $dir_desktop_app +NUM_PARAMS=$# + +if [[ "$NUM_PARAMS" -eq "1" ]]; +then + echo "Update ubuntu launch icon for given app..." + app_pkg=$1 + lunch_file="$1.desktop" + if [[ -f $lunch_file ]]; + then + echo "Processing app lunch file for kylin: $lunch_file" + sed -i "s%^Name\[zh_CN\]=%Name=%g" $lunch_file + echo "Copy app .desktop file: $lunch_file to /usr/share/applications/ folder." + cp "$lunch_file" ${HOME}/.local/applications/ + cd - + fi +else + echo "Update Ubuntu luanch icons in batch mode..." + lunch_files="`ls *.desktop`" + for app_desktop_file in $lunch_files + do + echo "Processing app lunch file for kylin: $app_desktop_file" + sed -i "s%^Name\[zh_CN\]=%Name=%g" $app_desktop_file + + done + echo "Copy app .desktop files to ~/.local/share/applications/ folder..." + cp *.desktop ${HOME}/.local/share/applications/ + cd - +fi + +echo "Android app lunch icon updating done." diff --git a/host/src/pack/dpkg/opt/cfc/mwc/lib/libkydroid.so b/host/src/pack/dpkg/opt/cfc/mwc/lib/libkydroid.so index 1fccbb6..746c88b 100755 Binary files a/host/src/pack/dpkg/opt/cfc/mwc/lib/libkydroid.so and b/host/src/pack/dpkg/opt/cfc/mwc/lib/libkydroid.so differ diff --git a/host/src/pack/pack-cfc.sh b/host/src/pack/pack-cfc.sh index cf35d67..6ed1f8d 100755 --- a/host/src/pack/pack-cfc.sh +++ b/host/src/pack/pack-cfc.sh @@ -1,14 +1,52 @@ -cp ../pghost/mwc dpkg/opt/cfc/mwc/bin/mwc -cp ../pghost/mwc_hostdaemon dpkg/opt/cfc/mwc/bin/mwc_hostdaemon -cp ../pghost/mwc_launcher dpkg/opt/cfc/mwc/bin/mwc_launcher -cp ../pghost/loadapp.sh dpkg/opt/cfc/mwc/bin/loadapp.sh -cp ../pghost/killapp.sh dpkg/opt/cfc/mwc/bin/killapp.sh -cp ../pghost/closeapp.sh dpkg/opt/cfc/mwc/bin/closeapp.sh -cp ../pghost/api_test dpkg/opt/cfc/mwc/bin/api_test -cp ../pghost/libkydroid.so dpkg/opt/cfc/mwc/lib/libkydroid.so -cp ../pghost/msg_agent dpkg/opt/cfc/mwc/bin/msg_agent -cp ../pghost/kill_app_process.sh dpkg/opt/cfc/mwc/bin/kill_app_process.sh -cp ../pghost/check_android_running.sh dpkg/opt/cfc/mwc/bin/check_android_running.sh -cp ../pghost/loadapp_single_lg.sh dpkg/opt/cfc/mwc/bin/loadapp_single_lg.sh +#!/bin/bash + +if [[ -f ../pghost/mwc ]]; +then + cp ../pghost/mwc dpkg/opt/cfc/mwc/bin/mwc + echo "Copied mwc file for debian file packaging." +else + echo "mwc not found, please execute the source compiling first!" +fi + +if [[ -f ../pghost/mwc_hostdaemon ]]; +then + cp ../pghost/mwc_hostdaemon dpkg/opt/cfc/mwc/bin/mwc_hostdaemon + echo "Copied mwc_hostdaemon file for debian file packaging." +else + echo "mwc_hostdaemon not found, please execute the source compiling first!" +fi + +if [[ -f ../pghost/mwc_launcher ]]; +then + cp ../pghost/mwc_launcher dpkg/opt/cfc/mwc/bin/mwc_launcher + echo "Copied mwc_launcer file for debian file packagng." +else + echo "mwc_launcher not foud, please execute the source compiling first!" +fi + +if [[ -f ../pghost/api_test ]]; +then + cp ../pghost/api_test dpkg/opt/cfc/mwc/bin/api_test + echo "Copied api_test file for debian file packagng." +else + echo "api_test not foud, please execute the source compiling first!" +fi + +if [[ -f ../pghost/libkydroid.so ]]; +then + cp ../pghost/libkydroid.so dpkg/opt/cfc/mwc/lib/libkydroid.so + echo "Copied libkydroid.so file for debian file packagng." +else + echo "libkydroid.so not foud, please execute the source compiling first!" +fi + +if [[ -f ../pghost/msg_agent ]]; +then + cp ../pghost/msg_agent dpkg/opt/cfc/mwc/bin/msg_agent + echo "Copied msg_agent file for debian file packagng." +else + echo "msg_agent not foud, please execute the source compiling first!" +fi + dpkg -b dpkg cfc-0.1.0-x64.deb diff --git a/host/src/pghost/check_android_running.sh b/host/src/pghost/check_android_running.sh deleted file mode 100755 index 1c1e805..0000000 --- a/host/src/pghost/check_android_running.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - - -num_civ_insts=`ps aux | grep qemu.*android | grep -v grep | wc -l` - -exit $num_civ_insts - diff --git a/host/src/pghost/closeapp.sh b/host/src/pghost/closeapp.sh deleted file mode 100755 index 9ad6836..0000000 --- a/host/src/pghost/closeapp.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -NUM_PARAMS=$# - -if [[ "$NUM_PARAMS" -lt "2" ]]; -then - echo "Usage: closeapp.sh " - exit 1 -fi - -/opt/cfc/mwc/bin/msg_agent localhost 3000 CLOSEAPP $@ - -exit 0 - diff --git a/host/src/pghost/kill_app_process.sh b/host/src/pghost/kill_app_process.sh deleted file mode 100755 index ab509a3..0000000 --- a/host/src/pghost/kill_app_process.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - - -NUM_PARAMS=$# - -if [[ "$NUM_PARAMS" -lt "1" ]]; -then - echo "Usage: kill_app_process.sh " - exit 1 -fi - -pid=`ps aux | grep "LG_B1_Client.*$2" | grep -v grep | awk '{print $2}'` - -if [[ $pid > 0 ]]; -then - kill -KILL $pid -fi - -exit 0 - diff --git a/host/src/pghost/killapp.sh b/host/src/pghost/killapp.sh deleted file mode 100755 index ca100dc..0000000 --- a/host/src/pghost/killapp.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -NUM_PARAMS=$# - -if [[ "$NUM_PARAMS" -lt "3" ]]; -then - echo "Usage: killapp.sh " - exit 1 -fi - -adb -s vsock:3:5555 shell am force-stop $1 - -exit 0 - diff --git a/host/src/pghost/loadapp.sh b/host/src/pghost/loadapp.sh deleted file mode 100755 index 1eb643a..0000000 --- a/host/src/pghost/loadapp.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -NUM_PARAMS=$# - -if [[ "$NUM_PARAMS" -lt "3" ]]; -then - echo "Usage: loadapp.sh " - exit 1 -fi - -adb -s vsock:3:5555 shell am start -n $2 --display $3 -/opt/lg/bin/LG_B1_Client -M yes -R 16666 -f /dev/shm/looking-glass$3 -a true -t $1 - - -exit 0 - diff --git a/host/src/pghost/loadapp_single_lg.sh b/host/src/pghost/loadapp_single_lg.sh deleted file mode 100755 index e5900b6..0000000 --- a/host/src/pghost/loadapp_single_lg.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# Get the number of running Android guest instances. -num_civ_insts=`ps aux | grep qemu.*android | grep -v grep | wc -l` - -# Start the civ service if Android guest is not started yet. -if [ "$num_civ_insts" -lt "1" ]; -then - systemctl --user start civ -fi - -NUM_PARAMS=$# - -if [[ "$NUM_PARAMS" -lt "3" ]]; -then - echo "Usage: loadapp.sh [app icon label]" - exit 1 -fi - -num_adb_devices=`adb devices | grep vsock.*device | grep -v grep | wc -l` -if [[ "$num_adb_devices" -lt "1" ]]; -then - adb connect "vsock:3:5555" -fi - - -adb -s vsock:3:5555 shell am start -n $2 --display 0 - -num_lg_insts=`ps aux | grep LG_B1_Client.*looking-glass | grep -v guestClipboard.*enable.*true | grep -v grep | wc -l` - -echo "App name: $1, Activity: $2, LG Instance ID: $3 Label: $4" - -if [[ "$num_lg_insts" -lt "1" ]]; -then - #/opt/lg/bin/LG_B1_Client -M yes -R 16666 -f /dev/shm/looking-glass0 -a true -t $1 - if [[ "$NUM_PARAMS" -ge "4" ]]; - then - /opt/lg/bin/LG_B1_Client -M yes -R 16666 -f /dev/shm/looking-glass0 -a true -t $4 -P $1 - else - /opt/lg/bin/LG_B1_Client -M yes -R 16666 -f /dev/shm/looking-glass0 -a true -t "安卓应用" - fi - /opt/cfc/mwc/bin/msg_agent localhost 3000 CLOSEAPP_LASTOPENED -else - /opt/lg/bin/LG_B1_Client -Q $1 -t $4 -fi - -exit 0 -