|
@@ -289,7 +289,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
|
289
|
289
|
val rxPermissions = RxPermissions(this@MainActivity)
|
290
|
290
|
rxPermissions.request(Manifest.permission.REQUEST_INSTALL_PACKAGES)
|
291
|
291
|
.subscribe { granted ->
|
292
|
|
- if (granted || ModelNameUtils.IS_LianxX505f()) {
|
|
292
|
+ if (granted || ModelNameUtils.IS_LianxX505f()||ModelNameUtils.IS_LianxX6e6f()) {
|
293
|
293
|
// 权限已授予,执行安装操作
|
294
|
294
|
val appList = AppUtils.GetAppList(this@MainActivity)
|
295
|
295
|
getExternalFilesDir(null)?.let {
|
|
@@ -477,8 +477,8 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
|
477
|
477
|
viewModel.autoAppData.collect{
|
478
|
478
|
it?.let {
|
479
|
479
|
//连接不为空,并且应用已安装则跳转应用
|
480
|
|
- /* it.authUrl="com.xhkjedu.xh_control_browser.MainActivity"
|
481
|
|
- it.appPackage="com.xhkjedu.xh_control_browser"*/
|
|
480
|
+ it.authUrl="com.xhkjedu.xh_control_browser.MainActivit111y"
|
|
481
|
+ it.appPackage="com.xhkjedu.xh_control_browser"
|
482
|
482
|
LogShow("锁定了吧"+mainLockFlag)
|
483
|
483
|
if (!mainLockFlag){
|
484
|
484
|
if (it.authUrl!=null&&AppUtils.isAppInstalled(this@MainActivity,it.appPackage)){
|
|
@@ -512,38 +512,44 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
|
512
|
512
|
}
|
513
|
513
|
|
514
|
514
|
private fun startAutoApp(autoAppBean: AutoAppBean){
|
515
|
|
- val launchIntent = Intent()
|
516
|
|
- launchIntent.setComponent(
|
517
|
|
- ComponentName(
|
518
|
|
- autoAppBean.appPackage!!,
|
519
|
|
- autoAppBean.authUrl!!
|
|
515
|
+ try {
|
|
516
|
+ val launchIntent = Intent()
|
|
517
|
+ launchIntent.setComponent(
|
|
518
|
+ ComponentName(
|
|
519
|
+ autoAppBean.appPackage!!,
|
|
520
|
+ autoAppBean.authUrl!!
|
|
521
|
+ )
|
520
|
522
|
)
|
521
|
|
- )
|
522
|
|
- launchIntent.putExtra("authType",autoAppBean.authType)
|
523
|
|
- userBean?.let {
|
524
|
|
- when(autoAppBean.authType){
|
525
|
|
- 1->{
|
526
|
|
- val userid = it.userid
|
527
|
|
- launchIntent.putExtra("authData",userid.toString())
|
528
|
|
- }
|
529
|
|
- 2->{
|
530
|
|
- val studentno = it.studentno
|
531
|
|
- launchIntent.putExtra("authData",studentno.toString())
|
532
|
|
- }
|
533
|
|
- 3->{
|
534
|
|
- val userphone = it.userphone
|
535
|
|
- launchIntent.putExtra("authData",userphone.toString())
|
536
|
|
- }
|
537
|
|
- 4->{
|
538
|
|
- val cardid = it.cardid
|
539
|
|
- launchIntent.putExtra("authData",cardid.toString())
|
540
|
|
- }
|
541
|
|
- else->{
|
|
523
|
+ launchIntent.putExtra("authType",autoAppBean.authType)
|
|
524
|
+ userBean?.let {
|
|
525
|
+ when(autoAppBean.authType){
|
|
526
|
+ 1->{
|
|
527
|
+ val userid = it.userid
|
|
528
|
+ launchIntent.putExtra("authData",userid.toString())
|
|
529
|
+ }
|
|
530
|
+ 2->{
|
|
531
|
+ val studentno = it.studentno
|
|
532
|
+ launchIntent.putExtra("authData",studentno.toString())
|
|
533
|
+ }
|
|
534
|
+ 3->{
|
|
535
|
+ val userphone = it.userphone
|
|
536
|
+ launchIntent.putExtra("authData",userphone.toString())
|
|
537
|
+ }
|
|
538
|
+ 4->{
|
|
539
|
+ val cardid = it.cardid
|
|
540
|
+ launchIntent.putExtra("authData",cardid.toString())
|
|
541
|
+ }
|
|
542
|
+ else->{
|
542
|
543
|
|
|
544
|
+ }
|
543
|
545
|
}
|
544
|
546
|
}
|
|
547
|
+ startActivity(launchIntent)
|
|
548
|
+ }catch (e:Exception){
|
|
549
|
+ canClickFlag=true
|
|
550
|
+ LogShow("跳转问题是$e")
|
545
|
551
|
}
|
546
|
|
- startActivity(launchIntent)
|
|
552
|
+
|
547
|
553
|
}
|
548
|
554
|
private fun showSucessToast() {
|
549
|
555
|
Toaster.show(R.string.updatetips)
|