release V461
authorsnickersun <snickersun@qq.com>
Mon, 27 Jul 2020 23:13:18 +0000 (07:13 +0800)
committersnickersun <snickersun@qq.com>
Mon, 27 Jul 2020 23:13:18 +0000 (07:13 +0800)
添加 FactoryResetCheckSim, poweroffCheckSim , ShowInfo 三个命令,L004项目定制功能。

app/app.iml
app/release/ICSer_V461_2007280710_release.apk [moved from app/release/ICSer_V443_2007130022_release.apk with 76% similarity]
app/release/output.json
app/src/main/AndroidManifest.xml
app/src/main/java/com/enqualcomm/support/DeviceInfoActivity.java [new file with mode: 0644]
app/src/main/java/com/enqualcomm/support/ICSmsManager.java
app/src/main/java/com/enqualcomm/support/service/Deliver.java
app/src/main/res/layout/activity_showinfo.xml [new file with mode: 0644]
app/version_code.properties

index e34cc73..02f0a93 100644 (file)
     <orderEntry type="library" name="Gradle: com.kymjs.rxvolley:rxvolley:1.1.3@aar" level="project"/>\r
     <orderEntry type="library" name="Gradle: io.reactivex:rxandroid:1.1.0@aar" level="project"/>\r
     <orderEntry type="module" module-name="dNSCache"/>\r
+    <orderEntry type="module" module-name="dNSCache"/>\r
     <orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK"/>\r
   </component>\r
 </module>\r
similarity index 76%
rename from app/release/ICSer_V443_2007130022_release.apk
rename to app/release/ICSer_V461_2007280710_release.apk
index 643b764..6355a72 100644 (file)
Binary files a/app/release/ICSer_V443_2007130022_release.apk and b/app/release/ICSer_V461_2007280710_release.apk differ
index bb650b0..78984a6 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":460,"versionName":"2007231643","enabled":true,"outputFile":"ICSer_V460_2007231643_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V460_2007231643_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":461,"versionName":"2007280710","enabled":true,"outputFile":"ICSer_V461_2007280710_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V461_2007280710_release.apk","properties":{}}]
\ No newline at end of file
index 2c20983..3d7913c 100644 (file)
         android:theme="@style/AppTheme">
         <activity android:name=".toolActivity"></activity>
         <activity android:name=".GPSActivity"></activity>
+        <activity android:name=".DeviceInfoActivity"></activity>
         <activity android:name=".MainActivity">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
diff --git a/app/src/main/java/com/enqualcomm/support/DeviceInfoActivity.java b/app/src/main/java/com/enqualcomm/support/DeviceInfoActivity.java
new file mode 100644 (file)
index 0000000..b73257e
--- /dev/null
@@ -0,0 +1,38 @@
+package com.enqualcomm.support;
+
+import android.content.ComponentName;
+import android.content.Intent;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.Button;
+import android.widget.TextView;
+
+import com.enqualcomm.support.utils.DeviceInfoUtil;
+import com.enqualcomm.support.utils.SimSignalUtil;
+import com.enqualcomm.support.utils.Util;
+
+import chestnut.utils.PhoneUtils;
+
+import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
+
+public class DeviceInfoActivity extends AppCompatActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_showinfo);
+
+        TextView tv_Version=(TextView)findViewById(R.id.tv_versionname);
+        TextView tv_imei=(TextView)findViewById(R.id.tv_imei);
+        TextView tv_serveraddr=(TextView)findViewById(R.id.tv_serveraddr);
+
+        tv_imei.setText(PhoneUtils.getIMEI(this));
+        tv_Version.setText(Build.DISPLAY);
+        tv_serveraddr.setText(Config.getProtocolServerHost(this)+":"+Config.getProtocolServerPort(this));
+
+
+    }
+
+}
index 2a9cf0d..286aa3b 100644 (file)
@@ -3,6 +3,7 @@ package com.enqualcomm.support;
 import android.app.Activity;\r
 import android.app.PendingIntent;\r
 import android.content.BroadcastReceiver;\r
+import android.content.ComponentName;\r
 import android.content.ContentResolver;\r
 import android.content.Context;\r
 import android.content.Intent;\r
@@ -45,6 +46,7 @@ import chestnut.utils.PhoneUtils;
 import rx.Observable;\r
 import rx.functions.Action1;\r
 \r
+import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;\r
 import static com.enqualcomm.support.Config.upload_logs_via_ftp;\r
 import static com.enqualcomm.support.Constants.ACTION_SMSCMD;\r
 import static com.enqualcomm.support.Constants.ACTION_SMSCMD_Reply;\r
