package com.gh.gamecenter.va.provider

import android.app.Activity
import android.content.ContentValues
import android.content.Context

import com.gh.gamecenter.va.remote.InstalledAppInfo
import com.gh.gamecenter.va.remote.VaInstallResult
import com.lg.vspace.archive.common.ui.interfaces.ArchiveProgressPageListener
import java.io.File

interface IVa {

    fun isFakeVa(): Boolean = true

    fun installPackage(path: String?): VaInstallResult

    fun getInstalledApps(source: List<InstalledAppInfo>): List<InstalledAppInfo>

    fun unInstallPackage(packageName: String): Boolean

    fun getGameAppTotalTime(packageName: String): Long

    fun getAppOccupiedSpace(packageName: String): Long

    /**
     * VirtualCore.get().isAppInstalled(String);
     * 调用方catch Exception
     */
    fun isAppInstalled(packageName: String): Boolean

    /**
     * VActivityManager.get().launchApp(int, String)
     */
    fun launchApp(packageName: String): Boolean

    /**
     * VirtualCore.get().cleanPackageData(String, Int)
     */
    fun cleanPackageData(packageName: String): Boolean

    fun isExtPackageInstalled(): Boolean

    fun isLaunchActivity(activity: Activity): Boolean

    fun <T> useArchive(
        context: Context,
        packageName: String,
        archiveFile: T,
        archiveConfig: String?,
        listener: ArchiveProgressPageListener
    )

    fun <T> generatePackage(
        context: Context,
        packageName: String,
        archiveConfig: String,
        archiveFile: T,
        listener: ArchiveProgressPageListener
    )

    fun checkGameArchiveExists(packageName: String, archiveConfigJsonStr: String, isRunInExt: Boolean): Boolean

    fun getPluginVersion(): String


    fun getCwBaseLogParams(
        gid: String,
        oaid: String,
        hostVersion: String,
        hostChannel: String,
    ): Map<String, String>

    fun getUriAuthorizationString(): String

    fun getAuthContentValue(token: String, userName: String?, userAvatar: String?): ContentValues


    fun logBeforeGameLaunch(kv: Map<String, String>)

    fun getPluginUpdateFileName(id: String): String

    fun isZipFile(file: File): Boolean

    fun getDefaultPluginUrl(): String
}