lzx 21 時間 前
コミット
09abb8e3d0

+ 0 - 2
Assets/Scripts/GameUI/GameApplction.cs

@@ -306,7 +306,6 @@ public class GameApplction : IGameStart, ILogSend
             Flush();
         Crasheye.SendScriptException(massge, massge, "");
 
-        TalkingDataSDK.OnError(massge, massge, LogType.Error);
     }
 
     private void Flush()
@@ -330,7 +329,6 @@ public class GameApplction : IGameStart, ILogSend
         _cache.AppendLine($"{e.Message} {e.StackTrace}");
         Flush();
         Crasheye.SendScriptException(e);
-        TalkingDataSDK.ReportException(e);
     }
 
     public void UnityLogic(string logString, string stackTrace, LogType type)

+ 1 - 76
Assets/Scripts/ThirdParty/TalkingDataScripts/TalkingDataSDK.cs

@@ -1041,82 +1041,7 @@ public static class TalkingDataSDK
 #endif
         }
     }
-
-    /// <summary>
-    /// 手动报告错误
-    /// </summary>
-    public static void OnError(string message, string stackTrace, LogType logType)
-    {
-        if (talkingdataClass == null)
-            return;
-        if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
-        {
-#if UNITY_ANDROID
-            if (talkingdataClass != null)
-            {
-                string exceptionMessage = $"{logType}: {message}\n{stackTrace}";
-                // 将 Exception 改为 Throwable
-                using (AndroidJavaObject javaThrowable = new AndroidJavaObject("java.lang.Throwable", exceptionMessage))
-                {
-                    talkingdataClass.CallStatic("onError", GetCurrentActivity(), javaThrowable);
-                }
-            }
-#endif
-        }
-    }
-
-    /// <summary>
-    /// 手动报告异常
-    /// </summary>
-    public static void ReportException(System.Exception exception)
-    {
-        if (talkingdataClass == null)
-        {
-            talkingdataClass = new AndroidJavaClass(TALKINGDATA_CLASS);
-        }
-
-        if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
-        {
-#if UNITY_ANDROID
-            try
-            {
-                // 将 Exception 改为 Throwable
-                using (AndroidJavaObject javaThrowable = new AndroidJavaObject("java.lang.Throwable",
-                           $"{exception.Message}\n{exception.StackTrace}"))
-                {
-                    talkingdataClass.CallStatic("onError", GetCurrentActivity(), javaThrowable);
-                }
-            }
-            catch (System.Exception e)
-            {
-                Debug.LogError("报告异常到TalkingData失败: " + e.Message);
-            }
-#endif
-        }
-    }
-
-
-    /// <summary>
-    /// 设置是否自动捕获未处理异常
-    /// </summary>
-    /// <param name="enabled">true:开启, false:关闭</param>
-    public static void SetReportUncaughtExceptions(bool enabled)
-    {
-        if (talkingdataClass == null)
-        {
-            talkingdataClass = new AndroidJavaClass(TALKINGDATA_CLASS);
-        }
-
-        try
-        {
-            talkingdataClass.CallStatic("setReportUncaughtExceptions", enabled);
-            Debug.Log($"TalkingData自动异常捕获: {(enabled ? "开启" : "关闭")}");
-        }
-        catch (System.Exception e)
-        {
-            Debug.LogError("设置TalkingData自动异常捕获失败: " + e.Message);
-        }
-    }
+    
 
     public static void SetGlobalKV(string key, object val)
     {