Browse Source

1.事件日志添加说明

20241218TB223FC(测试jar包)
wangwanlei 9 months ago
parent
commit
cb6fa0bb21

+ 49
- 0
app/src/main/java/com/xhly/manageapp/bean/EventLog.kt View File

64
      */
64
      */
65
     const val STARTAPPEVENT = 213
65
     const val STARTAPPEVENT = 213
66
 
66
 
67
+
68
+    /**
69
+     * 更换SIM卡
70
+     */
71
+    const val SIMEVENTSTRING ="更换SIM卡"
72
+
73
+    /**
74
+     * 违规开启蓝牙
75
+     */
76
+    const val BLUETOOHEVENTSTRING = "违规开启蓝牙"
77
+
78
+
79
+    /**
80
+     * USB连接电脑
81
+     */
82
+    const val USBCONNECTEVENTSTRING = "USB连接电脑"
83
+
84
+    /**
85
+     *  USB断开电脑
86
+     */
87
+    const val USBDISCONNECTEVENTSTRING = "USB拔出电脑"
88
+
89
+    /**
90
+     * 插入SD卡
91
+     */
92
+    const val SDEMOUNTEDVENTSTRING = "插入SD卡"
93
+
94
+    /**
95
+     * 拔出SD卡
96
+     */
97
+    const val SDEJECTEVENTSTRING = "拔出SD卡"
98
+
99
+
100
+    /**
101
+     * 账号登录
102
+     */
103
+    const val ACCOUNTLOGINEVENTSTRING ="账号登录"
104
+
105
+
106
+    /**
107
+     * 首次使用
108
+     */
109
+    const val FIRSTEVENTSTRING = "首次使用"
110
+
111
+    /**
112
+     * 账号退出
113
+     */
114
+    const val ACCOUNTQUITEVENTSTRING = "账号退出"
115
+
67
 }
116
 }

+ 8
- 7
app/src/main/java/com/xhly/manageapp/ui/login/activity/LoginActivity.kt View File

176
             ManageApplication.getDeviceInfo()?.let {
176
             ManageApplication.getDeviceInfo()?.let {
177
                 data.sn = it
177
                 data.sn = it
178
             }
178
             }
179
-            data.comm = "首次使用"
179
+            data.comm = EventLog.FIRSTEVENTSTRING
180
             data.doEvent = EventLog.FIRSTEVENT
180
             data.doEvent = EventLog.FIRSTEVENT
181
             viewModel.eventLog(data)
181
             viewModel.eventLog(data)
182
             currentSpUtils.setParam(Const.FIRSTFLAG,false)
182
             currentSpUtils.setParam(Const.FIRSTFLAG,false)
234
             data.sn = it
234
             data.sn = it
235
         }
235
         }
236
         data.doEvent = EventLog.ACCOUNTLOGINEVENT
236
         data.doEvent = EventLog.ACCOUNTLOGINEVENT
237
+        data.comm=EventLog.ACCOUNTLOGINEVENTSTRING
237
         viewModel.eventLog(data)
238
         viewModel.eventLog(data)
238
         Const.USERID=userBean.userid
239
         Const.USERID=userBean.userid
239
         Const.USERNAME=userBean.username.toString()
240
         Const.USERNAME=userBean.username.toString()
330
                 ManageApplication.getDeviceInfo()?.let {
331
                 ManageApplication.getDeviceInfo()?.let {
331
                     data.sn = it
332
                     data.sn = it
332
                 }
333
                 }
333
-                data.comm = "SD卡插入"
334
+                data.comm = EventLog.SDEMOUNTEDVENTSTRING
334
                 data.doEvent = EventLog.SDEMOUNTEDVENT
335
                 data.doEvent = EventLog.SDEMOUNTEDVENT
335
                 viewModel.eventLog(data)
336
                 viewModel.eventLog(data)
336
             }
337
             }
340
                 ManageApplication.getDeviceInfo()?.let {
341
                 ManageApplication.getDeviceInfo()?.let {
341
                     data.sn = it
342
                     data.sn = it
342
                 }
343
                 }
343
-                data.comm = "SD卡拔出"
344
+                data.comm =EventLog.SDEJECTEVENTSTRING
344
                 data.doEvent = EventLog.SDEJECTEVENT
345
                 data.doEvent = EventLog.SDEJECTEVENT
345
                 viewModel.eventLog(data)
346
                 viewModel.eventLog(data)
346
             }
347
             }
