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

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

@@ -1,37 +1,25 @@
1 1
 package com.xhly.manageapp.ui
2 2
 
3 3
 import BaseActivity
4
-import android.app.csdk.CSDKManager
5 4
 import android.content.ComponentName
6 5
 import android.content.Intent
7 6
 import android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED
8 7
 import android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED
9 8
 import android.content.pm.PackageManager.DONT_KILL_APP
10
-import android.graphics.Color
11 9
 import android.os.Environment
12 10
 import android.os.Environment.DIRECTORY_DOWNLOADS
13
-import android.os.storage.StorageManager
14 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 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 14
 import com.xhkjedu.manageapp.databinding.ActivityManagetestBinding
24
-import com.xhly.corelib.Const
25
-import com.xhly.corelib.base.viewmodel.CommonBaseViewModel
26 15
 import com.xhly.corelib.eventbus.UIEvent
27 16
 import com.xhly.corelib.utils.LogShow
28 17
 import com.xhly.corelib.utils.ModelNameUtils
29 18
 import com.xhly.manageapp.ManageApplication
30
-import com.xhly.manageapp.bean.user.UserBean
19
+import com.xhly.manageapp.utils.AfwUtils
31 20
 import com.xhly.manageapp.utils.CurrentAppSharedPreferencesUtils
32 21
 import com.xhly.manageapp.utils.StrategyUtils
33 22
 import com.xhly.manageapp.viewmodel.BaseViewModel
34
-import java.io.Console
35 23
 import java.io.File
36 24
 import kotlin.system.exitProcess
37 25
 
@@ -58,7 +46,9 @@ class ManageTestActivity : BaseActivity<BaseViewModel, ActivityManagetestBinding
58 46
         //ManageApplication.enableAllUnkownsourcesV3(true)
59 47
     }
60 48
 
61
-
49
+    override fun onResume() {
50
+        super.onResume()
51
+    }
62 52
     override fun initView() {
63 53
         mBinding.addwifilistBtn.setOnClickListener {
64 54
             //ManageApplication.addWifiWhiteList(arrayListOf("xhkjedun7"))
@@ -339,6 +329,21 @@ class ManageTestActivity : BaseActivity<BaseViewModel, ActivityManagetestBinding
339 329
         mBinding.xipingBtn.setOnClickListener {
340 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,13 +245,7 @@
245 245
                     android:layout_weight="1"
246 246
                     android:visibility="visible"
247 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 249
                 <androidx.appcompat.widget.AppCompatButton
256 250
                     android:id="@+id/input_btn"
257 251
                     android:layout_width="0dp"
@@ -259,6 +253,11 @@
259 253
                     android:layout_weight="1"
260 254
                     android:visibility="visible"
261 255
                     android:text="设置输入法" />
256
+
257
+            </LinearLayout>
258
+            <LinearLayout
259
+                android:layout_width="match_parent"
260
+                android:layout_height="wrap_content">
262 261
                 <androidx.appcompat.widget.AppCompatButton
263 262
                     android:id="@+id/reset_control"
264 263
                     android:layout_width="0dp"
@@ -301,6 +300,34 @@
301 300
                     android:layout_weight="1"
302 301
                     android:visibility="visible"
303 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 331
             </LinearLayout>
305 332
         </androidx.appcompat.widget.LinearLayoutCompat>
306 333
     </androidx.core.widget.NestedScrollView>

Loading…
Cancel
Save