Browse Source

1.默认添加星火应用商店显示

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

+ 16
- 0
app/src/main/java/com/xhly/manageapp/AppAdapter.kt View File

1
 package com.xhly.manageapp
1
 package com.xhly.manageapp
2
 
2
 
3
+import android.content.ComponentName
3
 import android.content.Context
4
 import android.content.Context
5
+import android.content.Intent
4
 import android.view.LayoutInflater
6
 import android.view.LayoutInflater
5
 import android.view.ViewGroup
7
 import android.view.ViewGroup
6
 import androidx.recyclerview.widget.RecyclerView
8
 import androidx.recyclerview.widget.RecyclerView
54
                 changePwdListener?.let {
56
                 changePwdListener?.let {
55
                     it.changeCode()
57
                     it.changeCode()
56
                 }
58
                 }
59
+            }else if (appInfo.packageName.equals(Const.STOREAPPPKG)){
60
+                //跳转应用商店
61
+                try {
62
+                    val launchIntent = Intent()
63
+                    launchIntent.setComponent(
64
+                        ComponentName(
65
+                            Const.STOREAPPPKG,
66
+                            Const.STOREAPPPKG+".MainActivity"
67
+                        )
68
+                    )
69
+                    context.startActivity(launchIntent)
70
+                }catch (e:Exception){
71
+                    Toaster.showLong("失败原因"+e.toString())
72
+                }
57
             } else{
73
             } else{
58
                 try {
74
                 try {
59
                     var instance = Calendar.getInstance()
75
                     var instance = Calendar.getInstance()

+ 3
- 1
app/src/main/java/com/xhly/manageapp/ManageApplication.kt View File

504
          */
504
          */
505
         fun setUrlWhiteListWrite(list:ArrayList<String>){
505
         fun setUrlWhiteListWrite(list:ArrayList<String>){
506
             if (ModelNameUtils.IS_LianxX505f()) {
506
             if (ModelNameUtils.IS_LianxX505f()) {
507
-                csdkManager?.SetEnable(true)
507
+                setUrlWhiteListEnable(true)
508
                 //默认添加自己应用为白名单
508
                 //默认添加自己应用为白名单
509
                 list.add("mcapitest.xhkjedu.com")
509
                 list.add("mcapitest.xhkjedu.com")
510
                 list.add("mcwstest.xhkjedu.com")
510
                 list.add("mcwstest.xhkjedu.com")
582
             )
582
             )
583
             //给自己加入网络白名单
583
             //给自己加入网络白名单
584
             addAppWhiteRule(arrayListOf(Const.CURRENTAPPPKG))
584
             addAppWhiteRule(arrayListOf(Const.CURRENTAPPPKG))
585
+            //启动网络限制
586
+            setUrlWhiteListEnable(true)
585
             //允许运行时权限,禁止状态栏下拉,屏蔽底部虚拟键。
587
             //允许运行时权限,禁止状态栏下拉,屏蔽底部虚拟键。
586
            // setRuntimePermissions(true)
588
            // setRuntimePermissions(true)
587
             disableStatusBarPanel(true)
589
             disableStatusBarPanel(true)

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

728
             schoolDeviceSetBean = StrategyUtils.getSchoolDeviceSetBean(this)
728
             schoolDeviceSetBean = StrategyUtils.getSchoolDeviceSetBean(this)
729
             dataList.clear()
729
             dataList.clear()
730
             var appList = AppUtils.GetAppList(this)
730
             var appList = AppUtils.GetAppList(this)
731
-            appList.addAll(CustomAppUtils().getCustomAppList(this))
732
             //获得预装应用直接隐藏
731
             //获得预装应用直接隐藏
733
             try {
732
             try {
734
                 //获得预装应用的包名
733
                 //获得预装应用的包名
751
             } catch (e: Exception) {
750
             } catch (e: Exception) {
752
 
751
 
753
             }
752
             }
753
+            appList.addAll(CustomAppUtils().getCustomAppList(this))
754
             //获得学校设置,设置应用显示(部分回合预装重合,由学校设置判断是否显示)
754
             //获得学校设置,设置应用显示(部分回合预装重合,由学校设置判断是否显示)
755
             if (schoolDeviceSetBean != null) {
755
             if (schoolDeviceSetBean != null) {
756
                 appList = StrategyUtils.setSchoolSetDevice(schoolDeviceSetBean, appList)
756
                 appList = StrategyUtils.setSchoolSetDevice(schoolDeviceSetBean, appList)

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

31
             Const.CUSTOMCHANGEPSD,
31
             Const.CUSTOMCHANGEPSD,
32
             AppCompatResources.getDrawable(context,R.drawable.icon_changepwd)!!
32
             AppCompatResources.getDrawable(context,R.drawable.icon_changepwd)!!
33
         ))
33
         ))
34
+        appList.add(getCusomAppBean(
35
+            context.getString(R.string.appstore),
36
+            Const.STOREAPPPKG,
37
+            AppCompatResources.getDrawable(context,R.drawable.icon_store)!!
38
+        ))
34
         return appList
39
         return appList
35
     }
40
     }
36
 
41
 

BIN
app/src/main/res/drawable-xxhdpi/icon_store.png View File


+ 2
- 0
app/src/main/res/values/strings.xml View File

35
     <string name="closerotation">自动旋转已关闭</string>
35
     <string name="closerotation">自动旋转已关闭</string>
36
     <string name="speedend">加速完成。</string>
36
     <string name="speedend">加速完成。</string>
37
     <string name="clearend">清理缓存完成。</string>
37
     <string name="clearend">清理缓存完成。</string>
38
+    <string name="loginout">注销</string>
39
+    <string name="appstore">星火应用商店</string>
38
 </resources>
40
 </resources>

Loading…
Cancel
Save