feat: add aliyun log event "va_update" and "va_update_complete"

This commit is contained in:
yangfei
2024-04-16 17:12:53 +08:00
parent 2e66cd0314
commit 7b9af952e6
3 changed files with 45 additions and 5 deletions

View File

@ -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,
)
}