Sfoglia il codice sorgente

switch sim card & i/o net configure

cs 8 mesi fa
parent
commit
482e6756c3

+ 56 - 0
build_release.sh

@@ -0,0 +1,56 @@
+#!/bin/bash
+
+/home/cs/.jdks/corretto-1.8.0_432/bin/java -version
+
+SIG_PEM_DIR=/home/cs/Desktop/hd/as/wp/kekj/refs/apksign
+JAVA_CMD=/home/cs/.jdks/corretto-1.8.0_432/bin/java
+
+RELEASE_FILE_GROUP=/home/cs/Desktop/hd/as/wp/kekj/radar/新疆毫米波雷达V41
+#APK=$(pwd)/picturegrabbingsystem/build/outputs/apk/debug/picturegrabbingsystem-debug.apk
+APK=$(pwd)/picturegrabbingsystem/release/picturegrabbingsystem-release.apk
+#APK=/home/cs/Desktop/hd/as/wp/kekj/radar/yitihuaProjectSimpleCollectionKN/picturegrabbingsystem/debug/picturegrabbingsystem-debug.apk
+TIME=$(date +%Y%m%d_%H%M%S)
+echo "signed time $TIME"
+SIGNED_OUT_APK_NAME=signed_debug_"$TIME"
+SIGNED_OUT_APK=$SIGNED_OUT_APK_NAME.apk
+echo "apk path:"$APK
+ls -al $APK
+ls -al  $SIGNED_OUT_APK
+rm signed_debug*
+echo "out apk:"$SIGNED_OUT_APK
+$JAVA_CMD -jar $SIG_PEM_DIR/signapk.jar $SIG_PEM_DIR/platform.x509.pem $SIG_PEM_DIR/platform.pk8 $APK $SIGNED_OUT_APK
+if [ $? -eq 0 ]; then
+	echo "signed ok!"
+	ls -al  $(pwd)/$SIGNED_OUT_APK
+	echo "the signed apk is here: "$(pwd)/$SIGNED_OUT_APK
+
+	# check version configures
+	
+	#adb root
+        #adb remount
+	local HW_INDEX
+	read -p "would you like to push configure.txt & setting.json?<y/n>: " HW_INDEX
+	echo "your choice[ "$HW_INDEX " ]"
+	if [ $HW_INDEX == y ]; then 
+		adb push $RELEASE_FILE_GROUP/configure.txt /storage/emulated/0/
+		adb push $RELEASE_FILE_GROUP/setting.json /storage/emulated/0/
+	fi
+	adb uninstall com.kyen.imagedetection
+        adb install -r $(pwd)/$SIGNED_OUT_APK
+	adb shell am start -n com.kyen.imagedetection/com.picturegrabbingsystem.MainActivity
+        #adb logcat --pid=`adb shell ps | grep com.kyen.imagedetection | awk '{print $2}'` -v color -v threadtime
+	local RELEASE_A
+	read -p "would you like to package a release pack?<y/n>: " RELEASE_A
+	echo "your choice [ " $RELEASE_A  " ]"
+	if [ $RELEASE_A == y ];then
+		 local RELEASE_VERSION
+                 read -p "must input version info: " RELEASE_VERSION
+                 echo "version for [ " $RELEASE_VERSION  " ]"
+                 ./release.sh $SIGNED_OUT_APK_NAME $RELEASE_VERSION
+	fi
+else
+	echo "signed failed"
+fi
+
+
+

+ 2 - 2
picturegrabbingsystem/src/main/java/com/picturegrabbingsystem/BaseAgreementInfoVerify.java

@@ -2085,8 +2085,8 @@ public abstract class BaseAgreementInfoVerify {
         return operateBaseInfoDao;
     }
 