350
                 ManageApplication.getDeviceInfo()?.let {
351
                 ManageApplication.getDeviceInfo()?.let {
351
                     data.sn = it
352
                     data.sn = it
352
                 }
353
                 }
353
-                data.comm = "SIM卡安装"
354
+                data.comm = EventLog.SIMEVENTSTRING
354
                 data.doEvent = EventLog.SIMEVENT
355
                 data.doEvent = EventLog.SIMEVENT
355
                 viewModel.eventLog(data)
356
                 viewModel.eventLog(data)
356
             }
357
             }
360
                 ManageApplication.getDeviceInfo()?.let {
361
                 ManageApplication.getDeviceInfo()?.let {
361
                     data.sn = it
362
                     data.sn = it
362
                 }
363
                 }
363
-                data.comm = "蓝牙打开"
364
+                data.comm = EventLog.BLUETOOHEVENTSTRING
364
                 data.doEvent = EventLog.BLUETOOHEVENT
365
                 data.doEvent = EventLog.BLUETOOHEVENT
365
                 viewModel.eventLog(data)
366
                 viewModel.eventLog(data)
366
             }
367
             }
370
                 ManageApplication.getDeviceInfo()?.let {
371
                 ManageApplication.getDeviceInfo()?.let {
371
                     data.sn = it
372
                     data.sn = it
372
                 }
373
                 }
373
-                data.comm = "usb连接"
374
+                data.comm = EventLog.USBCONNECTEVENTSTRING
374
                 data.doEvent = EventLog.USBCONNECTEVENT
375
                 data.doEvent = EventLog.USBCONNECTEVENT
375
                 viewModel.eventLog(data)
376
                 viewModel.eventLog(data)
376
             }
377
             }
380
                 ManageApplication.getDeviceInfo()?.let {
381
                 ManageApplication.getDeviceInfo()?.let {
381
                     data.sn = it
382
                     data.sn = it
382
                 }
383
                 }
383
-                data.comm = "usb断开"
384
+                data.comm = EventLog.USBDISCONNECTEVENTSTRING
384
                 data.doEvent = EventLog.USBDISCONNECTEVENT
385
                 data.doEvent = EventLog.USBDISCONNECTEVENT
385
                 viewModel.eventLog(data)
386
                 viewModel.eventLog(data)
386
             }
387
             }

+ 18
- 9
app/src/main/java/com/xhly/manageapp/ui/main/activity/MainActivity.kt View File

850
                         data.sn = it
850
                         data.sn = it
851
                     }
851
                     }
852
                     data.appPackage = message
852
                     data.appPackage = message
853
+                    val packageInfo =
854
+                        packageManager.getPackageInfo(message, PackageManager.GET_META_DATA)
855
+                    val label =
856
+                        packageManager.getApplicationLabel(packageInfo.applicationInfo)
857
+                    data.comm =label.toString()
853
                     data.doEvent = EventLog.STARTAPPEVENT
858
                     data.doEvent = EventLog.STARTAPPEVENT
854
                     viewModel.eventLog(data)
859
                     viewModel.eventLog(data)
855
                 }
860
                 }
867
                         packageManager.getPackageInfo(message, PackageManager.GET_META_DATA)
872
                         packageManager.getPackageInfo(message, PackageManager.GET_META_DATA)
868
                     val label =
873
                     val label =
869
                         packageManager.getApplicationLabel(packageInfo.applicationInfo)
874
                         packageManager.getApplicationLabel(packageInfo.applicationInfo)
870
-                    data.comm = "App安装,应用名:${label}"
875
+                    data.comm =label.toString()
871
                     data.appPackage = message
876
                     data.appPackage = message
872
                     data.doEvent = EventLog.APPINSTALLEVENT
877
                     data.doEvent = EventLog.APPINSTALLEVENT
873
                     viewModel.eventLog(data)
878
                     viewModel.eventLog(data)
885
                 ManageApplication.getDeviceInfo()?.let {
890
                 ManageApplication.getDeviceInfo()?.let {
886
                     data.sn = it
891
                     data.sn = it
887
                 }
892
                 }
888
-                data.comm = "App卸载"
893
+                val packageInfo =
894
+                    packageManager.getPackageInfo(message, PackageManager.GET_META_DATA)
895
+                val label =
896
+                    packageManager.getApplicationLabel(packageInfo.applicationInfo)
897
+                data.comm =label.toString()
889
                 data.appPackage = message
