Browse Source

1.添加TB223FC网络黑白名单测试代码。

20241218TB223FC(测试jar包)
wangwanlei 1 week ago
parent
commit
9a508d72f3

BIN
app/libs/csdk_5.0.jar View File


+ 5
- 0
app/src/main/java/com/xhly/manageapp/ManageApplication.kt View File

22
 import com.xhly.corelib.utils.SystemUtil
22
 import com.xhly.corelib.utils.SystemUtil
23
 import com.xhly.manageapp.bean.user.UserBean
23
 import com.xhly.manageapp.bean.user.UserBean
24
 import com.xhly.manageapp.service.websocket.AppSocket
24
 import com.xhly.manageapp.service.websocket.AppSocket
25
+import com.xhly.manageapp.utils.AfwUtils
25
 import com.xhly.manageapp.utils.CurrentAppSharedPreferencesUtils
26
 import com.xhly.manageapp.utils.CurrentAppSharedPreferencesUtils
26
 import com.xhly.manageapp.utils.StrategyUtils
27
 import com.xhly.manageapp.utils.StrategyUtils
27
 import com.xhly.manageapp.utils.ZJAPPUtils
28
 import com.xhly.manageapp.utils.ZJAPPUtils
35
         private var csdkManager: CSDKManager? = null
36
         private var csdkManager: CSDKManager? = null
36
 
37
 
37
 
38
 
39
+
38
         /**  设置禁止安装后,可安装应用白名单里边的应用可以被安装。
40
         /**  设置禁止安装后,可安装应用白名单里边的应用可以被安装。
39
          * 加入可安装应用白名单
41
          * 加入可安装应用白名单
40
          */
42
          */
913
                 enableAllUnkownsourcesV3(true)
915
                 enableAllUnkownsourcesV3(true)
914
                 setSafeModeDisabled()
916
                 setSafeModeDisabled()
915
             }
917
             }
918
+            if (ModelNameUtils.IS_LianxTB223FC()){
919
+                AfwUtils.startBindService(this)
920
+            }
916
             //如果解除管控为真,则不在执行以下代码
921
             //如果解除管控为真,则不在执行以下代码
