131 lines
3.6 KiB
C#
131 lines
3.6 KiB
C#
#if WEBGL_BYTEDANCE
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using StarkSDKSpace;
|
|
|
|
namespace HC
|
|
{
|
|
public class HCBytedanceAppInfo : HCIAppInfo
|
|
{
|
|
public string GetBundleID()
|
|
{
|
|
if (string.IsNullOrEmpty(StarkSDK.s_ContainerEnv.GameAppId))
|
|
{
|
|
return HCStaticParams.BytedanceAppId;
|
|
}
|
|
|
|
return StarkSDK.s_ContainerEnv.GameAppId;
|
|
}
|
|
|
|
public string GetVersion()
|
|
{
|
|
return StarkSDK.API.GamePublishVersion;
|
|
}
|
|
|
|
public string GetModel()
|
|
{
|
|
return StarkSDK.API.GetSystemInfo().model;
|
|
}
|
|
|
|
public string GetBrand()
|
|
{
|
|
return StarkSDK.API.GetSystemInfo().brand;
|
|
}
|
|
|
|
public string GetLanguage()
|
|
{
|
|
return StarkSDK.API.GetSystemInfo().language;
|
|
}
|
|
|
|
public string GetSystemName()
|
|
{
|
|
return StarkSDK.API.GetSystemInfo().system;
|
|
}
|
|
|
|
public Dictionary<string, object> GetBaseInfo()
|
|
{
|
|
var mHostEnum = HostEnum.MoMoYu;
|
|
|
|
try
|
|
{
|
|
mHostEnum = StarkSDK.s_ContainerEnv.m_HostEnum;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
// ignored
|
|
}
|
|
|
|
var mLaunchFromEnum = LaunchFromEnum.UnKnown;
|
|
|
|
try
|
|
{
|
|
mLaunchFromEnum = StarkSDK.s_ContainerEnv.m_LaunchFromEnum;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
// ignored
|
|
}
|
|
|
|
var getVersionType = VersionType.None;
|
|
|
|
try
|
|
{
|
|
getVersionType = StarkSDK.s_ContainerEnv.GetVersionType();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
// ignored
|
|
}
|
|
|
|
|
|
var getLaunchFromStr = StarkSDK.s_ContainerEnv.GetLaunchFromStr();
|
|
var getLocation = StarkSDK.s_ContainerEnv.GetLocation();
|
|
var getLaunchFrom = StarkSDK.s_ContainerEnv.GetLaunchFrom();
|
|
if (string.IsNullOrEmpty(getLaunchFromStr))
|
|
{
|
|
getLaunchFromStr = "";
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(getLocation))
|
|
{
|
|
getLocation = "";
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(getLaunchFrom))
|
|
{
|
|
getLaunchFrom = "";
|
|
}
|
|
|
|
return new Dictionary<string, object>()
|
|
{
|
|
["d_hostVersion"] = StarkSDK.API.GetSystemInfo().hostVersion,
|
|
["d_hostName"] = StarkSDK.API.GetSystemInfo().hostName,
|
|
["d_scVersion"] = StarkSDK.API.GetSystemInfo().scVersion,
|
|
["d_sdkVersion"] = StarkSDK.API.GetSystemInfo().sdkVersion,
|
|
["d_m_HostEnum"] = mHostEnum.ToString(),
|
|
["d_m_LaunchFromEnum"] = mLaunchFromEnum.ToString(),
|
|
["d_GetLaunchFromStr"] = getLaunchFromStr,
|
|
["d_GetVersionType"] = getVersionType.ToString(),
|
|
["d_GetLocation"] = getLocation,
|
|
["d_GetLaunchFrom"] = getLaunchFrom,
|
|
["d_version"] = GetVersion(),
|
|
["d_model"] = GetModel(),
|
|
["d_brand"] = GetBrand(),
|
|
["d_language"] = GetLanguage(),
|
|
["d_systemName"] = GetSystemName(),
|
|
["d_platform"] = StarkSDK.API.GetSystemInfo().platform,
|
|
#if UNITY_WEBGL
|
|
["d_type"] = "unity_webgl",
|
|
#else
|
|
["d_type"] = "native",
|
|
#endif
|
|
};
|
|
}
|
|
|
|
public string GetPlatform()
|
|
{
|
|
return $"douyin_{StarkSDK.API.GetSystemInfo().platform}";
|
|
}
|
|
}
|
|
}
|
|
#endif |