898
                 data.appPackage = message
890
                 data.doEvent = EventLog.APPUNINSTALLEVENT
899
                 data.doEvent = EventLog.APPUNINSTALLEVENT
891
                 viewModel.eventLog(data)
900
                 viewModel.eventLog(data)
896
                 ManageApplication.getDeviceInfo()?.let {
905
                 ManageApplication.getDeviceInfo()?.let {
897
                     data.sn = it
906
                     data.sn = it
898
                 }
907
                 }
899
-                data.comm = "SD卡插入"
908
+                data.comm = EventLog.SDEMOUNTEDVENTSTRING
900
                 data.doEvent = EventLog.SDEMOUNTEDVENT
909
                 data.doEvent = EventLog.SDEMOUNTEDVENT
901
                 viewModel.eventLog(data)
910
                 viewModel.eventLog(data)
902
             }
911
             }
906
                 ManageApplication.getDeviceInfo()?.let {
915
                 ManageApplication.getDeviceInfo()?.let {
907
                     data.sn = it
916
                     data.sn = it
908
                 }
917
                 }
909
-                data.comm = "SD卡拔出"
918
+                data.comm = EventLog.SDEJECTEVENTSTRING
910
                 data.doEvent = EventLog.SDEJECTEVENT
919
                 data.doEvent = EventLog.SDEJECTEVENT
911
                 viewModel.eventLog(data)
920
                 viewModel.eventLog(data)
912
             }
921
             }
916
                 ManageApplication.getDeviceInfo()?.let {
925
                 ManageApplication.getDeviceInfo()?.let {
917
                     data.sn = it
926
                     data.sn = it
918
                 }
927
                 }
919
-                data.comm = "SIM卡安装"
928
+                data.comm = EventLog.SIMEVENTSTRING
920
                 data.doEvent = EventLog.SIMEVENT
929
                 data.doEvent = EventLog.SIMEVENT
921
                 viewModel.eventLog(data)
930
                 viewModel.eventLog(data)
922
             }
931
             }
926
                 ManageApplication.getDeviceInfo()?.let {
935
                 ManageApplication.getDeviceInfo()?.let {
927
                     data.sn = it
936
                     data.sn = it
928
                 }
937
                 }
929
-                data.comm = "蓝牙打开"
938
+                data.comm = EventLog.BLUETOOHEVENTSTRING
930
                 data.doEvent = EventLog.BLUETOOHEVENT
939
                 data.doEvent = EventLog.BLUETOOHEVENT
931
                 viewModel.eventLog(data)
940
                 viewModel.eventLog(data)
932
             }
941
             }
936
                 ManageApplication.getDeviceInfo()?.let {
945
                 ManageApplication.getDeviceInfo()?.let {
937
                     data.sn = it
946
                     data.sn = it
938
                 }
947
                 }
939
-                data.comm = "usb连接"
948
+                data.comm = EventLog.USBCONNECTEVENTSTRING
940
                 data.doEvent = EventLog.USBCONNECTEVENT
949
                 data.doEvent = EventLog.USBCONNECTEVENT
941
                 viewModel.eventLog(data)
950
                 viewModel.eventLog(data)
942
             }
951
             }
946
                 ManageApplication.getDeviceInfo()?.let {
955
                 ManageApplication.getDeviceInfo()?.let {
947
                     data.sn = it
956
                     data.sn = it
948
                 }
957
                 }
949
-                data.comm = "usb断开"
958
+                data.comm = EventLog.USBDISCONNECTEVENTSTRING
950
                 data.doEvent = EventLog.USBDISCONNECTEVENT
959
                 data.doEvent = EventLog.USBDISCONNECTEVENT
951
                 viewModel.eventLog(data)
960
                 viewModel.eventLog(data)
952
             }
961
             }
1171
             ManageApplication.getDeviceInfo()?.let {
1180
             ManageApplication.getDeviceInfo()?.let {
1172
                 data.sn = it
1181
                 data.sn = it
1173
             }
1182
             }
1174
-            data.comm = "退出登录"
1183
+            data.comm =  EventLog.ACCOUNTQUITEVENTSTRING
1175
             data.doEvent = EventLog.ACCOUNTQUITEVENT
1184
             data.doEvent = EventLog.ACCOUNTQUITEVENT
1176
             viewModel.eventLog(data)
1185
             viewModel.eventLog(data)
1177
         } else {
1186
         } else {

Loading…
Cancel
Save