From 7b9af952e6fe4307a27aca0d8459ec39287c3f97 Mon Sep 17 00:00:00 2001 From: yangfei Date: Tue, 16 Apr 2024 17:12:53 +0800 Subject: [PATCH] feat: add aliyun log event "va_update" and "va_update_complete" --- .../java/com/gh/vspace/ExternalGameUsage.kt | 14 ++++++-- app/src/main/java/com/gh/vspace/VHelper.kt | 34 +++++++++++++++++-- vasdk | 2 +- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/app/src/internal/java/com/gh/vspace/ExternalGameUsage.kt b/app/src/internal/java/com/gh/vspace/ExternalGameUsage.kt index 0dc7b3c8e6..04d275fb7b 100644 --- a/app/src/internal/java/com/gh/vspace/ExternalGameUsage.kt +++ b/app/src/internal/java/com/gh/vspace/ExternalGameUsage.kt @@ -1,6 +1,7 @@ package com.gh.vspace import android.content.Intent +import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -13,6 +14,7 @@ import com.lg.vspace.VaApp import com.lg.vspace.plugin.host.PluginHelper import com.lightgame.utils.Utils import com.lightgame.utils.toast.ToastHelper +import com.lody.virtual.client.core.VirtualCore import java.io.File @Keep @@ -50,7 +52,7 @@ class ExternalGameUsage : ITestCase { val file = File("/data/local/tmp/gh-plugins/artifacts.zip") if (file.exists()) { Utils.log(VHelper.LOG_TAG, "有本地更新文件: 64位插件") - PluginHelper.getInstance().updatePlugin(file) + PluginHelper.getInstance().updatePlugin(file, VHelper.getCwBaseLogParams()) } else { ToastUtils.showToast("data/local/tmp没有push文件") } @@ -65,7 +67,15 @@ class ExternalGameUsage : ITestCase { val file = File("/data/local/tmp/gh-plugins/artifacts32.zip") if (file.exists()) { Utils.log(VHelper.LOG_TAG, "有本地更新文件: 32位插件") - VaApp.get().appManager.updatePlugin(file.absolutePath, "artifacts32.zip") + VirtualCore.get().updatePlugin(file.absolutePath, "artifacts32.zip", + VHelper.getCwBaseLogParams().let { + val bundle = Bundle() + for ((key, value) in it) { + bundle.putString(key, value) + } + bundle + }) + } else { ToastUtils.showToast("data/local/tmp没有push文件") } diff --git a/app/src/main/java/com/gh/vspace/VHelper.kt b/app/src/main/java/com/gh/vspace/VHelper.kt index 3bff07e400..0bbf9179ff 100644 --- a/app/src/main/java/com/gh/vspace/VHelper.kt +++ b/app/src/main/java/com/gh/vspace/VHelper.kt @@ -10,6 +10,7 @@ import android.database.sqlite.SQLiteDiskIOException import android.database.sqlite.SQLiteFullException import android.net.Uri import android.os.Build +import android.os.Bundle import android.text.TextUtils import android.view.View import androidx.annotation.WorkerThread @@ -60,6 +61,7 @@ import com.lg.vspace.VaApp import com.lg.vspace.VirtualAppManager import com.lg.vspace.archive.ArchiveExtHelper import com.lg.vspace.bridge.BuildConfig +import com.lg.vspace.meta.ProcessUtils import com.lg.vspace.plugin.host.PluginFileUtils import com.lg.vspace.plugin.host.PluginHelper import com.lg.vspace.remote.BinderPool @@ -72,6 +74,7 @@ import com.lightgame.utils.AppManager import com.lightgame.utils.Utils import com.lody.virtual.client.core.VirtualCore import com.va.host.HostUtils +import com.walkud.rom.checker.RomIdentifier import io.reactivex.Completable import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers @@ -81,6 +84,7 @@ import java.io.File import java.util.* import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.TimeUnit +import com.lg.vspace.log.NewFlatLogUtils as CwLogUtils object VHelper { @@ -2027,7 +2031,7 @@ object VHelper { && !Version(vaPlugin.versionName).isEqual(installedPluginVersion) ) { downloadPlugin(id = "${vaPlugin.id}64", url = vaPlugin.url64) { - PluginHelper.getInstance().updatePlugin(it) + PluginHelper.getInstance().updatePlugin(it, getCwBaseLogParams()) } } } @@ -2038,7 +2042,15 @@ object VHelper { && !Version(vaPlugin.versionName).isEqual(installedPluginVersion) ) { downloadPlugin(id = "${vaPlugin.id}32", url = vaPlugin.url32) { - VaApp.get().appManager.updatePlugin(it.absolutePath, "${vaPlugin.id}32.zip") + + VirtualCore.get().updatePlugin(it.absolutePath, "${vaPlugin.id}32.zip", + getCwBaseLogParams().let { + val bundle = Bundle() + for ((key, value) in it) { + bundle.putString(key, value) + } + bundle + }) } } } @@ -2125,4 +2137,22 @@ object VHelper { } } + fun getCwBaseLogParams() = mapOf( + CwLogUtils.KEY_ANDROID_VERSION to Build.VERSION.RELEASE, + CwLogUtils.KEY_APP_64_VERSION to com.lg.core.BuildConfig.VERSION_NAME, + CwLogUtils.KEY_APP_32_VERSION to "", + CwLogUtils.KEY_VA_VERSION to HostUtils.getPluginVersion(), + CwLogUtils.KEY_ARCHITECTURE to if (ProcessUtils.is64Bit()) "64" else "32", + CwLogUtils.KEY_DIA to MetaUtil.getBase64EncodedAndroidId(), + CwLogUtils.KEY_GID to HaloApp.getInstance().gid, + CwLogUtils.KEY_JNFJ to "", + CwLogUtils.KEY_MAC to "", + CwLogUtils.KEY_MANUFACTURER to Build.MANUFACTURER, + CwLogUtils.KEY_MODEL to Build.MODEL, + CwLogUtils.KEY_ROM to RomIdentifier.getRom().name + " " + RomIdentifier.getRom().versionName, + CwLogUtils.KEY_HOST_VERSION to com.gh.gamecenter.BuildConfig.VERSION_NAME, + CwLogUtils.KEY_HOST_CHANNEL to HaloApp.getInstance().channel, + CwLogUtils.KEY_OAID to HaloApp.getInstance().oaid, + ) + } \ No newline at end of file diff --git a/vasdk b/vasdk index a6513dd35f..45d011c3f9 160000 --- a/vasdk +++ b/vasdk @@ -1 +1 @@ -Subproject commit a6513dd35f05817e57e419c11a5dfeeb8597ed7f +Subproject commit 45d011c3f9b20cd73edafd37102787afd575a70f