917
             try {
922
             try {
918
                 val userBean = spUtils.getFromJson(
923
                 val userBean = spUtils.getFromJson(

+ 20
- 15
app/src/main/java/com/xhly/manageapp/ui/ManageTestActivity.kt View File

1
 package com.xhly.manageapp.ui
1
 package com.xhly.manageapp.ui
2
 
2
 
3
 import BaseActivity
3
 import BaseActivity
4
-import android.app.csdk.CSDKManager
5
 import android.content.ComponentName
4
 import android.content.ComponentName
6
 import android.content.Intent
5
 import android.content.Intent
7
 import android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED
6
 import android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED
8
 import android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED
7
 import android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED
9
 import android.content.pm.PackageManager.DONT_KILL_APP
8
 import android.content.pm.PackageManager.DONT_KILL_APP
10
-import android.graphics.Color
11
 import android.os.Environment
9
 import android.os.Environment
12
 import android.os.Environment.DIRECTORY_DOWNLOADS
10
 import android.os.Environment.DIRECTORY_DOWNLOADS
13
-import android.os.storage.StorageManager
14
 import android.provider.Settings
11
 import android.provider.Settings
15
-import android.view.View
16
-import android.widget.EditText
17
-import android.widget.TextView
12
+import android.util.Log
18
 import com.hjq.toast.Toaster
13
 import com.hjq.toast.Toaster
19
-import com.kongzue.dialogx.dialogs.CustomDialog
20
-import com.kongzue.dialogx.interfaces.OnBindView
21
-import com.xhkjedu.manageapp.R
22
-import com.xhkjedu.manageapp.databinding.ActivityManageBinding
23
 import com.xhkjedu.manageapp.databinding.ActivityManagetestBinding
14
 import com.xhkjedu.manageapp.databinding.ActivityManagetestBinding
24
-import com.xhly.corelib.Const
25
-import com.xhly.corelib.base.viewmodel.CommonBaseViewModel
26
 import com.xhly.corelib.eventbus.UIEvent
15
 import com.xhly.corelib.eventbus.UIEvent
27
 import com.xhly.corelib.utils.LogShow
16
 import com.xhly.corelib.utils.LogShow
28
 import com.xhly.corelib.utils.ModelNameUtils
17
 import com.xhly.corelib.utils.ModelNameUtils
29
 import com.xhly.manageapp.ManageApplication
18
 import com.xhly.manageapp.ManageApplication
30
-import com.xhly.manageapp.bean.user.UserBean
19
+import com.xhly.manageapp.utils.AfwUtils
31
 import com.xhly.manageapp.utils.CurrentAppSharedPreferencesUtils
20
 import com.xhly.manageapp.utils.CurrentAppSharedPreferencesUtils
32
 import com.xhly.manageapp.utils.StrategyUtils
21
 import com.xhly.manageapp.utils.StrategyUtils
33
 import com.xhly.manageapp.viewmodel.BaseViewModel
22
 import com.xhly.manageapp.viewmodel.BaseViewModel
34
-import java.io.Console
35
 import java.io.File
23
 import java.io.File
36
 import kotlin.system.exitProcess
24
 import kotlin.system.exitProcess
37
 
25
 
58
         //ManageApplication.enableAllUnkownsourcesV3(true)
46
         //ManageApplication.enableAllUnkownsourcesV3(true)
59
     }
47
     }
60
 
48
 
61
-
49
+    override fun onResume() {
50
+        super.onResume()
51
+    }
62
     override fun initView() {
52
     override fun initView() {
63
         mBinding.addwifilistBtn.setOnClickListener {
53
         mBinding.addwifilistBtn.setOnClickListener {
64
             //ManageApplication.addWifiWhiteList(arrayListOf("xhkjedun7"))
54
             //ManageApplication.addWifiWhiteList(arrayListOf("xhkjedun7"))
339
         mBinding.xipingBtn.setOnClickListener {
329
         mBinding.xipingBtn.setOnClickListener {
340
             ManageApplication.setSleepTimeoutV3()
330
             ManageApplication.setSleepTimeoutV3()
341
         }
331
         }
332
+        mBinding.netappwBtn.setOnClickListener {
333
+            val uUid = AfwUtils.getUUid(this, "com.lenovo.leos.appstore")
334
+            AfwUtils.jurisdiction("白名单",uUid.toInt())
335
+            AfwUtils.getNetAppBlockList()
336
+            Toast(AfwUtils.getNetAppWhiteList())
337
+        }
338
+        mBinding.netappbBtn.setOnClickListener {
339
+            val uUid = AfwUtils.getUUid(this, "mark.via")
340
+            AfwUtils.jurisdiction("黑名单",uUid.toInt())
341
+            Toast(AfwUtils.getNetAppBlockList())
342
+        }
343
+        mBinding.neturlwBtn.setOnClickListener {
344
+           AfwUtils.addUrLWhiteList("*.baidu.com")
345
+           AfwUtils.addUrLBlackList("*")
346
+        }
342
     }
347
     }
343
 
348
 
344
 
349
 

+ 34
- 7
app/src/main/res/layout/activity_managetest.xml View File

245
                     android:layout_weight="1"
245
                     android:layout_weight="1"
246
                     android:visibility="visible"
246
                     android:visibility="visible"
247
                     android:text="清理内存" />
247
                     android:text="清理内存" />
248
-                <EditText
249
-                    android:layout_width="0dp"
250
-                    android:layout_height="80dp"
251
-                    android:layout_weight="1"
252
-                    android:hint="输入"
253
-                    android:visibility="visible"
254
-                    android:inputType="text" />
248
+
255
                 <androidx.appcompat.widget.AppCompatButton
249
                 <androidx.appcompat.widget.AppCompatButton
256
                     android:id="@+id/input_btn"
250
                     android:id="@+id/input_btn"
257
                     android:layout_width="0dp"
251
                     android:layout_width="0dp"
259
                     android:layout_weight="1"
253
                     android:layout_weight="1"
260
                     android:visibility="visible"
254
                     android:visibility="visible"
261
                     android:text="设置输入法" />
255
                     android:text="设置输入法" />
256
+
257
+            </LinearLayout>
258
+            <LinearLayout
259
+                android:layout_width="match_parent"
260
+                android:layout_height="wrap_content">
262
                 <androidx.appcompat.widget.AppCompatButton
261
                 <androidx.appcompat.widget.AppCompatButton
263
                     android:id="@+id/reset_control"
262
                     android:id="@+id/reset_control"
264
                     android:layout_width="0dp"
263
                     android:layout_width="0dp"
301
                     android:layout_weight="1"
300
                     android:layout_weight="1"
302
                     android:visibility="visible"
301
                     android:visibility="visible"
303
                     android:text="设置熄屏时间" />
302
                     android:text="设置熄屏时间" />
303
+                <androidx.appcompat.widget.AppCompatButton
304
+                    android:id="@+id/netappw_btn"
305
+                    android:layout_width="0dp"
306
+                    android:layout_height="80dp"
307
+                    android:layout_weight="1"
308
+                    android:visibility="visible"
309
+                    android:text="添加应用网络白名单" />
310
+                <androidx.appcompat.widget.AppCompatButton
311
+                    android:id="@+id/netappb_btn"
312
+                    android:layout_width="0dp"
313
+                    android:layout_height="80dp"
314
+                    android:layout_weight="1"
315
+                    android:visibility="visible"
316
+                    android:text="添加应用网络黑名单" />
317
+                <androidx.appcompat.widget.AppCompatButton
318
+                    android:id="@+id/neturlw_btn"
319
+                    android:layout_width="0dp"
320
+                    android:layout_height="80dp"
321
+                    android:layout_weight="1"
322
+                    android:visibility="visible"
323
+                    android:text="添加网址白名单" />
324
+                <androidx.appcompat.widget.AppCompatButton
325
+                    android:id="@+id/neturlb_btn"
326
+                    android:layout_width="0dp"
327
+                    android:layout_height="80dp"
328
+                    android:layout_weight="1"
329
+                    android:visibility="visible"
330
+                    android:text="添加网址黑名单" />
304
             </LinearLayout>
331
             </LinearLayout>
305
         </androidx.appcompat.widget.LinearLayoutCompat>
332
         </androidx.appcompat.widget.LinearLayoutCompat>
306
     </androidx.core.widget.NestedScrollView>
333
     </androidx.core.widget.NestedScrollView>

Loading…
Cancel
Save