瀏覽代碼

1.事件日志添加说明

20241218TB223FC(测试jar包)
wangwanlei 9 月之前
父節點
當前提交
cb6fa0bb21

+ 49
- 0
app/src/main/java/com/xhly/manageapp/bean/EventLog.kt 查看文件

@@ -64,4 +64,53 @@ object EventLog {
64 64
      */
65 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 查看文件

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

+ 18
- 9
app/src/main/java/com/xhly/manageapp/ui/main/activity/MainActivity.kt 查看文件

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

Loading…
取消
儲存