【打包】修改打包流程

main
刘涛 2026-04-10 17:25:48 +08:00
parent 97d56617d4
commit f1feca4954
2 changed files with 3 additions and 75 deletions

View File

@ -24,8 +24,6 @@ using UnityEngine.Android;
public class GameLauncher : MonoBehaviour
{
private const string VersionDisplayPlaceholder = "----";
#if USE_OBFUZ
private static bool _isSetUpStaticSecret = false;
/// <summary>
@ -219,7 +217,7 @@ public class GameLauncher : MonoBehaviour
UpdateLocalInfo localInfo = PackDataInst.Inst.localInfo;
string acquiring = LocalizeMono.Instance.GetLocalizeText("Acquiring"); // 获取中...
string displayLocalVersion = FormatVersionForDisplay(localInfo.localFullVersion);
string displayLocalVersion = VersionDisplayFormatter.Format(localInfo.localFullVersion, "[LTRes]GameLauncher");
Debug.Log("[LTRes]GameLauncher - ShowVersion关键日志 stage=LaunchInit, fullOldVersion=" + localInfo.localFullVersion + ", fullNewVersion=" + acquiring + ", displayOldVersion=" + displayLocalVersion + ", displayNewVersion=" + acquiring + ", serverName=" + acquiring);
versionUpdateUI.ShowVersion(Application.version, localInfo.workSpace, displayLocalVersion, acquiring, acquiring);
@ -254,7 +252,7 @@ public class GameLauncher : MonoBehaviour
downloadResult = await PreConfig.instance.DownloadConfig();
versionUpdateUI.UpdateProgressText(LocalizeMono.Instance.GetLocalizeText("RequestConfigurationComplete")); // 请求APPConfig结束
string displayLocalVersionAfterConfig = FormatVersionForDisplay(localInfo.localFullVersion);
string displayLocalVersionAfterConfig = VersionDisplayFormatter.Format(localInfo.localFullVersion, "[LTRes]GameLauncher");
Debug.Log("[LTRes]GameLauncher - ShowVersion关键日志 stage=ConfigReady, fullOldVersion=" + localInfo.localFullVersion + ", fullNewVersion=" + acquiring + ", displayOldVersion=" + displayLocalVersionAfterConfig + ", displayNewVersion=" + acquiring + ", serverName=" + PreConfig.instance.ServerName);
versionUpdateUI.ShowVersion(Application.version, localInfo.workSpace, displayLocalVersionAfterConfig, acquiring, PreConfig.instance.ServerName);
BIToolinAOT.Instance.TrackEventInAOT("app_config_response", new System.Collections.Generic.Dictionary<string, object>(){
@ -384,76 +382,6 @@ public class GameLauncher : MonoBehaviour
{
realProgess = progress;
}
private static string FormatVersionForDisplay(string fullVersion)
{
if (string.IsNullOrWhiteSpace(fullVersion))
return VersionDisplayPlaceholder;
if (string.Equals(fullVersion, "unknown", StringComparison.OrdinalIgnoreCase))
return fullVersion;
try
{
string defaultVersion = null;
string dllVersion = null;
string configVersion = null;
string[] segments = fullVersion.Split('|');
foreach (string segment in segments)
{
if (string.IsNullOrWhiteSpace(segment))
continue;
string[] keyValue = segment.Split(new[] { ':' }, 2);
if (keyValue.Length != 2)
continue;
string key = keyValue[0].Trim();
string value = keyValue[1].Trim();
if (string.IsNullOrEmpty(value))
continue;
if (string.Equals(key, "default", StringComparison.OrdinalIgnoreCase))
{
defaultVersion = value;
}
else if (string.Equals(key, "dll", StringComparison.OrdinalIgnoreCase))
{
dllVersion = value;
}
else if (string.Equals(key, "config", StringComparison.OrdinalIgnoreCase))
{
configVersion = value;
}
}
if (defaultVersion == null && dllVersion == null && configVersion == null)
return fullVersion;
return string.Join("-", new[]
{
ToShortVersionSegment(defaultVersion),
ToShortVersionSegment(dllVersion),
ToShortVersionSegment(configVersion)
});
}
catch (Exception ex)
{
Debug.LogWarning("[LTRes]GameLauncher - 版本短显示格式化失败, fullVersion=" + fullVersion + ", error=" + ex.Message);
return fullVersion;
}
}
private static string ToShortVersionSegment(string versionSegment)
{
if (string.IsNullOrWhiteSpace(versionSegment))
return VersionDisplayPlaceholder;
return versionSegment.Length <= 4
? versionSegment
: versionSegment.Substring(versionSegment.Length - 4, 4);
}
#region iOS_DeviceHelper

@ -1 +1 @@
Subproject commit c5d78568a5f67dd577c7c668a677866be33f90b5
Subproject commit 6d2c5aca872b1ba333cb3af84b3435228fb769e3