|
@@ -37,6 +37,7 @@ import com.jld.vod.viewmodel.SplashViewModel
|
|
|
import com.tbruyelle.rxpermissions2.RxPermissions
|
|
import com.tbruyelle.rxpermissions2.RxPermissions
|
|
|
import com.xuexiang.xui.widget.dialog.materialdialog.MaterialDialog
|
|
import com.xuexiang.xui.widget.dialog.materialdialog.MaterialDialog
|
|
|
import com.xuexiang.xui.widget.dialog.materialdialog.MaterialDialog.ListCallbackSingleChoice
|
|
import com.xuexiang.xui.widget.dialog.materialdialog.MaterialDialog.ListCallbackSingleChoice
|
|
|
|
|
+import com.xuexiang.xui.widget.toast.XToast
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
|
|
import io.reactivex.functions.Consumer
|
|
import io.reactivex.functions.Consumer
|
|
|
import kotlinx.android.synthetic.main.activity_splash.*
|
|
import kotlinx.android.synthetic.main.activity_splash.*
|
|
@@ -234,17 +235,17 @@ class SplashActivity : BaseActivity(){
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- if (!MyAccessibilityService.isRunning) {
|
|
|
|
|
- //默认开启全局返回服务
|
|
|
|
|
- Settings.Secure.putString(mContext.getContentResolver(),
|
|
|
|
|
- Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
|
|
|
|
|
- "com.jld.vod/com.jld.vod.service.MyAccessibilityService");
|
|
|
|
|
-
|
|
|
|
|
- Settings.Secure.putInt(mContext.getContentResolver(),
|
|
|
|
|
- Settings.Secure.ACCESSIBILITY_ENABLED, 1);
|
|
|
|
|
- val mIntnet = Intent(mContext,MyAccessibilityService::class.java)
|
|
|
|
|
- startService(mIntnet)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (!MyAccessibilityService.isRunning) {
|
|
|
|
|
+// //默认开启全局返回服务
|
|
|
|
|
+// Settings.Secure.putString(mContext.getContentResolver(),
|
|
|
|
|
+// Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
|
|
|
|
|
+// "com.jld.vod/com.jld.vod.service.MyAccessibilityService");
|
|
|
|
|
+//
|
|
|
|
|
+// Settings.Secure.putInt(mContext.getContentResolver(),
|
|
|
|
|
+// Settings.Secure.ACCESSIBILITY_ENABLED, 1);
|
|
|
|
|
+// val mIntnet = Intent(mContext,MyAccessibilityService::class.java)
|
|
|
|
|
+// startService(mIntnet)
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
/**
|
|
/**
|
|
|
* 初始apk版本更新
|
|
* 初始apk版本更新
|
|
@@ -551,7 +552,7 @@ class SplashActivity : BaseActivity(){
|
|
|
//获取包名
|
|
//获取包名
|
|
|
val packname = AppUtil.getApkPackName(applicationContext,apkfile.absolutePath)
|
|
val packname = AppUtil.getApkPackName(applicationContext,apkfile.absolutePath)
|
|
|
|
|
|
|
|
- lenitem++
|
|
|
|
|
|
|
+
|
|
|
LogUtils.logD("apk"+apkfile.absolutePath)
|
|
LogUtils.logD("apk"+apkfile.absolutePath)
|
|
|
val msg = Message()
|
|
val msg = Message()
|
|
|
msg.what = 2
|
|
msg.what = 2
|
|
@@ -561,7 +562,8 @@ class SplashActivity : BaseActivity(){
|
|
|
|
|
|
|
|
InstallGame( apkfile.absolutePath,packname,gid)
|
|
InstallGame( apkfile.absolutePath,packname,gid)
|
|
|
|
|
|
|
|
- ajaxInfo(getString(R.string.download_games1)+getString(R.string.sum_total)+totalitem+getString(R.string.download_games2)+"${(totalitem-lenitem)}" + getString(R.string.fail_sum)+failitem,null)
|
|
|
|
|
|
|
+ // ajaxInfo(getString(R.string.download_games1)+getString(R.string.sum_total)+totalitem+getString(R.string.download_games2)+"${(totalitem-lenitem)}" + getString(R.string.fail_sum)+failitem,null)
|
|
|
|
|
+ ajaxInfo(getString(R.string.download_games1),null)
|
|
|
|
|
|
|
|
// val mPm = mContext.packageManager
|
|
// val mPm = mContext.packageManager
|
|
|
//val isOk = SilentInstall.silentInstall(mPm, apkfile.absolutePath)
|
|
//val isOk = SilentInstall.silentInstall(mPm, apkfile.absolutePath)
|
|
@@ -1008,6 +1010,7 @@ class SplashActivity : BaseActivity(){
|
|
|
LogUtils.logD("GameObserver $packageName 下载完成安装完成.且更新安装状态:$returnCode")
|
|
LogUtils.logD("GameObserver $packageName 下载完成安装完成.且更新安装状态:$returnCode")
|
|
|
//是否安装成功
|
|
//是否安装成功
|
|
|
if (returnCode == 1) {
|
|
if (returnCode == 1) {
|
|
|
|
|
+ lenitem++
|
|
|
try {
|
|
try {
|
|
|
splashViewmodel.updateGameInstallState(gid.toString(),packageName!!,deviceSN)
|
|
splashViewmodel.updateGameInstallState(gid.toString(),packageName!!,deviceSN)
|
|
|
}catch (e:Exception) {
|
|
}catch (e:Exception) {
|
|
@@ -1023,6 +1026,8 @@ class SplashActivity : BaseActivity(){
|
|
|
}else{
|
|
}else{
|
|
|
LogUtils.logD("游戏安装失败?")
|
|
LogUtils.logD("游戏安装失败?")
|
|
|
failitem++
|
|
failitem++
|
|
|
|
|
+ lenitem++
|
|
|
|
|
+ XToast.error(mContext,getString(R.string.fail_sum))
|
|
|
|
|
|
|
|
if (lenitem == totalitem) {
|
|
if (lenitem == totalitem) {
|
|
|
lenitem = 0
|
|
lenitem = 0
|