|
@@ -359,6 +359,15 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
|
359
|
359
|
LogShow("冻结失败" + e.toString())
|
360
|
360
|
}
|
361
|
361
|
unInstallAppList.clear()
|
|
362
|
+ var hasapp = 1
|
|
363
|
+ try {
|
|
364
|
+ val strategyBean =
|
|
365
|
+ spUtils.getFromJson(Const.STRATEGYBEANKEY, StrategyBean::class.java) as StrategyBean
|
|
366
|
+ //获得平板策略是否使用app策略
|
|
367
|
+ hasapp = strategyBean.hasapp
|
|
368
|
+ }catch (e:Exception){
|
|
369
|
+
|
|
370
|
+ }
|
362
|
371
|
if (modelList.size > 0) {
|
363
|
372
|
ManageApplication.disableInstallation(true)
|
364
|
373
|
//modelList为0表示未打开应用策略,不删除应用,并且打开应用安装权限,其余情况关闭
|
|
@@ -373,8 +382,12 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
|
373
|
382
|
}
|
374
|
383
|
}
|
375
|
384
|
} else {
|
376
|
|
- //modelList为0表示未打开应用策略,所以打开打开应用安装权限
|
377
|
|
- ManageApplication.disableInstallation(false)
|
|
385
|
+ //hasapp==0表示未打开应用策略,所以打开打开应用安装权限,使用策略并未空则不允许安装应用
|
|
386
|
+ if (hasapp==0){
|
|
387
|
+ ManageApplication.disableInstallation(false)
|
|
388
|
+ }else{
|
|
389
|
+ ManageApplication.disableInstallation(true)
|
|
390
|
+ }
|
378
|
391
|
}
|
379
|
392
|
}
|
380
|
393
|
}
|
|
@@ -618,9 +631,14 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
|
618
|
631
|
|
619
|
632
|
viewModel.viewModelScope.launch {
|
620
|
633
|
viewModel.autoAppData.collect {
|
|
634
|
+ lifecycleScope.launch {
|
|
635
|
+ withContext(Dispatchers.IO){
|
|
636
|
+ delay(10000)
|
|
637
|
+ }
|
|
638
|
+ mBinding.flayoutRoot.visibility = View.GONE
|
|
639
|
+ }
|
621
|
640
|
it?.let {
|
622
|
641
|
if (!netAutoAppFlag || isDestroyFlag) {
|
623
|
|
- mBinding.flayoutRoot.visibility = View.GONE
|
624
|
642
|
return@collect
|
625
|
643
|
} else {
|
626
|
644
|
netAutoAppFlag = false
|
|
@@ -634,7 +652,6 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
|
634
|
652
|
//如果地址为空并且请求为true则不跳转,否则跳转
|
635
|
653
|
try {
|
636
|
654
|
if ((it.authUrl.isNullOrEmpty() || it.appPackage.isNullOrEmpty()) && it.netSucessFlag) {
|
637
|
|
- mBinding.flayoutRoot.visibility = View.GONE
|
638
|
655
|
//请求成功但地址为空,不跳转
|
639
|
656
|
canClickFlag = true
|
640
|
657
|
autoAppFlag = false
|
|
@@ -666,18 +683,14 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
|
666
|
683
|
} else {
|
667
|
684
|
//其余情况都允许触控
|
668
|
685
|
canClickFlag = true
|
669
|
|
- mBinding.flayoutRoot.visibility = View.GONE
|
670
|
686
|
}
|
671
|
687
|
} else {
|
672
|
|
- mBinding.flayoutRoot.visibility = View.GONE
|
673
|
688
|
canClickFlag = true
|
674
|
689
|
}
|
675
|
690
|
} catch (e: Exception) {
|
676
|
691
|
canClickFlag = true
|
677
|
|
- mBinding.flayoutRoot.visibility = View.GONE
|
678
|
692
|
}
|
679
|
693
|
} else {
|
680
|
|
- mBinding.flayoutRoot.visibility = View.GONE
|
681
|
694
|
canClickFlag = true
|
682
|
695
|
autoAppFlag = false
|
683
|
696
|
startIntentActivity(MainActivity().javaClass)
|
|
@@ -810,7 +823,6 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
|
810
|
823
|
canClickFlag = true
|
811
|
824
|
LogShow("跳转问题是$e")
|
812
|
825
|
}
|
813
|
|
- mBinding.flayoutRoot.visibility = View.GONE
|
814
|
826
|
}
|
815
|
827
|
|
816
|
828
|
private fun showSucessToast() {
|
|
@@ -1119,6 +1131,9 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
|
1119
|
1131
|
viewModel.postAppNetWhiteList()
|
1120
|
1132
|
updatePadInfo()
|
1121
|
1133
|
updateAppInstallInfo()
|
|
1134
|
+ //自动同时一次时间
|
|
1135
|
+ viewModel.postSyncTime()
|
|
1136
|
+ lastTimeLong = System.currentTimeMillis()
|
1122
|
1137
|
}
|
1123
|
1138
|
|
1124
|
1139
|
private fun updateAppInstallInfo() {
|