diff --git a/1_3.test_code/sh_test/cfe.sh b/1_3.test_code/sh_test/cfe.sh new file mode 100644 index 0000000..4426e5f --- /dev/null +++ b/1_3.test_code/sh_test/cfe.sh @@ -0,0 +1,118 @@ +#!/bin/bash - +#=============================================================================== +# +# FILE: cfe.sh +# +# USAGE: ./cfe.sh +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Karl Zheng (), ZhengKarl#gmail.com +# COMPANY: Meizu +# CREATED: 2014年11月03日 10时27分13秒 CST +# REVISION: --- +#=============================================================================== + +#set -o nounset # Treat unset variables as an error + +function flash_trx_img() +{ + function find_img_file() + { + local fn=openwrt-bcm53xx-bcm4709-meizu-r10-squashfs.trx + local buildDirFn=build_dir/target-arm-openwrt-linux-uclibcgnueabi/linux-bcm53xx/${fn} + dlf=${fn} + if [ ! -f ${fn} ];then + if [ -f ${buildDirFn} ];then + dlf=${buildDirFn} + else + dlf=`find -name ${fn} | head -n 1` + fi + fi + if [ ! -f "${dlf}" ];then + fn=openwrt-ramips-mt7628-mt7628-squashfs-sysupgrade.bin + buildDirFn=build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7628/${fn} + if [ ! -f ${fn} ];then + if [ -f ${buildDirFn} ];then + dlf=${buildDirFn} + else + dlf=`find -name ${fn} | head -n 1` + fi + else + dlf=${fn} + fi + fi + echo "dlf:" + echo "${dlf} " + type xclip + if [ $? == 0 ];then + echo -n ${dlf} | xclip + fi + } + + find_img_file + local flaship="192.168.233.1" + ping -W 2 -c 1 ${flaship} + if [ $? != 0 ];then + ping -W 2 -c 1 "192.168.232.1" + if [ $? != 0 ];then + flaship="192.168.1.1" + else + flaship="192.168.232.1" + fi + fi + echo "flaship: ${flaship}" + + function downloadfw_by_cfe() + { + local p=`cat <<-EOF + -F "Upload=Upload" + EOF` + curl -F files=@${dlf} ${p} --referer "http://${flaship}/" \ + http://${flaship}/f2.htm + } + + function downloadfw_by_openwrt() + { + local sf="/tmp/luci_session.file" + curl "http://${flaship}/cgi-bin/luci/bs/token" 2>/dev/null > ${sf} + local token=$(cat ${sf} | json_xs -t yaml |grep token |awk '{print $2}') + local sysauth=$(cat ${sf} | json_xs -t yaml |grep sysauth |awk '{print $2}') + local clean_param="" + if [ $# -gt 0 ];then + if [ $1 == "clean" ];then + #clean_param='-F "clean=1"' + clean_param='-F clean=1' + echo clean_param="${clean_param}" + fi + fi + echo curl -b "sysauth=${sysauth}; sysauth=" ${clean_param} -F f=@${dlf} "http://${flaship}/cgi-bin/luci/;stok=${token}/api/localupgrade" + curl -b "sysauth=${sysauth}; sysauth=" ${clean_param} -F f=@${dlf} "http://${flaship}/cgi-bin/luci/;stok=${token}/api/localupgrade" + } + + if [ "x${dlf}" == "x" ];then + echo "Not found firmware image in cur dir." + exit 1; + fi + + echo "Are you really want to download file: " + echo "${dlf} " + echo "?" + read -p "y|n" c + if [ "x${c}" == "xy" -o "x${c}" == "xY" -o "x${c}" == "x" ];then + curl -m 5 "http://${flaship}/cgi-bin/luci/bs/token" |grep token + if [ $? == 0 ];then + downloadfw_by_openwrt "$@" + else + downloadfw_by_cfe + fi + else + echo "Cancled download!!" + fi +} + +flash_trx_img "$@" diff --git a/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/android-ampd.iml b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/android-ampd.iml new file mode 100644 index 0000000..2cf41cb --- /dev/null +++ b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/android-ampd.iml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/compiler.xml b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/copyright/profiles_settings.xml b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/misc.xml b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/misc.xml new file mode 100644 index 0000000..401d515 --- /dev/null +++ b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/modules.xml b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/modules.xml new file mode 100644 index 0000000..6d963b6 --- /dev/null +++ b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/modules.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/vcs.xml b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/vcs.xml new file mode 100644 index 0000000..6564d52 --- /dev/null +++ b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/workspace.xml b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/workspace.xml new file mode 100644 index 0000000..b631eb5 --- /dev/null +++ b/1_6.h12_dev/upnp_dlna_server/android-ampd/.idea/workspace.xml @@ -0,0 +1,534 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Android + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1436444082424 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Android (android-ampd)|Android + + + + + + + + scala-sdk-2.10.4 + + + + + + + + 1.7 + + + + + + + + android-ampd + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/1_6.h12_dev/upnp_dlna_server/mupeace b/1_6.h12_dev/upnp_dlna_server/mupeace new file mode 160000 index 0000000..7995933 --- /dev/null +++ b/1_6.h12_dev/upnp_dlna_server/mupeace @@ -0,0 +1 @@ +Subproject commit 7995933b379969833bb51b130ab0f12366b60439