@@ -223,6 +225,7 @@ public class ICSmsManager  extends BroadcastReceiver{
 \r
             if (sms == null || sms.trim().isEmpty()) return false;\r
 \r
+            ICLogger.i("received SMSCMD "+sms);\r
             sms=sms.trim();\r
             if (sms.equals(ENCRYPED_HEADER + "#logctl#=upload,all")){\r
                 sms=ENCRYPED_HEADER+"#logctl#=upload,SDLog:Android/ic";\r
@@ -744,6 +747,19 @@ public class ICSmsManager  extends BroadcastReceiver{
                 } else {\r
                     sendSMS(phonenumber, "USB cmd format error!");\r
                 }\r
+\r
+            }else if (sms.startsWith(ENCRYPED_HEADER+"#ShowInfo#")) {\r
+                Intent intent=new Intent();\r
+                ComponentName var3 = new ComponentName("com.enqualcomm.support", "com.enqualcomm.support.DeviceInfoActivity");\r
+                intent.addFlags(FLAG_ACTIVITY_NEW_TASK);\r
+                intent.setComponent(var3);\r
+                runtime.getContextProxy().context.startActivity(intent);\r
+            }else if (sms.startsWith(ENCRYPED_HEADER+"#FactoryResetCheckSim#")) {\r
+                sendSMS(phonenumber, "do FactoryResetCheckSim ok!");\r
+                CoreService.DevliverStringMessage("FactoryResetCheckSim");\r
+            }else if (sms.startsWith(ENCRYPED_HEADER+"#poweroffCheckSim#")) {\r
+                sendSMS(phonenumber, "do poweroffCheckSim ok!");\r
+                CoreService.DevliverStringMessage("poweroffCheckSim");\r
             }else if (sms.startsWith(ENCRYPED_HEADER+"#factoryreset#")|| sms.startsWith(ENCRYPED_HEADER+"#reset#")) {\r
                 sendSMS(phonenumber, "do factoryreset ok!");\r
                 CoreService.DevliverStringMessage("FactoryReset");\r
index d6f4e1a..6232f95 100644 (file)
@@ -342,16 +342,52 @@ public static void sendLocationMSG( String Msg){
         ICLogger.i("voicepacket " + voicepacket.getName() + " " + voicepacket.getPacketTime() + " sent Done!");\r
       }\r
       return true;\r
+    } else if ("poweroffCheckSim".equals(paramStringMessage.cmd())) {\r
+      paramRuntime.setShutdown(true);\r
+\r
+          if (SimSignalUtil.hasSimCard(paramRuntime.getContextProxy().context))\r
+          {\r
+            ICLogger.i("Has Sim Card Skip poweroff!");\r
+            Util.ShowToast(paramRuntime,"Has Sim Card Skip poweroff!");\r
+            return true;\r
+          }else{\r
+            Util.ShowToast(paramRuntime,"Do poweroff!");\r
+         }\r
+\r
+      Observable.timer(1000L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
+        public void call(Long param1Long) {\r
+          Util.shutdown();\r
+        }\r
+      });\r
+      return true;\r
+    } else if ("FactoryResetCheckSim".equals(paramStringMessage.cmd())) {\r
+\r
+        if (SimSignalUtil.hasSimCard(paramRuntime.getContextProxy().context))\r
+        {\r
+          ICLogger.i("Has Sim Card Skip FactoryReset!");\r
+          Util.ShowToast(paramRuntime,"Has Sim Card Skip FactoryReset!");\r
+\r
+          return true;\r
+        }else{\r
+          Util.ShowToast(paramRuntime,"Do FactoryReset!");\r
+        }\r
+\r
+      Observable.timer(1000L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
+        public void call(Long param1Long) {\r
+          Util.doMasterClear(paramRuntime.getContextProxy().context);\r
+        }\r
+      });\r
+      return true;\r
     } else if ("poweroff".equals(paramStringMessage.cmd())) {\r
       paramRuntime.setShutdown(true);\r
-      Observable.timer(60000L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
+      Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
         public void call(Long param1Long) {\r
           Util.shutdown();\r
         }\r
       });\r
       return true;\r
     } else if ("FactoryReset".equals(paramStringMessage.cmd())) {\r
-      Observable.timer(5000L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
+      Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
         public void call(Long param1Long) {\r
           Util.doMasterClear(paramRuntime.getContextProxy().context);\r
         }\r
@@ -359,7 +395,7 @@ public static void sendLocationMSG( String Msg){
       return true;\r
     } else if ("Reboot".equals(paramStringMessage.cmd())) {\r
 \r
-      Observable.timer(5000L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
+      Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
         public void call(Long param1Long) {\r
           Util.reboot(paramRuntime.getContextProxy().context);\r
         }\r
diff --git a/app/src/main/res/layout/activity_showinfo.xml b/app/src/main/res/layout/activity_showinfo.xml
new file mode 100644 (file)
index 0000000..4b7b91e
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".GPSActivity"
+    android:background="@color/colorIcBg">
+
+    <RelativeLayout
+        android:id="@+id/ic_lc_fix_name"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <TextView
+            android:id="@+id/ic_lc_fix_nametxt"
+            style="@style/IcTextStyle"
+            android:text="Version:"
+            android:textSize="20sp" />
+
+        <TextView
+            android:id="@+id/tv_versionname"
+            style="@style/IcTextStyle"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/ic_lc_fix_nametxt"
+            android:layout_marginStart="10dp"
+            android:autoText="true"
+            android:textSize="20sp" />
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:id="@+id/ic_lc_star_name"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/ic_lc_fix_name">
+
+        <TextView
+            android:id="@+id/ic_lc_star_nametxt"
+            style="@style/IcTextStyle"
+            android:text="IMEI:"
+            android:textSize="20sp" />
+
+        <TextView
+            android:id="@+id/tv_imei"
+            style="@style/IcTextStyle"
+            android:layout_below="@id/ic_lc_star_nametxt"
+            android:layout_marginStart="10dp"
+            android:textSize="20sp" />
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:id="@+id/ic_lc_hoop_name"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/ic_lc_star_name">
+
+        <TextView
+            android:id="@+id/ic_lc_hoop_nametxt"
+            style="@style/IcTextStyle"
+            android:text="ServerIP:"
+            android:textSize="20sp" />
+        <TextView
+            android:id="@+id/tv_serveraddr"
+            style="@style/IcTextStyle"
+            android:layout_below="@id/ic_lc_hoop_nametxt"
+            android:layout_marginStart="10dp"
+            android:textSize="20sp" />
+    </RelativeLayout>
+
+
+</RelativeLayout>
\ No newline at end of file
index fbbf49e..1032990 100644 (file)
@@ -1,2 +1,2 @@
-#Thu Jul 23 16:43:39 CST 2020\r
-VERSION_CODE=460\r
+#Tue Jul 28 07:10:49 CST 2020\r
+VERSION_CODE=461\r