|
@@ -563,26 +563,30 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
|
563
|
563
|
//如果地址为空并且请求为true则不跳转,否则跳转
|
564
|
564
|
try {
|
565
|
565
|
if ((it.authUrl.isNullOrEmpty()||it.appPackage.isNullOrEmpty())&&it.netSucessFlag){
|
|
566
|
+ //请求成功但地址为空,不跳转
|
566
|
567
|
canClickFlag = true
|
567
|
568
|
autoAppFlag = false
|
568
|
569
|
spUtils.saveJson(Const.AUTOAPPKEY, it)
|
569
|
570
|
} else if ((!it.authUrl.isNullOrEmpty()&&!it.appPackage.isNullOrEmpty()) && AppUtils.isAppInstalled(this@MainActivity, it.appPackage)) {
|
|
571
|
+ //请求成功地址不为空,并且安装了跳转
|
570
|
572
|
spUtils.saveJson(Const.AUTOAPPKEY, it)
|
571
|
573
|
startAutoApp(it)
|
572
|
574
|
} else if (!it.netSucessFlag){
|
|
575
|
+ //请求失败走缓存
|
573
|
576
|
val autoAppBean = spUtils.getFromJson(
|
574
|
577
|
Const.AUTOAPPKEY,
|
575
|
578
|
AutoAppBean().javaClass
|
576
|
579
|
) as AutoAppBean
|
577
|
|
- if (autoAppBean.authUrl != null && AppUtils.isAppInstalled(
|
578
|
|
- this@MainActivity,
|
579
|
|
- autoAppBean.appPackage
|
580
|
|
- ) && !it.netSucessFlag
|
581
|
|
- ) {
|
|
580
|
+ if ((!autoAppBean.authUrl.isNullOrEmpty()&&!autoAppBean.appPackage.isNullOrEmpty())&&
|
|
581
|
+ AppUtils.isAppInstalled(this@MainActivity, autoAppBean.appPackage) && !it.netSucessFlag) {
|
|
582
|
+ //缓存地址不为空,并且安装了则跳转
|
582
|
583
|
startAutoApp(autoAppBean)
|
583
|
584
|
} else {
|
|
585
|
+ //其余情况都允许触控
|
584
|
586
|
canClickFlag = true
|
585
|
587
|
}
|
|
588
|
+ }else{
|
|
589
|
+ canClickFlag = true
|
586
|
590
|
}
|
587
|
591
|
} catch (e: Exception) {
|
588
|
592
|
canClickFlag = true
|