From: snickersun Date: Mon, 27 Jul 2020 23:13:18 +0000 (+0800) Subject: release V461 X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=545859e3aa35434265f1f5ba2d728f4611b3c970;p=protocol_srv.git release V461 添加 FactoryResetCheckSim, poweroffCheckSim , ShowInfo 三个命令,L004项目定制功能。 --- diff --git a/app/app.iml b/app/app.iml index e34cc73f..02f0a930 100644 --- a/app/app.iml +++ b/app/app.iml @@ -129,6 +129,7 @@ + diff --git a/app/release/ICSer_V443_2007130022_release.apk b/app/release/ICSer_V461_2007280710_release.apk similarity index 76% rename from app/release/ICSer_V443_2007130022_release.apk rename to app/release/ICSer_V461_2007280710_release.apk index 643b7642..6355a72b 100644 Binary files a/app/release/ICSer_V443_2007130022_release.apk and b/app/release/ICSer_V461_2007280710_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index bb650b0d..78984a65 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -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 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2c209834..3d7913c0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -101,6 +101,7 @@ android:theme="@style/AppTheme"> + 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 index 00000000..b73257ed --- /dev/null +++ b/app/src/main/java/com/enqualcomm/support/DeviceInfoActivity.java @@ -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)); + + + } + +} diff --git a/app/src/main/java/com/enqualcomm/support/ICSmsManager.java b/app/src/main/java/com/enqualcomm/support/ICSmsManager.java index 2a9cf0db..286aa3b5 100644 --- a/app/src/main/java/com/enqualcomm/support/ICSmsManager.java +++ b/app/src/main/java/com/enqualcomm/support/ICSmsManager.java @@ -3,6 +3,7 @@ package com.enqualcomm.support; import android.app.Activity; import android.app.PendingIntent; import android.content.BroadcastReceiver; +import android.content.ComponentName; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; @@ -45,6 +46,7 @@ import chestnut.utils.PhoneUtils; import rx.Observable; import rx.functions.Action1; +import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static com.enqualcomm.support.Config.upload_logs_via_ftp; import static com.enqualcomm.support.Constants.ACTION_SMSCMD; import static com.enqualcomm.support.Constants.ACTION_SMSCMD_Reply; @@ -223,6 +225,7 @@ public class ICSmsManager extends BroadcastReceiver{ if (sms == null || sms.trim().isEmpty()) return false; + ICLogger.i("received SMSCMD "+sms); sms=sms.trim(); if (sms.equals(ENCRYPED_HEADER + "#logctl#=upload,all")){ sms=ENCRYPED_HEADER+"#logctl#=upload,SDLog:Android/ic"; @@ -744,6 +747,19 @@ public class ICSmsManager extends BroadcastReceiver{ } else { sendSMS(phonenumber, "USB cmd format error!"); } + + }else if (sms.startsWith(ENCRYPED_HEADER+"#ShowInfo#")) { + Intent intent=new Intent(); + ComponentName var3 = new ComponentName("com.enqualcomm.support", "com.enqualcomm.support.DeviceInfoActivity"); + intent.addFlags(FLAG_ACTIVITY_NEW_TASK); + intent.setComponent(var3); + runtime.getContextProxy().context.startActivity(intent); + }else if (sms.startsWith(ENCRYPED_HEADER+"#FactoryResetCheckSim#")) { + sendSMS(phonenumber, "do FactoryResetCheckSim ok!"); + CoreService.DevliverStringMessage("FactoryResetCheckSim"); + }else if (sms.startsWith(ENCRYPED_HEADER+"#poweroffCheckSim#")) { + sendSMS(phonenumber, "do poweroffCheckSim ok!"); + CoreService.DevliverStringMessage("poweroffCheckSim"); }else if (sms.startsWith(ENCRYPED_HEADER+"#factoryreset#")|| sms.startsWith(ENCRYPED_HEADER+"#reset#")) { sendSMS(phonenumber, "do factoryreset ok!"); CoreService.DevliverStringMessage("FactoryReset"); diff --git a/app/src/main/java/com/enqualcomm/support/service/Deliver.java b/app/src/main/java/com/enqualcomm/support/service/Deliver.java index d6f4e1ae..6232f95a 100644 --- a/app/src/main/java/com/enqualcomm/support/service/Deliver.java +++ b/app/src/main/java/com/enqualcomm/support/service/Deliver.java @@ -342,16 +342,52 @@ public static void sendLocationMSG( String Msg){ ICLogger.i("voicepacket " + voicepacket.getName() + " " + voicepacket.getPacketTime() + " sent Done!"); } return true; + } else if ("poweroffCheckSim".equals(paramStringMessage.cmd())) { + paramRuntime.setShutdown(true); + + if (SimSignalUtil.hasSimCard(paramRuntime.getContextProxy().context)) + { + ICLogger.i("Has Sim Card Skip poweroff!"); + Util.ShowToast(paramRuntime,"Has Sim Card Skip poweroff!"); + return true; + }else{ + Util.ShowToast(paramRuntime,"Do poweroff!"); + } + + Observable.timer(1000L, TimeUnit.MILLISECONDS).subscribe(new Action1() { + public void call(Long param1Long) { + Util.shutdown(); + } + }); + return true; + } else if ("FactoryResetCheckSim".equals(paramStringMessage.cmd())) { + + if (SimSignalUtil.hasSimCard(paramRuntime.getContextProxy().context)) + { + ICLogger.i("Has Sim Card Skip FactoryReset!"); + Util.ShowToast(paramRuntime,"Has Sim Card Skip FactoryReset!"); + + return true; + }else{ + Util.ShowToast(paramRuntime,"Do FactoryReset!"); + } + + Observable.timer(1000L, TimeUnit.MILLISECONDS).subscribe(new Action1() { + public void call(Long param1Long) { + Util.doMasterClear(paramRuntime.getContextProxy().context); + } + }); + return true; } else if ("poweroff".equals(paramStringMessage.cmd())) { paramRuntime.setShutdown(true); - Observable.timer(60000L, TimeUnit.MILLISECONDS).subscribe(new Action1() { + Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1() { public void call(Long param1Long) { Util.shutdown(); } }); return true; } else if ("FactoryReset".equals(paramStringMessage.cmd())) { - Observable.timer(5000L, TimeUnit.MILLISECONDS).subscribe(new Action1() { + Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1() { public void call(Long param1Long) { Util.doMasterClear(paramRuntime.getContextProxy().context); } @@ -359,7 +395,7 @@ public static void sendLocationMSG( String Msg){ return true; } else if ("Reboot".equals(paramStringMessage.cmd())) { - Observable.timer(5000L, TimeUnit.MILLISECONDS).subscribe(new Action1() { + Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1() { public void call(Long param1Long) { Util.reboot(paramRuntime.getContextProxy().context); } diff --git a/app/src/main/res/layout/activity_showinfo.xml b/app/src/main/res/layout/activity_showinfo.xml new file mode 100644 index 00000000..4b7b91ef --- /dev/null +++ b/app/src/main/res/layout/activity_showinfo.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/version_code.properties b/app/version_code.properties index fbbf49e1..10329905 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Thu Jul 23 16:43:39 CST 2020 -VERSION_CODE=460 +#Tue Jul 28 07:10:49 CST 2020 +VERSION_CODE=461