-    public static final String DefaltTransfanIp = "47.105.59.150";
-    public static final int DefaltTransfanPort = 2002;
+    public static final String DefaltTransfanIp = "39.104.169.123";
+    public static final int DefaltTransfanPort = 18080;
 
     //切换sim卡
     public void transfanSimCardByXieYi() {

+ 8 - 0
picturegrabbingsystem/src/main/java/com/picturegrabbingsystem/ShangRaoI12015AgreementInfoVerifyUtil.java

@@ -2938,6 +2938,14 @@ public class ShangRaoI12015AgreementInfoVerifyUtil extends BaseAgreementInfoVeri
                 SPUtils.put(UdpApplication.getContext(), Constant.ConnectIP, realConnectIp);
                 SPUtils.put(UdpApplication.getContext(), Constant.ConnectPORT, realConnectPort);
                 fileLog("河南2015I1协议切换内网:IP:" + realConnectIp + ",端口号:" + realConnectPort);
+            } else if(AgreementFactory.DefaultAgreementType == AgreementFactory.gansuI1Agreement){
+                ConnectFactory.setConnectType(ConnectFactory.TcpConnectName);
+                AgreementFactory.setAgreementType(AgreementFactory.gansuI1Agreement);
+                String realConnectIp = (String) SPUtils.get(UdpApplication.getContext(), Constant.RealConnectIp, "192.168.1.31");
+                int realConnectPort = (int) SPUtils.get(UdpApplication.getContext(), Constant.RealConnectPort, 16822);
+                SPUtils.put(UdpApplication.getContext(), Constant.ConnectIP, realConnectIp);
+                SPUtils.put(UdpApplication.getContext(), Constant.ConnectPORT, realConnectPort);
+                fileLog("临汾2015I1协议切换内网:IP:" + realConnectIp + ",端口号:" + realConnectPort);
             }
         } else if (ReadPhoneUtil.getDefaultDataSlotId(UdpApplication.getContext()) == 1) {
             int transSimStartH = (int) SPUtils.get(UdpApplication.getContext(), Constant.TransSimStartH, Constant.DefaultTransSimStartH);

+ 1 - 1
picturegrabbingsystem/src/main/java/com/picturegrabbingsystem/agreementService/ConnectFactory.java

@@ -18,7 +18,7 @@ public class ConnectFactory {
 
     public static int DefaultConnectType = TCP_CONNECT;
 
-    public static int DualPlatformDefaultConnectType = UDP_CONNECT;//双连接默认连接方式
+    public static int DualPlatformDefaultConnectType = TCP_CONNECT;//双连接默认连接方式
     private static UdpHelper udpHelper = null;//公司协议,udp连接
     private static UdpHelper udpHelperCustomerPlatform = null;//四川I1协议,udp连接
     public static CompanyAgreementUdpHelper companyAgreementUdpHelper = null;//公司平台连接

+ 23 - 5
picturegrabbingsystem/src/main/java/com/picturegrabbingsystem/gansuagreement/GanSuZhiYangI1AgreementInfoVerifyUti.java

@@ -2674,21 +2674,39 @@ public class GanSuZhiYangI1AgreementInfoVerifyUti extends BaseAgreementInfoVerif
         LogUtils.e("默认的defaultDataSlotId:" + defaultDataSlotId);
         if (ReadPhoneUtil.getDefaultDataSlotId(UdpApplication.getContext()) == 0) {
             //内网
-            String realConnectIp = (String) SPUtils.get(UdpApplication.getContext(), Constant.RealConnectIp, "175.9.13.254");
-            int realConnectPort = (int) SPUtils.get(UdpApplication.getContext(), Constant.RealConnectPort, 3001);
+            ConnectFactory.setConnectType(ConnectFactory.TcpConnectName);
+            AgreementFactory.setAgreementType(AgreementFactory.gansuI1Agreement);
+            String realConnectIp = (String) SPUtils.get(UdpApplication.getContext(), Constant.RealConnectIp, "192.168.1.31");
+            int realConnectPort = (int) SPUtils.get(UdpApplication.getContext(), Constant.RealConnectPort, 16822);
             SPUtils.put(UdpApplication.getContext(), Constant.ConnectIP, realConnectIp);
             SPUtils.put(UdpApplication.getContext(), Constant.ConnectPORT, realConnectPort);
             fileLog("切换内网:IP:" + realConnectIp + ",端口号:" + realConnectPort);
         } else if (ReadPhoneUtil.getDefaultDataSlotId(UdpApplication.getContext()) == 1) {//外网
+//            //设置连接方式
+//            ConnectFactory.setConnectType(ConnectFactory.UdpConnectName);
+//            AgreementFactory.setAgreementType(AgreementFactory.shangraoI1Agreement);
+//
+//            String transIp = (String) SPUtils.get(UdpApplication.getContext(), Constant.TransfanIp, DefaltTransfanIp);
+//            int tranPort = (int) SPUtils.get(UdpApplication.getContext(), Constant.TransfanPort, DefaltTransfanPort);
+//            SPUtils.put(UdpApplication.getContext(), Constant.ConnectIP, transIp);
+//            SPUtils.put(UdpApplication.getContext(), Constant.ConnectPORT, tranPort);
+//            fileLog("切换外网:IP:" + transIp + ",端口号:" + tranPort);
+            int transSimStartH = (int) SPUtils.get(UdpApplication.getContext(), Constant.TransSimStartH, Constant.DefaultTransSimStartH);
+            int transSimStartM = (int) SPUtils.get(UdpApplication.getContext(), Constant.TransSimStartM, Constant.DefaultTransSimStartM);
+            int transSimEndH = (int) SPUtils.get(UdpApplication.getContext(), Constant.TransSimEndH, Constant.DefaultTransSimEndH);
+            int transSimEndM = (int) SPUtils.get(UdpApplication.getContext(), Constant.TransSimEndM, Constant.DefaultTransSimEndM);
+            String switchCardTimeStr = "切换开始时间:" + transSimStartH + ":" + transSimStartM +
+                    ",切换结束时间:" + transSimEndH + ":" + transSimEndM;
+            fileLog(switchCardTimeStr);
             //设置连接方式
-            ConnectFactory.setConnectType(ConnectFactory.UdpConnectName);
+            int currentSwitchConnectType = ConnectFactory.getCurrentDualConnectType();
+            ConnectFactory.setConnectType(currentSwitchConnectType);
             AgreementFactory.setAgreementType(AgreementFactory.shangraoI1Agreement);
-
             String transIp = (String) SPUtils.get(UdpApplication.getContext(), Constant.TransfanIp, DefaltTransfanIp);
             int tranPort = (int) SPUtils.get(UdpApplication.getContext(), Constant.TransfanPort, DefaltTransfanPort);
             SPUtils.put(UdpApplication.getContext(), Constant.ConnectIP, transIp);
             SPUtils.put(UdpApplication.getContext(), Constant.ConnectPORT, tranPort);
-            fileLog("切换外网:IP:" + transIp + ",端口号:" + tranPort);
+            fileLog("临汾切换外网:IP:"+transIp+":"+ tranPort+" confuse "+ DefaltTransfanIp + ",端口号:" + DefaltTransfanPort);
         }
     }
 

+ 1 - 1
picturegrabbingsystem/src/main/java/com/picturegrabbingsystem/global/AppConfiguer.java

@@ -35,7 +35,7 @@ public class AppConfiguer {
     //南网一体化
     public static final String ClearRainPullTime = "2020-08-11 00:00:00";//清除雨量的时间,每天0点清除
 
-    public static boolean SoftwareTest = true;//发版本的时候要关闭
+    public static boolean SoftwareTest = false;//发版本的时候要关闭
 
     public static final int CameraNumber = 2;//硬件摄像头的个数
     public static boolean CollectOriginalTension = false; //收集原始拉力标志