package com.gh.gamecenter.va

import android.app.Activity
import android.content.ContentValues
import android.content.Context
import com.therouter.TheRouter
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.va.provider.IVa
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

class VCore : IVa {

    companion object {
        @Volatile
        private var instance: IVa? = null

        fun getInstance(): IVa {
            return instance ?: synchronized(this) {
                (TheRouter.get(IVa::class.java)
                    ?: VCore()).also { instance = it }
            }
        }

    }

    override fun installPackage(path: String?): VaInstallResult = VaInstallResult(-1, "")

    override fun getInstalledApps(source: List<InstalledAppInfo>): List<InstalledAppInfo> = emptyList()

    override fun unInstallPackage(packageName: String): Boolean = true

    override fun getGameAppTotalTime(packageName: String): Long = 0

    override fun getAppOccupiedSpace(packageName: String): Long = 0

    override fun isAppInstalled(packageName: String): Boolean = false

    override fun launchApp(packageName: String): Boolean = false

    override fun cleanPackageData(packageName: String): Boolean = false

    override fun isExtPackageInstalled(): Boolean = false


    override fun isLaunchActivity(activity: Activity): Boolean = false

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

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

    override fun checkGameArchiveExists(
        packageName: String,
        archiveConfigJsonStr: String,
        isRunInExt: Boolean
    ): Boolean = false

    override fun getPluginVersion(): String = ""

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

    override fun getUriAuthorizationString(): String = ""

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

    override fun logBeforeGameLaunch(kv: Map<String, String>) {
    }

    override fun getPluginUpdateFileName(id: String): String = ""

    override fun isZipFile(file: File): Boolean = false
    override fun getDefaultPluginUrl(): String = ""

}