Browse Source

bugly上报

zhaoyang 2 years ago
parent
commit
c8cb374b6e
57 changed files with 2276 additions and 6 deletions
  1. 20 0
      GameClient/Assets/Game/Launcher/GameLauncher.cs
  2. 32 0
      GameClient/Assets/Game/Main.cs
  3. 11 0
      GameClient/Assets/Game/Main.cs.meta
  4. 11 5
      GameClient/Assets/Plugins/Android/AndroidManifest.xml
  5. 8 0
      GameClient/Assets/Plugins/Android/res.meta
  6. 9 0
      GameClient/Assets/Plugins/Android/res/xml.meta
  7. 6 0
      GameClient/Assets/Plugins/Android/res/xml/network_security_config.xml
  8. 7 0
      GameClient/Assets/Plugins/Android/res/xml/network_security_config.xml.meta
  9. 8 0
      GameClient/Assets/Plugins/com.meta
  10. 8 0
      GameClient/Assets/Plugins/com/easy.meta
  11. 8 0
      GameClient/Assets/Plugins/com/easy/bugly.meta
  12. 18 0
      GameClient/Assets/Plugins/com/easy/bugly/GamePlayerActivity.java
  13. 32 0
      GameClient/Assets/Plugins/com/easy/bugly/GamePlayerActivity.java.meta
  14. 1 1
      GameClient/Assets/Scenes/GameLauncher.unity
  15. 8 0
      GameClient/Assets/ThirdParty/Bugly.meta
  16. 8 0
      GameClient/Assets/ThirdParty/Bugly/Editor.meta
  17. 131 0
      GameClient/Assets/ThirdParty/Bugly/Editor/XCodePostProcessBuild.cs
  18. 11 0
      GameClient/Assets/ThirdParty/Bugly/Editor/XCodePostProcessBuild.cs.meta
  19. 5 0
      GameClient/Assets/ThirdParty/Bugly/Plugins.meta
  20. 5 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins.meta
  21. 5 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android.meta
  22. 7 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs.meta
  23. 7 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/armeabi-v7a.meta
  24. BIN
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/armeabi-v7a/libBugly.so
  25. 24 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/armeabi-v7a/libBugly.so.meta
  26. BIN
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/bugly_crash_release.jar
  27. 32 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/bugly_crash_release.jar.meta
  28. BIN
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/buglyagent.jar
  29. 23 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/buglyagent.jar.meta
  30. 9 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/x86.meta
  31. BIN
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/x86/libBugly.so
  32. 24 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/x86/libBugly.so.meta
  33. 1080 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyAgent.cs
  34. 8 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyAgent.cs.meta
  35. 27 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyCallback.cs
  36. 8 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyCallback.cs.meta
  37. 80 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyInit.cs
  38. 8 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyInit.cs.meta
  39. 8 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS.meta
  40. 5 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework.meta
  41. BIN
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Bugly
  42. 7 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Bugly.meta
  43. 8 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers.meta
  44. 151 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/Bugly.h
  45. 7 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/Bugly.h.meta
  46. 136 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/BuglyConfig.h
  47. 7 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/BuglyConfig.h.meta
  48. 78 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/BuglyLog.h
  49. 7 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/BuglyLog.h.meta
  50. 8 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Modules.meta
  51. 12 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Modules/module.modulemap
  52. 7 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Modules/module.modulemap.meta
  53. 5 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/BuglyBridge.meta
  54. 101 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/BuglyBridge/BuglyBridge.h
  55. 20 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/BuglyBridge/BuglyBridge.h.meta
  56. BIN
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/BuglyBridge/libBuglyBridge.a
  57. 20 0
      GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/BuglyBridge/libBuglyBridge.a.meta

+ 20 - 0
GameClient/Assets/Game/Launcher/GameLauncher.cs

@@ -33,6 +33,7 @@ public class GameLauncher : MonoBehaviour
     // Start is called before the first frame update
     void Start()
     {
+        InitBugly();
         Screen.sleepTimeout = SleepTimeout.NeverSleep;
         Application.runInBackground = true;
         LauncherConfig.InitScriptCompilation();
@@ -45,6 +46,9 @@ public class GameLauncher : MonoBehaviour
             LauncherView.Instance.Open();
             InitLauncherCfg();
         });
+
+
+
     }
 
     /// <summary>
@@ -107,4 +111,20 @@ public class GameLauncher : MonoBehaviour
                 });
     }
 
+    private void InitBugly()
+    {
+
+        BuglyAgent.ConfigDebugMode(true);
+        // 注册日志回调,替换使用 'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式
+        // BuglyAgent.RegisterLogCallback (CallbackDelegate.Instance.OnApplicationLogCallbackHandler);
+
+#if UNITY_IPHONE || UNITY_IOS
+        BuglyAgent.InitWithAppId (BuglyAppIDForiOS);
+#elif UNITY_ANDROID
+        BuglyAgent.InitWithAppId("766c5bdb0f");
+#endif
+        // 如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
+        BuglyAgent.EnableExceptionHandler();
+
+    }
 }

+ 32 - 0
GameClient/Assets/Game/Main.cs

@@ -0,0 +1,32 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class Main : MonoBehaviour
+{
+    // Start is called before the first frame update
+    void Start()
+    {
+
+        BuglyAgent.ConfigDebugMode(true);
+        // 注册日志回调,替换使用 'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式
+        // BuglyAgent.RegisterLogCallback (CallbackDelegate.Instance.OnApplicationLogCallbackHandler);
+
+#if UNITY_IPHONE || UNITY_IOS
+        BuglyAgent.InitWithAppId (BuglyAppIDForiOS);
+#elif UNITY_ANDROID
+        BuglyAgent.InitWithAppId("766c5bdb0f");
+#endif
+        // 如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
+        BuglyAgent.EnableExceptionHandler();
+
+        GameObject go = null;
+        go.name = "";
+    }
+
+    // Update is called once per frame
+    void Update()
+    {
+
+    }
+}

+ 11 - 0
GameClient/Assets/Game/Main.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c06760c2b9517754cbf779ea7bf02314
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 11 - 5
GameClient/Assets/Plugins/Android/AndroidManifest.xml

@@ -1,10 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN-->
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.unity3d.player"
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player"
     xmlns:tools="http://schemas.android.com/tools">
-    <application>
-        
+    <application android:networkSecurityConfig="@xml/network_security_config">
+
     </application>
+
+    <!--bugly配置权限start-->
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.READ_LOGS" />
+    <!--bugly配置权限end-->
 </manifest>

+ 8 - 0
GameClient/Assets/Plugins/Android/res.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 324f7723b5fec4447877948cc44c2081
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 9 - 0
GameClient/Assets/Plugins/Android/res/xml.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 6b43b837fd8678a4fba630d8fec9ab6a
+folderAsset: yes
+timeCreated: 1542190151
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 6 - 0
GameClient/Assets/Plugins/Android/res/xml/network_security_config.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+    <domain-config cleartextTrafficPermitted="true">
+        <domain includeSubdomains="true">android.bugly.qq.com</domain>
+    </domain-config>
+</network-security-config>

+ 7 - 0
GameClient/Assets/Plugins/Android/res/xml/network_security_config.xml.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 8c918b17c6f09d34c8f6fb986041640c
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Plugins/com.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8abecdf337d47e34fb2809f1d72127e7
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Plugins/com/easy.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c4fdb4d8618ee3e439be87c9b770f66c
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Plugins/com/easy/bugly.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0a17c96b12553dd4c87b3436079d97ad
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 18 - 0
GameClient/Assets/Plugins/com/easy/bugly/GamePlayerActivity.java

@@ -0,0 +1,18 @@
+package com.easy.bugly;
+
+import android.os.Bundle;
+import android.view.Window;
+
+import com.tencent.bugly.crashreport.CrashReport;
+import com.unity3d.player.UnityPlayer;
+import com.unity3d.player.UnityPlayerActivity;
+
+public class GamePlayerActivity extends UnityPlayerActivity
+{
+    @Override protected void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+
+        CrashReport.initCrashReport(getApplicationContext(),"766c5bdb0f", false);
+    }
+}

+ 32 - 0
GameClient/Assets/Plugins/com/easy/bugly/GamePlayerActivity.java.meta

@@ -0,0 +1,32 @@
+fileFormatVersion: 2
+guid: 504e29108f13a9a4795c61901d4fffc8
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Android: Android
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Any: 
+    second:
+      enabled: 0
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
GameClient/Assets/Scenes/GameLauncher.unity

@@ -277,7 +277,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 170410349}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 2.25, y: -5, z: 0}
+  m_LocalPosition: {x: 2.8125, y: -5, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 0}

+ 8 - 0
GameClient/Assets/ThirdParty/Bugly.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c20ddf1561c5b5a40a3069b89aa4f8df
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/ThirdParty/Bugly/Editor.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3f5c339cbc312094682e78fb4e3f4788
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 131 - 0
GameClient/Assets/ThirdParty/Bugly/Editor/XCodePostProcessBuild.cs

@@ -0,0 +1,131 @@
+#if UNITY_IOS
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using UnityEditor;
+using UnityEditor.Callbacks;
+using UnityEditor.iOS.Xcode;
+using UnityEngine;
+
+public static class XCodePostProcessBuild
+{
+    [PostProcessBuild(int.MaxValue)]
+	public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
+	{
+        if (target != BuildTarget.iOS)
+		{
+			Debug.LogWarning("Target is not iOS. XCodePostProcessBuild will not run");
+			return;
+		}
+
+        string projectPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
+        var pbxProject = new PBXProject();
+        pbxProject.ReadFromString(File.ReadAllText(projectPath));
+        
+#if UNITY_2019_3_OR_NEWER
+        string mainTarget = pbxProject.GetUnityMainTargetGuid();  
+        string frameworkTarget = pbxProject.GetUnityFrameworkTargetGuid();   
+#else
+        string mainTarget = pbxProject.TargetGuidByName(PBXProject.GetUnityTargetName());
+        string frameworkTarget = mainTarget;
+#endif
+
+        DisableBitcode(pbxProject,mainTarget,frameworkTarget);
+
+        pbxProject.SetBuildProperty(frameworkTarget, "FRAMEWORK_SEARCH_PATHS", "$(inherited)");
+		pbxProject.AddBuildProperty(frameworkTarget, "FRAMEWORK_SEARCH_PATHS", "$(PROJECT_DIR)/Frameworks");
+
+        SetBugly(frameworkTarget,pbxProject,pathToBuiltProject);
+
+        pbxProject.WriteToFile (projectPath);
+    }
+
+    static void DisableBitcode(PBXProject pbxProject,string mainTarget,string frameworkTarget)
+    {
+        pbxProject.SetBuildProperty(mainTarget, "ENABLE_BITCODE", "NO");
+        pbxProject.SetBuildProperty(frameworkTarget, "ENABLE_BITCODE", "NO");
+    }
+
+    static void SetBugly(string frameworkTarget,PBXProject pbxProject, string pathToBuiltProject)
+    {
+        var buglyPath = "Bugly";
+        AddDirectory(pbxProject, pathToBuiltProject, $"{buglyPath}/Plugins/BuglyPlugins/iOS", "Bugly", null);
+        pbxProject.AddFileToBuild(frameworkTarget, pbxProject.AddFile("Bugly/Bugly.framework", "Bugly/Bugly.framework", PBXSourceTree.Source));
+        pbxProject.AddFileToBuild(frameworkTarget, pbxProject.AddFile("Bugly/BuglyBridge/libBuglyBridge.a", "Bugly/libBuglyBridge.a", PBXSourceTree.Source));
+        pbxProject.AddFileToBuild(frameworkTarget, pbxProject.AddFile("Bugly/BuglyBridge/BuglyBridge.h", "Bugly/BuglyBridge.h", PBXSourceTree.Source));
+
+        pbxProject.AddFileToBuild(frameworkTarget,pbxProject.AddFile("usr/lib/libz.dylib", "Bugly/libz.dylib", PBXSourceTree.Sdk));
+        pbxProject.AddFileToBuild(frameworkTarget,pbxProject.AddFile("usr/lib/libc++.dylib", "Bugly/libc++.dylib", PBXSourceTree.Sdk));
+
+        pbxProject.AddFrameworkToProject(frameworkTarget, "SystemConfiguration.framework", false);
+        pbxProject.AddFrameworkToProject(frameworkTarget, "Security.framework", false);
+        pbxProject.AddFrameworkToProject(frameworkTarget, "JavaScriptCore.framework", true);
+
+        pbxProject.AddBuildProperty(frameworkTarget, "FRAMEWORK_SEARCH_PATHS", "$(PROJECT_DIR)/Bugly");
+        pbxProject.AddBuildProperty(frameworkTarget, "LIBRARY_SEARCH_PATHS", "$(SRCROOT)/Bugly/BuglyBridge");
+    }
+
+    public static void AddDirectory(PBXProject project, string pathToBuiltProject, string assetPath, 
+    string xcodePath, Action<string> callback,bool recursiveDir = false,bool curDirFiles = false)
+    {
+        var path = Path.Combine(Application.dataPath, assetPath);
+        var targetPath = Path.Combine(pathToBuiltProject, xcodePath);
+        CopyDirectory(path, targetPath);
+        var info = new DirectoryInfo(targetPath);
+
+        if(recursiveDir)
+        {
+            var directories = info.GetDirectories();
+            foreach (var dirInfo in directories)
+            {
+                string fileGuid = project.AddFile(xcodePath + "/" + dirInfo.Name, xcodePath + "/" + dirInfo.Name, PBXSourceTree.Source);
+
+                if (callback != null)
+                {
+                    callback(fileGuid);
+                }
+            }
+        }
+
+        if (curDirFiles)
+        {
+            var filesList = info.GetFiles();
+            foreach (var fileInfo in filesList)
+            {
+                string fileGuid = project.AddFile(xcodePath + "/" + fileInfo.Name, xcodePath + "/" + fileInfo.Name, PBXSourceTree.Source);
+
+                if (callback != null)
+                {
+                    callback(fileGuid);
+                }
+            }
+        }
+        
+    }
+
+	public static void CopyDirectory(string sourcePath, string destinationPath)
+	{
+		if (destinationPath.EndsWith(".meta") || destinationPath.EndsWith(".DS_Store"))
+			return;
+		
+		DirectoryInfo info = new DirectoryInfo(sourcePath);
+		Directory.CreateDirectory(destinationPath);
+		foreach (FileSystemInfo fsi in info.GetFileSystemInfos())
+		{
+			string destName = Path.Combine(destinationPath, fsi.Name);
+
+			if (destName.EndsWith(".meta") || destName.EndsWith(".DS_Store"))
+				continue;
+
+			if (fsi is System.IO.FileInfo)          //如果是文件,复制文件
+				File.Copy(fsi.FullName, destName);
+			else                                    //如果是文件夹,新建文件夹,递归
+			{
+				Directory.CreateDirectory(destName);
+				CopyDirectory(fsi.FullName, destName);
+			}
+		}
+	}
+}
+#endif

+ 11 - 0
GameClient/Assets/ThirdParty/Bugly/Editor/XCodePostProcessBuild.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9595dc3411d58cd43b10a355a64b5373
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 5 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins.meta

@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: f306c8709b26942118dae1897b73e0e7
+folderAsset: yes
+DefaultImporter:
+  userData: 

+ 5 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins.meta

@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 5cef439187fbb41ab879da2b95ac4291
+folderAsset: yes
+DefaultImporter:
+  userData: 

+ 5 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android.meta

@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 694411f45e4e64facb88eebfc2e1df1c
+folderAsset: yes
+DefaultImporter:
+  userData: 

+ 7 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 644a9f5710e62403c94066ef9b61e775
+folderAsset: yes
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 7 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/armeabi-v7a.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: fb7b442d8e32443e5856838741007f70
+folderAsset: yes
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/armeabi-v7a/libBugly.so


+ 24 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/armeabi-v7a/libBugly.so.meta

@@ -0,0 +1,24 @@
+fileFormatVersion: 2
+guid: 432060a129574479db0cfd441cdf3d69
+timeCreated: 1497948394
+licenseType: Free
+PluginImporter:
+  serializedVersion: 1
+  iconMap: {}
+  executionOrder: {}
+  isPreloaded: 0
+  platformData:
+    Android:
+      enabled: 1
+      settings:
+        CPU: ARMv7
+    Any:
+      enabled: 0
+      settings: {}
+    Editor:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/bugly_crash_release.jar


+ 32 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/bugly_crash_release.jar.meta

@@ -0,0 +1,32 @@
+fileFormatVersion: 2
+guid: eced0f0c150cdaa4bb546f254f10f7a3
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Android: Android
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Any: 
+    second:
+      enabled: 0
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/buglyagent.jar


+ 23 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/buglyagent.jar.meta

@@ -0,0 +1,23 @@
+fileFormatVersion: 2
+guid: 1db231dca0f72420cb880590f799d7d5
+timeCreated: 1481808880
+licenseType: Free
+PluginImporter:
+  serializedVersion: 1
+  iconMap: {}
+  executionOrder: {}
+  isPreloaded: 0
+  platformData:
+    Android:
+      enabled: 1
+      settings: {}
+    Any:
+      enabled: 0
+      settings: {}
+    Editor:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 9 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/x86.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 79531ba82725e4071861c982307805c3
+folderAsset: yes
+timeCreated: 1443426231
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/x86/libBugly.so


+ 24 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/Android/libs/x86/libBugly.so.meta

@@ -0,0 +1,24 @@
+fileFormatVersion: 2
+guid: 16eaf0ec67588418783d6f5311aa71ce
+timeCreated: 1497948394
+licenseType: Free
+PluginImporter:
+  serializedVersion: 1
+  iconMap: {}
+  executionOrder: {}
+  isPreloaded: 0
+  platformData:
+    Android:
+      enabled: 1
+      settings:
+        CPU: x86
+    Any:
+      enabled: 0
+      settings: {}
+    Editor:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1080 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyAgent.cs

@@ -0,0 +1,1080 @@
+// ----------------------------------------
+//
+//  BuglyAgent.cs
+//
+//  Author:
+//       Yeelik, <bugly@tencent.com>
+//
+//  Copyright (c) 2015 Bugly, Tencent. All rights reserved.
+//
+// ----------------------------------------
+//
+using UnityEngine;
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Reflection;
+using System.Text;
+using System.Text.RegularExpressions;
+
+using System.Runtime.InteropServices;
+
+// We dont use the LogType enum in Unity as the numerical order doesnt suit our purposes
+/// <summary>
+/// Log severity. 
+/// { Log, LogDebug, LogInfo, LogWarning, LogAssert, LogError, LogException }
+/// </summary>
+public enum LogSeverity
+{
+    Log,
+    LogDebug,
+    LogInfo,
+    LogWarning,
+    LogAssert,
+    LogError,
+    LogException
+}
+
+/// <summary>
+/// Bugly agent.
+/// </summary>
+public sealed class BuglyAgent
+{
+    
+    // Define delegate support multicasting to replace the 'Application.LogCallback'
+    public delegate void LogCallbackDelegate (string condition,string stackTrace,LogType type);
+
+    /// <summary>
+    /// Configs the type of the crash reporter and customized log level to upload
+    /// </summary>
+    /// <param name="type">Type. Default=0, 1=Bugly v2.x MSDK=2</param>
+    /// <param name="logLevel">Log level. Off=0,Error=1,Warn=2,Info=3,Debug=4</param>
+    public static void ConfigCrashReporter(int type, int logLevel){
+        _SetCrashReporterType (type);
+        _SetCrashReporterLogLevel (logLevel);
+    }
+
+    /// <summary>
+    /// Init sdk with the specified appId. 
+    /// <para>This will initialize sdk to report native exception such as obj-c, c/c++, java exceptions, and also enable c# exception handler to report c# exception logs</para>
+    /// </summary>
+    /// <param name="appId">App identifier.</param>
+    public static void InitWithAppId (string appId)
+    {
+        if (IsInitialized) {
+            DebugLog (null, "BuglyAgent has already been initialized.");
+            
+            return;
+        }
+        
+        if (string.IsNullOrEmpty (appId)) {
+            return;
+        }
+        
+        // init the sdk with app id
+        InitBuglyAgent (appId);
+        DebugLog (null, "Initialized with app id: {0}", appId);
+        
+        // Register the LogCallbackHandler by Application.RegisterLogCallback(Application.LogCallback)
+        _RegisterExceptionHandler ();
+    }
+    
+    /// <summary>
+    /// Only Enable the C# exception handler. 
+    /// 
+    /// <para>
+    /// You can call it when you do not call the 'InitWithAppId(string)', but you must make sure initialized the sdk in elsewhere, 
+    /// such as the native code in associated Android or iOS project.
+    /// </para>
+    /// 
+    /// <para>
+    /// Default Level is <c>LogError</c>, so the LogError, LogException will auto report.
+    /// </para>
+    /// 
+    /// <para>
+    /// You can call the method <code>BuglyAgent.ConfigAutoReportLogLevel(LogSeverity)</code>
+    /// to change the level to auto report if you known what are you doing.
+    /// </para>
+    /// 
+    /// </summary>
+    public static void EnableExceptionHandler ()
+    {
+        if (IsInitialized) {
+            DebugLog (null, "BuglyAgent has already been initialized.");
+            return;
+        }
+        
+        DebugLog (null, "Only enable the exception handler, please make sure you has initialized the sdk in the native code in associated Android or iOS project.");
+        
+        // Register the LogCallbackHandler by Application.RegisterLogCallback(Application.LogCallback)
+        _RegisterExceptionHandler ();
+    }
+    
+    /// <summary>
+    /// Registers the log callback handler. 
+    /// 
+    /// If you need register logcallback using Application.RegisterLogCallback(LogCallback),
+    /// you can call this method to replace it.
+    /// 
+    /// <para></para>
+    /// </summary>
+    /// <param name="handler">Handler.</param>
+    public static void RegisterLogCallback (LogCallbackDelegate handler)
+    {
+        if (handler != null) {
+            DebugLog (null, "Add log callback handler: {0}", handler);
+            
+            _LogCallbackEventHandler += handler;
+        }
+    }
+    
+    /// <summary>
+    /// Sets the log callback extras handler.
+    /// </summary>
+    /// <param name="handler">Handler.</param>
+    public static void SetLogCallbackExtrasHandler(Func<Dictionary<string, string>> handler){
+        if (handler != null) {
+            _LogCallbackExtrasHandler = handler;
+            
+            DebugLog(null, "Add log callback extra data handler : {0}", handler);
+        }
+    }
+    
+    /// <summary>
+    /// Reports the exception.
+    /// </summary>
+    /// <param name="e">E.</param>
+    /// <param name="message">Message.</param>
+    public static void ReportException (System.Exception e, string message)
+    {
+        if (!IsInitialized) {
+            return;
+        }
+        
+        DebugLog (null, "Report exception: {0}\n------------\n{1}\n------------", message, e);
+        
+        _HandleException (e, message, false);
+    }
+    
+    /// <summary>
+    /// Reports the exception.
+    /// </summary>
+    /// <param name="name">Name.</param>
+    /// <param name="message">Message.</param>
+    /// <param name="stackTrace">Stack trace.</param>
+    public static void ReportException (string name, string message, string stackTrace)
+    {
+        if (!IsInitialized) {
+            return;
+        }
+        
+        DebugLog (null, "Report exception: {0} {1} \n{2}", name, message, stackTrace);
+        
+        _HandleException (LogSeverity.LogException, name, message, stackTrace, false);
+    }
+    
+    /// <summary>
+    /// Unregisters the log callback.
+    /// </summary>
+    /// <param name="handler">Handler.</param>
+    public static void UnregisterLogCallback (LogCallbackDelegate handler)
+    {
+        if (handler != null) {
+            DebugLog (null, "Remove log callback handler");
+            
+            _LogCallbackEventHandler -= handler;
+        }
+    }
+    
+    /// <summary>
+    /// Sets the user identifier.
+    /// </summary>
+    /// <param name="userId">User identifier.</param>
+    public static void SetUserId (string userId)
+    {
+        if (!IsInitialized) {
+            return;
+        }
+        DebugLog (null, "Set user id: {0}", userId);
+        
+        SetUserInfo (userId);
+    }
+    
+    /// <summary>
+    /// Sets the scene.
+    /// </summary>
+    /// <param name="sceneId">Scene identifier.</param>
+    public static void SetScene (int sceneId)
+    {
+        if (!IsInitialized) {
+            return;
+        }
+        DebugLog (null, "Set scene: {0}", sceneId);
+        
+        SetCurrentScene (sceneId);
+    }
+    
+    /// <summary>
+    /// Adds the scene data.
+    /// </summary>
+    /// <param name="key">Key.</param>
+    /// <param name="value">Value.</param>
+    public static void AddSceneData (string key, string value)
+    {
+        if (!IsInitialized) {
+            return;
+        }
+        
+        DebugLog (null, "Add scene data: [{0}, {1}]", key, value);
+        
+        AddKeyAndValueInScene (key, value);
+    }
+    
+    /// <summary>
+    /// Configs the debug mode.
+    /// </summary>
+    /// <param name="enable">If set to <c>true</c> debug mode.</param>
+    public static void ConfigDebugMode (bool enable)
+    {
+        EnableDebugMode (enable);
+        DebugLog (null, "{0} the log message print to console", enable ? "Enable" : "Disable");
+    }
+    
+    /// <summary>
+    /// Configs the auto quit application.
+    /// </summary>
+    /// <param name="autoQuit">If set to <c>true</c> auto quit.</param>
+    public static void ConfigAutoQuitApplication (bool autoQuit)
+    {
+        _autoQuitApplicationAfterReport = autoQuit;
+    }
+    
+    /// <summary>
+    /// Configs the auto report log level. Default is LogSeverity.LogError.
+    /// <example>
+    /// LogSeverity { Log, LogDebug, LogInfo, LogWarning, LogAssert, LogError, LogException }
+    /// </example>
+    /// </summary>
+    /// 
+    /// <param name="level">Level.</param> 
+    public static void ConfigAutoReportLogLevel (LogSeverity level)
+    {
+        _autoReportLogLevel = level;
+    }
+    
+    /// <summary>
+    /// Configs the default.
+    /// </summary>
+    /// <param name="channel">Channel.</param>
+    /// <param name="version">Version.</param>
+    /// <param name="user">User.</param>
+    /// <param name="delay">Delay.</param>
+    public static void ConfigDefault (string channel, string version, string user, long delay)
+    {
+        DebugLog (null, "Config default channel:{0}, version:{1}, user:{2}, delay:{3}", channel, version, user, delay);
+        ConfigDefaultBeforeInit (channel, version, user, delay);
+    }
+    
+    /// <summary>
+    /// Logs the debug.
+    /// </summary>
+    /// <param name="tag">Tag.</param>
+    /// <param name="format">Format.</param>
+    /// <param name="args">Arguments.</param>
+    public static void DebugLog (string tag, string format, params object[] args)
+    {
+        if(!_debugMode) {
+            return;
+        }
+
+        if (string.IsNullOrEmpty (format)) {
+            return;
+        }
+        
+        Console.WriteLine ("[BuglyAgent] <Debug> - {0} : {1}", tag, string.Format (format, args));
+    }
+    
+    /// <summary>
+    /// Prints the log.
+    /// </summary>
+    /// <param name="level">Level.</param>
+    /// <param name="format">Format.</param>
+    /// <param name="args">Arguments.</param>
+    public static void PrintLog (LogSeverity level, string format, params object[] args)
+    {
+        if (string.IsNullOrEmpty (format)) {
+            return;
+        }
+        
+        LogRecord (level, string.Format (format, args));
+    }
+    
+    #if UNITY_EDITOR || UNITY_STANDALONE
+    
+    #region Interface(Empty) in Editor 
+    private static void InitBuglyAgent (string appId)
+    {
+    }
+    
+    private static void ConfigDefaultBeforeInit(string channel, string version, string user, long delay){
+    }
+    
+    private static void EnableDebugMode(bool enable){
+    }
+    
+    private static void SetUserInfo(string userInfo){
+    }
+    
+    private static void ReportException (int type,string name, string message, string stackTrace, bool quitProgram)
+    {
+    }
+    
+    private static void SetCurrentScene(int sceneId) {
+    }
+    
+    private static void AddKeyAndValueInScene(string key, string value){
+    }
+    
+    private static void AddExtraDataWithException(string key, string value) {
+        // only impl for iOS
+    }
+    
+    private static void LogRecord(LogSeverity level, string message){
+    }
+    
+    private static void SetUnityVersion(){
+        
+    }
+    #endregion
+    
+    #elif UNITY_ANDROID
+    //  #if UNITY_ANDROID
+    
+    #region Interface for Android
+    private static readonly string GAME_AGENT_CLASS = "com.tencent.bugly.agent.GameAgent";
+    private static readonly int TYPE_U3D_CRASH = 4;
+    private static readonly int GAME_TYPE_UNITY = 2;
+    private static bool hasSetGameType = false;
+    private static AndroidJavaClass _gameAgentClass = null;
+    
+    public static AndroidJavaClass GameAgent {
+        get {
+            if (_gameAgentClass == null) {
+                _gameAgentClass = new AndroidJavaClass(GAME_AGENT_CLASS);
+//                using (AndroidJavaClass clazz = new AndroidJavaClass(CLASS_UNITYAGENT)) {
+//                    _gameAgentClass = clazz.CallStatic<AndroidJavaObject> ("getInstance");
+//                }
+            }
+            if (!hasSetGameType) {
+                // set game type: unity(2).
+                _gameAgentClass.CallStatic ("setGameType", GAME_TYPE_UNITY);
+                hasSetGameType = true;
+            }
+            return _gameAgentClass;
+        }
+    }
+    
+    private static string _configChannel;
+    private static string _configVersion;
+    private static string _configUser;
+    private static long _configDelayTime;
+    
+    private static void ConfigDefaultBeforeInit(string channel, string version, string user, long delay){
+        _configChannel = channel;
+        _configVersion = version;
+        _configUser = user;
+        _configDelayTime = delay;
+    }
+
+    private static bool _configCrashReporterPackage = false;
+    
+    private static void ConfigCrashReporterPackage(){
+        
+        if (!_configCrashReporterPackage) {
+            try {
+                GameAgent.CallStatic("setSdkPackageName", _crashReporterPackage);
+                _configCrashReporterPackage = true;
+            } catch {
+                
+            }
+        }
+        
+    }
+
+    private static void InitBuglyAgent(string appId)
+    {
+        if (IsInitialized) {
+            return;
+        }
+        
+        ConfigCrashReporterPackage();
+
+        try {
+            GameAgent.CallStatic("initCrashReport", appId, _configChannel, _configVersion, _configUser, _configDelayTime);
+            _isInitialized = true;
+        } catch {
+            
+        }
+    }
+    
+    private static void EnableDebugMode(bool enable){
+        _debugMode = enable;
+
+        ConfigCrashReporterPackage();
+
+        try {
+            GameAgent.CallStatic("setLogEnable", enable);
+        } catch {
+            
+        }
+    }
+    
+    private static void SetUserInfo(string userInfo){
+        ConfigCrashReporterPackage();
+
+        try {
+            GameAgent.CallStatic("setUserId", userInfo);
+        } catch {
+        }
+    }
+    
+    private static void ReportException (int type, string name, string reason, string stackTrace, bool quitProgram)
+    {
+        ConfigCrashReporterPackage();
+
+        try {
+            GameAgent.CallStatic("postException", TYPE_U3D_CRASH, name, reason, stackTrace, quitProgram);
+        } catch {
+            
+        }
+    }
+    
+    private static void SetCurrentScene(int sceneId) {
+        ConfigCrashReporterPackage();
+
+        try {
+            GameAgent.CallStatic("setUserSceneTag", sceneId);
+        } catch {
+            
+        }
+    }
+    
+    private static void SetUnityVersion(){
+        ConfigCrashReporterPackage();
+
+        try {
+            GameAgent.CallStatic("setSdkConfig", "UnityVersion", Application.unityVersion);
+        } catch {
+            
+        }
+    }
+    
+    private static void AddKeyAndValueInScene(string key, string value){
+        ConfigCrashReporterPackage();
+
+        try {
+            GameAgent.CallStatic("putUserData", key, value);
+        } catch {
+            
+        }
+    }
+    
+    private static void AddExtraDataWithException(string key, string value) {
+        // no impl
+    }
+    
+    private static void LogRecord(LogSeverity level, string message){
+        if (level < LogSeverity.LogWarning) {
+            DebugLog (level.ToString (), message);
+        }
+
+        ConfigCrashReporterPackage();
+        
+        try {
+            GameAgent.CallStatic("printLog", string.Format ("<{0}> - {1}", level.ToString (), message));
+        } catch {
+            
+        }
+    }
+    
+    #endregion
+    
+    #elif UNITY_IPHONE || UNITY_IOS
+    
+    #region Interface for iOS
+    
+    private static bool _crashReporterTypeConfiged = false;
+
+    private static void ConfigCrashReporterType(){
+        if (!_crashReporterTypeConfiged) {
+            try {
+                _BuglyConfigCrashReporterType(_crashReporterType);
+                _crashReporterTypeConfiged = true;
+             } catch {
+                
+            }
+        }
+    }
+
+    private static void ConfigDefaultBeforeInit(string channel, string version, string user, long delay){
+        ConfigCrashReporterType();
+        
+        try {
+            _BuglyDefaultConfig(channel, version, user, null);
+        } catch {
+            
+        }
+    }
+    
+    private static void EnableDebugMode(bool enable){
+        _debugMode = enable;
+    }
+    
+    private static void InitBuglyAgent (string appId)
+    {
+        ConfigCrashReporterType();
+        
+        if(!string.IsNullOrEmpty(appId)) {
+            
+            _BuglyInit(appId, _debugMode, _crashReproterCustomizedLogLevel); // Log level 
+        }
+    }
+    
+    private static void SetUnityVersion(){
+        ConfigCrashReporterType();
+        
+        _BuglySetExtraConfig("UnityVersion", Application.unityVersion);
+    }
+    
+    private static void SetUserInfo(string userInfo){
+        if(!string.IsNullOrEmpty(userInfo)) {
+            ConfigCrashReporterType();
+            
+            _BuglySetUserId(userInfo);
+        }
+    }
+    
+    private static void ReportException (int type, string name, string reason, string stackTrace, bool quitProgram)
+    {
+        ConfigCrashReporterType();
+        
+        string extraInfo = "";
+        Dictionary<string, string> extras = null;
+        if (_LogCallbackExtrasHandler != null) {
+            extras = _LogCallbackExtrasHandler();
+        }
+        if (extras == null || extras.Count == 0) {
+            extras = new Dictionary<string, string> ();
+            extras.Add ("UnityVersion", Application.unityVersion);
+        }
+        
+        if (extras != null && extras.Count > 0) {
+            if (!extras.ContainsKey("UnityVersion")) {
+                extras.Add ("UnityVersion", Application.unityVersion);
+            }
+            
+            StringBuilder builder = new StringBuilder();
+            foreach(KeyValuePair<string,string> kvp in extras){
+                builder.Append(string.Format("\"{0}\" : \"{1}\"", kvp.Key, kvp.Value)).Append(" , ");
+            }
+            extraInfo = string.Format("{{ {0} }}", builder.ToString().TrimEnd(" , ".ToCharArray()));
+        }
+        
+        // 4 is C# exception
+        _BuglyReportException(4, name, reason, stackTrace, extraInfo, quitProgram);
+    }
+    
+    private static void SetCurrentScene(int sceneId) {
+        ConfigCrashReporterType();
+        
+        _BuglySetTag(sceneId);
+    }
+    
+    private static void AddKeyAndValueInScene(string key, string value){
+        ConfigCrashReporterType();
+        
+        _BuglySetKeyValue(key, value);
+    }
+    
+    private static void AddExtraDataWithException(string key, string value) {
+        
+    }
+    
+    private static void LogRecord(LogSeverity level, string message){
+        if (level < LogSeverity.LogWarning) {
+            DebugLog (level.ToString (), message);
+        }
+        
+        ConfigCrashReporterType();
+        
+        _BuglyLogMessage(LogSeverityToInt(level), null, message);
+    }
+    
+    private static int LogSeverityToInt(LogSeverity logLevel){
+        int level = 5;
+        switch(logLevel) {
+        case LogSeverity.Log:
+            level = 5;
+            break;
+        case LogSeverity.LogDebug:
+            level = 4;
+            break;
+        case LogSeverity.LogInfo:
+            level = 3;
+            break;
+        case LogSeverity.LogWarning:
+        case LogSeverity.LogAssert:
+            level = 2;
+            break;
+        case LogSeverity.LogError:
+        case LogSeverity.LogException:
+            level = 1;
+            break;
+        default:
+            level = 0;
+            break;
+        }
+        return level;
+    }
+    
+    // --- dllimport start ---
+    [DllImport("__Internal")]
+    private static extern void _BuglyInit(string appId, bool debug, int level);
+    
+    [DllImport("__Internal")]
+    private static extern void _BuglySetUserId(string userId);
+    
+    [DllImport("__Internal")]
+    private static extern void _BuglySetTag(int tag);
+    
+    [DllImport("__Internal")]
+    private static extern void _BuglySetKeyValue(string key, string value);
+    
+    [DllImport("__Internal")]
+    private static extern void _BuglyReportException(int type, string name, string reason, string stackTrace, string extras, bool quit);
+    
+    [DllImport("__Internal")]
+    private static extern void _BuglyDefaultConfig(string channel, string version, string user, string deviceId);
+    
+    [DllImport("__Internal")]
+    private static extern void _BuglyLogMessage(int level, string tag, string log);
+    
+    [DllImport("__Internal")]
+    private static extern void _BuglyConfigCrashReporterType(int type);
+    
+    [DllImport("__Internal")]
+    private static extern void _BuglySetExtraConfig(string key, string value);
+    
+    // dllimport end
+    #endregion
+    
+    #endif
+    
+    #region Privated Fields and Methods 
+    private static event LogCallbackDelegate _LogCallbackEventHandler;
+    
+    private static bool _isInitialized = false;
+    private static LogSeverity _autoReportLogLevel = LogSeverity.LogError;
+
+    private static int _crashReporterType = 1;  // Default=0,1=Bugly-V2,MSDKBugly=2, IMSDKBugly=3
+
+#if UNITY_ANDROID
+    // The crash reporter package name, default is 'com.tencent.bugly'
+    private static string _crashReporterPackage = "com.tencent.bugly";
+#endif
+#if UNITY_IPHONE || UNITY_IOS
+    private static int _crashReproterCustomizedLogLevel = 2; // Off=0,Error=1,Warn=2,Info=3,Debug=4
+#endif
+
+    #pragma warning disable 414
+    private static bool _debugMode = false;
+    private static bool _autoQuitApplicationAfterReport = false;
+    
+    private static readonly int EXCEPTION_TYPE_UNCAUGHT = 1;
+    private static readonly int EXCEPTION_TYPE_CAUGHT = 2;
+    private static readonly string _pluginVersion = "1.5.1";
+    
+    private static Func<Dictionary<string, string>> _LogCallbackExtrasHandler;
+    
+    public static string PluginVersion {
+        get { return _pluginVersion; }
+    }
+    
+    public static bool IsInitialized {
+        get { return _isInitialized; }
+    }
+    
+    public static bool AutoQuitApplicationAfterReport {
+        get { return _autoQuitApplicationAfterReport; }
+    }
+
+    private static void _SetCrashReporterType(int type){
+        _crashReporterType = type;
+
+        if (_crashReporterType == 2) {
+#if UNITY_ANDROID
+            _crashReporterPackage = "com.tencent.bugly.msdk";
+#endif
+        }
+
+    }
+
+    private static void _SetCrashReporterLogLevel(int logLevel){
+#if UNITY_IPHONE || UNITY_IOS
+        _crashReproterCustomizedLogLevel = logLevel;
+#endif
+    }
+
+    private static void _RegisterExceptionHandler ()
+    {
+        try {
+            // hold only one instance 
+            
+            #if UNITY_5_3_OR_NEWER
+            Application.logMessageReceived += _OnLogCallbackHandler;
+            #else
+            Application.RegisterLogCallback (_OnLogCallbackHandler);
+            #endif
+            AppDomain.CurrentDomain.UnhandledException += _OnUncaughtExceptionHandler;
+            
+            _isInitialized = true;
+            
+            DebugLog (null, "Register the log callback in Unity {0}", Application.unityVersion);
+        } catch {
+            
+        }
+        
+        SetUnityVersion ();
+    }
+    
+    private static void _UnregisterExceptionHandler ()
+    {
+        try {
+            #if UNITY_5_3_OR_NEWER
+            Application.logMessageReceived -= _OnLogCallbackHandler;
+            #else
+            Application.RegisterLogCallback (null);
+            #endif
+            System.AppDomain.CurrentDomain.UnhandledException -= _OnUncaughtExceptionHandler;
+            DebugLog (null, "Unregister the log callback in unity {0}", Application.unityVersion);
+        } catch {
+            
+        }
+    }
+    
+    private static void _OnLogCallbackHandler (string condition, string stackTrace, LogType type)
+    {
+        if (_LogCallbackEventHandler != null) {
+            _LogCallbackEventHandler (condition, stackTrace, type);
+        }
+        
+        if (!IsInitialized) {
+            return;
+        }
+        
+        if (!string.IsNullOrEmpty (condition) && condition.Contains ("[BuglyAgent] <Log>")) {
+            return;
+        }
+        
+        if (_uncaughtAutoReportOnce) {
+            return;
+        }
+        
+        // convert the log level
+        LogSeverity logLevel = LogSeverity.Log;
+        switch (type) {
+        case LogType.Exception:
+            logLevel = LogSeverity.LogException;
+            break;
+        case LogType.Error:
+            logLevel = LogSeverity.LogError;
+            break;
+        case LogType.Assert:
+            logLevel = LogSeverity.LogAssert;
+            break;
+        case LogType.Warning:
+            logLevel = LogSeverity.LogWarning;
+            break;
+        case LogType.Log:
+            logLevel = LogSeverity.LogDebug;
+            break;
+        default:
+            break;
+        }
+        
+        if (LogSeverity.Log == logLevel) {
+            return;
+        }
+        
+        _HandleException (logLevel, null, condition, stackTrace, true);
+    }
+    
+    private static void _OnUncaughtExceptionHandler (object sender, System.UnhandledExceptionEventArgs args)
+    {
+        if (args == null || args.ExceptionObject == null) {
+            return;
+        }
+        
+        try {
+            if (args.ExceptionObject.GetType () != typeof(System.Exception)) {
+                return;
+            }
+        } catch {
+            if (UnityEngine.Debug.isDebugBuild == true) {
+                UnityEngine.Debug.Log ("BuglyAgent: Failed to report uncaught exception");
+            }
+            
+            return;
+        }
+        
+        if (!IsInitialized) {
+            return;
+        }
+        
+        if (_uncaughtAutoReportOnce) {
+            return;
+        }
+        
+        _HandleException ((System.Exception)args.ExceptionObject, null, true);
+    }
+    
+    private static void _HandleException (System.Exception e, string message, bool uncaught)
+    {
+        if (e == null) {
+            return;
+        }
+        
+        if (!IsInitialized) {
+            return;
+        }
+        
+        string name = e.GetType ().Name;
+        string reason = e.Message;
+        
+        if (!string.IsNullOrEmpty (message)) {
+            reason = string.Format ("{0}{1}***{2}", reason, Environment.NewLine, message);
+        }
+        
+        StringBuilder stackTraceBuilder = new StringBuilder ("");
+        
+        StackTrace stackTrace = new StackTrace (e, true);
+        int count = stackTrace.FrameCount;
+        for (int i = 0; i < count; i++) {
+            StackFrame frame = stackTrace.GetFrame (i);
+            
+            stackTraceBuilder.AppendFormat ("{0}.{1}", frame.GetMethod ().DeclaringType.Name, frame.GetMethod ().Name);
+            
+            ParameterInfo[] parameters = frame.GetMethod ().GetParameters ();
+            if (parameters == null || parameters.Length == 0) {
+                stackTraceBuilder.Append (" () ");
+            } else {
+                stackTraceBuilder.Append (" (");
+                
+                int pcount = parameters.Length;
+                
+                ParameterInfo param = null;
+                for (int p = 0; p < pcount; p++) {
+                    param = parameters [p];
+                    stackTraceBuilder.AppendFormat ("{0} {1}", param.ParameterType.Name, param.Name);
+                    
+                    if (p != pcount - 1) {
+                        stackTraceBuilder.Append (", ");
+                    }
+                }
+                param = null;
+                
+                stackTraceBuilder.Append (") ");
+            }
+            
+            string fileName = frame.GetFileName ();
+            if (!string.IsNullOrEmpty (fileName) && !fileName.ToLower ().Equals ("unknown")) {
+                fileName = fileName.Replace ("\\", "/");
+                
+                int loc = fileName.ToLower ().IndexOf ("/assets/");
+                if (loc < 0) {
+                    loc = fileName.ToLower ().IndexOf ("assets/");
+                }
+                
+                if (loc > 0) {
+                    fileName = fileName.Substring (loc);
+                }
+                
+                stackTraceBuilder.AppendFormat ("(at {0}:{1})", fileName, frame.GetFileLineNumber ());
+            }
+            stackTraceBuilder.AppendLine ();
+        }
+        
+        // report
+        _reportException (uncaught, name, reason, stackTraceBuilder.ToString ());
+    }
+    
+    private static void _reportException (bool uncaught, string name, string reason, string stackTrace)
+    {
+        if (string.IsNullOrEmpty (name)) {
+            return;
+        }
+        
+        if (string.IsNullOrEmpty (stackTrace)) {
+            stackTrace = StackTraceUtility.ExtractStackTrace ();
+        }
+        
+        if (string.IsNullOrEmpty (stackTrace)) {
+            stackTrace = "Empty";           
+        } else {
+            
+            try {
+                string[] frames = stackTrace.Split ('\n');
+                
+                if (frames != null && frames.Length > 0) {
+                    
+                    StringBuilder trimFrameBuilder = new StringBuilder ();
+                    
+                    string frame = null;
+                    int count = frames.Length;
+                    for (int i = 0; i < count; i++) {
+                        frame = frames [i];
+                        
+                        if (string.IsNullOrEmpty (frame) || string.IsNullOrEmpty (frame.Trim ())) {
+                            continue;
+                        }
+                        
+                        frame = frame.Trim ();
+                        
+                        // System.Collections.Generic
+                        if (frame.StartsWith ("System.Collections.Generic.") || frame.StartsWith ("ShimEnumerator")) {
+                            continue;
+                        }
+                        if (frame.StartsWith ("Bugly")) {
+                            continue;
+                        }
+                        if (frame.Contains ("..ctor")) {
+                            continue;
+                        }
+                        
+                        int start = frame.ToLower ().IndexOf ("(at");
+                        int end = frame.ToLower ().IndexOf ("/assets/");
+                        
+                        if (start > 0 && end > 0) {
+                            trimFrameBuilder.AppendFormat ("{0}(at {1}", frame.Substring (0, start).Replace (":", "."), frame.Substring (end));
+                        } else {
+                            trimFrameBuilder.Append (frame.Replace (":", "."));
+                        }
+                        
+                        trimFrameBuilder.AppendLine ();
+                    }
+                    
+                    stackTrace = trimFrameBuilder.ToString ();
+                }
+            } catch {
+                PrintLog(LogSeverity.LogWarning,"{0}", "Error to parse the stack trace");
+            }
+            
+        }
+        
+        PrintLog (LogSeverity.LogError, "ReportException: {0} {1}\n*********\n{2}\n*********", name, reason, stackTrace);
+        
+        _uncaughtAutoReportOnce = uncaught && _autoQuitApplicationAfterReport;
+        
+        ReportException (uncaught ? EXCEPTION_TYPE_UNCAUGHT : EXCEPTION_TYPE_CAUGHT, name, reason, stackTrace, uncaught && _autoQuitApplicationAfterReport);
+    }
+    
+    private static void _HandleException (LogSeverity logLevel, string name, string message, string stackTrace, bool uncaught)
+    {
+        if (!IsInitialized) {
+            DebugLog (null, "It has not been initialized.");
+            return;
+        }
+        
+        if (logLevel == LogSeverity.Log) {
+            return;
+        }
+        
+        if ((uncaught && logLevel < _autoReportLogLevel)) {
+            DebugLog (null, "Not report exception for level {0}", logLevel.ToString ());
+            return;
+        }
+        
+        string type = null;
+        string reason = null;
+        
+        if (!string.IsNullOrEmpty (message)) {
+            try {
+                if ((LogSeverity.LogException == logLevel) && message.Contains ("Exception")) {
+                    
+                    Match match = new Regex (@"^(?<errorType>\S+):\s*(?<errorMessage>.*)", RegexOptions.Singleline).Match (message);
+                    
+                    if (match.Success) {
+                        type = match.Groups ["errorType"].Value.Trim();
+                        reason = match.Groups ["errorMessage"].Value.Trim ();
+                    }
+                } else if ((LogSeverity.LogError == logLevel) && message.StartsWith ("Unhandled Exception:")) {
+                    
+                    Match match = new Regex (@"^Unhandled\s+Exception:\s*(?<exceptionName>\S+):\s*(?<exceptionDetail>.*)", RegexOptions.Singleline).Match(message);
+                    
+                    if (match.Success) {
+                        string exceptionName = match.Groups ["exceptionName"].Value.Trim();
+                        string exceptionDetail = match.Groups ["exceptionDetail"].Value.Trim ();
+                        
+                        // 
+                        int dotLocation = exceptionName.LastIndexOf(".");
+                        if (dotLocation > 0 && dotLocation != exceptionName.Length) {
+                            type = exceptionName.Substring(dotLocation + 1);
+                        } else {
+                            type = exceptionName;
+                        }
+                        
+                        int stackLocation = exceptionDetail.IndexOf(" at ");
+                        if (stackLocation > 0) {
+                            // 
+                            reason = exceptionDetail.Substring(0, stackLocation);
+                            // substring after " at "
+                            string callStacks = exceptionDetail.Substring(stackLocation + 3).Replace(" at ", "\n").Replace("in <filename unknown>:0","").Replace("[0x00000]","");
+                            //
+                            stackTrace = string.Format("{0}\n{1}", stackTrace, callStacks.Trim());
+                            
+                        } else {
+                            reason = exceptionDetail;
+                        }
+                        
+                        // for LuaScriptException
+                        if(type.Equals("LuaScriptException") && exceptionDetail.Contains(".lua") && exceptionDetail.Contains("stack traceback:")) {
+                            stackLocation = exceptionDetail.IndexOf("stack traceback:");
+                            if(stackLocation > 0) {
+                                reason = exceptionDetail.Substring(0, stackLocation);
+                                // substring after "stack traceback:"
+                                string callStacks = exceptionDetail.Substring(stackLocation + 16).Replace(" [", " \n[");
+                                
+                                //
+                                stackTrace = string.Format("{0}\n{1}", stackTrace, callStacks.Trim());
+                            }
+                        }
+                    }
+                    
+                }
+            } catch {
+                
+            }
+            
+            if (string.IsNullOrEmpty (reason)) {
+                reason = message;
+            }
+        }
+        
+        if (string.IsNullOrEmpty (name)) {
+            if (string.IsNullOrEmpty (type)) {
+                type = string.Format ("Unity{0}", logLevel.ToString ());
+            }
+        } else {
+            type = name;
+        }
+        
+        _reportException (uncaught, type, reason, stackTrace);
+    }
+    
+    private static bool _uncaughtAutoReportOnce = false;
+    
+    #endregion
+    
+}

+ 8 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyAgent.cs.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: be621fe31508b4f2ab134ee879ec97b4
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 

+ 27 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyCallback.cs

@@ -0,0 +1,27 @@
+// ----------------------------------------
+//
+//  BuglyCallbackDelegate.cs
+//
+//  Author:
+//       Yeelik, <bugly@tencent.com>
+//
+//  Copyright (c) 2015 Bugly, Tencent.  All rights reserved.
+//
+// ----------------------------------------
+//
+using UnityEngine;
+using System.Collections;
+
+public abstract class BuglyCallback
+{
+	// The delegate of callback handler which Call the Application.RegisterLogCallback(Application.LogCallback)
+	/// <summary>
+	/// Raises the application log callback handler event.
+	/// </summary>
+	/// <param name="condition">Condition.</param>
+	/// <param name="stackTrace">Stack trace.</param>
+	/// <param name="type">Type.</param>
+	public abstract void OnApplicationLogCallbackHandler (string condition, string stackTrace, LogType type);
+
+}
+

+ 8 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyCallback.cs.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 78e76f643d1884dcab602d5fe79b08e1
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 

+ 80 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyInit.cs

@@ -0,0 +1,80 @@
+// ----------------------------------------
+//
+//  BuglyInit.cs
+//
+//  Author:
+//       Yeelik, <bugly@tencent.com>
+//
+//  Copyright (c) 2015 Bugly, Tencent.  All rights reserved.
+//
+// ----------------------------------------
+//
+using UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+
+public class BuglyInit : MonoBehaviour
+{
+	/// <summary>
+	/// Your Bugly App ID. Every app has a special identifier that allows Bugly to associate error monitoring data with your app.
+	/// Your App ID can be found on the "Setting" page of the app you are trying to monitor.
+	/// </summary>
+	/// <example>A real App ID looks like this: 90000xxxx</example>
+	private const string BuglyAppID = "YOUR APP ID GOES HERE";
+
+	void Awake ()
+	{
+		// Enable the debug log print
+		BuglyAgent.ConfigDebugMode (false);
+		// Config default channel, version, user 
+		BuglyAgent.ConfigDefault (null, null, null, 0);
+		// Config auto report log level, default is LogSeverity.LogError, so the LogError, LogException log will auto report
+		BuglyAgent.ConfigAutoReportLogLevel (LogSeverity.LogError);
+		// Config auto quit the application make sure only the first one c# exception log will be report, please don't set TRUE if you do not known what are you doing.
+		BuglyAgent.ConfigAutoQuitApplication (false);
+		// If you need register Application.RegisterLogCallback(LogCallback), you can replace it with this method to make sure your function is ok.
+		BuglyAgent.RegisterLogCallback (null);
+
+		// Init the bugly sdk and enable the c# exception handler.
+		BuglyAgent.InitWithAppId (BuglyAppID);
+
+        // TODO Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
+        // please call this method to enable c# exception handler only.
+        BuglyAgent.EnableExceptionHandler ();
+        
+        // TODO NOT Required. If you need to report extra data with exception, you can set the extra handler
+        BuglyAgent.SetLogCallbackExtrasHandler (MyLogCallbackExtrasHandler);
+
+		Destroy (this);
+	}
+
+   // Extra data handler to packet data and report them with exception.
+        // Please do not do hard work in this handler 
+    static Dictionary<string, string> MyLogCallbackExtrasHandler ()
+    {
+        // TODO Test log, please do not copy it
+        BuglyAgent.PrintLog (LogSeverity.Log, "extra handler");
+        
+        // TODO Sample code, please do not copy it
+        Dictionary<string, string> extras = new Dictionary<string, string> ();
+        extras.Add ("ScreenSolution", string.Format ("{0}x{1}", Screen.width, Screen.height));
+        extras.Add ("deviceModel", SystemInfo.deviceModel);
+        extras.Add ("deviceName", SystemInfo.deviceName);
+        extras.Add ("deviceType", SystemInfo.deviceType.ToString ());
+        
+        extras.Add ("deviceUId", SystemInfo.deviceUniqueIdentifier);
+        extras.Add ("gDId", string.Format ("{0}", SystemInfo.graphicsDeviceID));
+        extras.Add ("gDName", SystemInfo.graphicsDeviceName);
+        extras.Add ("gDVdr", SystemInfo.graphicsDeviceVendor);
+        extras.Add ("gDVer", SystemInfo.graphicsDeviceVersion);
+        extras.Add ("gDVdrID", string.Format ("{0}", SystemInfo.graphicsDeviceVendorID));
+        
+        extras.Add ("graphicsMemorySize", string.Format ("{0}", SystemInfo.graphicsMemorySize));
+        extras.Add ("systemMemorySize", string.Format ("{0}", SystemInfo.systemMemorySize));
+        extras.Add ("UnityVersion", Application.unityVersion);
+        
+        BuglyAgent.PrintLog (LogSeverity.LogInfo, "Package extra data");
+        return extras;
+    }
+}
+

+ 8 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/BuglyInit.cs.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a717f6955eddf4463ad541714a1b5483
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 

+ 8 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 367f45ee79117cb4c94e64bfa6d4847d
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 5 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework.meta

@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 75b10080bdc104b83beb6663fc9985fb
+folderAsset: yes
+DefaultImporter:
+  userData: 

BIN
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Bugly


+ 7 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Bugly.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 0dd2027a6278544d4acc46c208b9f5f5
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2e39c573403bc479cb19650e7436097c
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 151 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/Bugly.h

@@ -0,0 +1,151 @@
+//
+//  Bugly.h
+//
+//  Version: 2.5(5)
+//
+//  Copyright (c) 2017年 Tencent. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "BuglyConfig.h"
+#import "BuglyLog.h"
+
+BLY_START_NONNULL
+
+@interface Bugly : NSObject
+
+/**
+ *  初始化Bugly,使用默认BuglyConfigs
+ *
+ *  @param appId 注册Bugly分配的应用唯一标识
+ */
++ (void)startWithAppId:(NSString * BLY_NULLABLE)appId;
+
+/**
+ *  使用指定配置初始化Bugly
+ *
+ *  @param appId 注册Bugly分配的应用唯一标识
+ *  @param config 传入配置的 BuglyConfig
+ */
++ (void)startWithAppId:(NSString * BLY_NULLABLE)appId
+                config:(BuglyConfig * BLY_NULLABLE)config;
+
+/**
+ *  使用指定配置初始化Bugly
+ *
+ *  @param appId 注册Bugly分配的应用唯一标识
+ *  @param development 是否开发设备
+ *  @param config 传入配置的 BuglyConfig
+ */
++ (void)startWithAppId:(NSString * BLY_NULLABLE)appId
+     developmentDevice:(BOOL)development
+                config:(BuglyConfig * BLY_NULLABLE)config;
+
+/**
+ *  设置用户标识
+ *
+ *  @param userId 用户标识
+ */
++ (void)setUserIdentifier:(NSString *)userId;
+
+/**
+ *  更新版本信息
+ *
+ *  @param version 应用版本信息
+ */
++ (void)updateAppVersion:(NSString *)version;
+
+/**
+ *  设置关键数据,随崩溃信息上报
+ *
+ *  @param value KEY
+ *  @param key VALUE
+ */
++ (void)setUserValue:(NSString *)value
+              forKey:(NSString *)key;
+
+/**
+ *  获取关键数据
+ *
+ *  @return 关键数据
+ */
++ (NSDictionary * BLY_NULLABLE)allUserValues;
+
+/**
+ *  设置标签
+ *
+ *  @param tag 标签ID,可在网站生成
+ */
++ (void)setTag:(NSUInteger)tag;
+
+/**
+ *  获取当前设置标签
+ *
+ *  @return 当前标签ID
+ */
++ (NSUInteger)currentTag;
+
+/**
+ *  获取设备ID
+ *
+ *  @return 设备ID
+ */
++ (NSString *)buglyDeviceId;
+
+/**
+ *  上报自定义Objective-C异常
+ *
+ *  @param exception 异常信息
+ */
++ (void)reportException:(NSException *)exception;
+
+/**
+ *  上报错误
+ *
+ *  @param error 错误信息
+ */
++ (void)reportError:(NSError *)error;
+
+/**
+ *    @brief 上报自定义错误
+ *
+ *    @param category    类型(Cocoa=3,CSharp=4,JS=5,Lua=6)
+ *    @param aName       名称
+ *    @param aReason     错误原因
+ *    @param aStackArray 堆栈
+ *    @param info        附加数据
+ *    @param terminate   上报后是否退出应用进程
+ */
++ (void)reportExceptionWithCategory:(NSUInteger)category
+                               name:(NSString *)aName
+                             reason:(NSString *)aReason
+                          callStack:(NSArray *)aStackArray
+                          extraInfo:(NSDictionary *)info
+                       terminateApp:(BOOL)terminate;
+
+/**
+ *  SDK 版本信息
+ *
+ *  @return SDK版本号
+ */
++ (NSString *)sdkVersion;
+
+/**
+ *  APP 版本信息
+ *
+ *  @return SDK版本号
+ */
++ (NSString *)appVersion;
+
+/**
+ *  App 是否发生了连续闪退
+ *  如果 启动SDK 且 5秒内 闪退,且次数达到 3次 则判定为连续闪退
+ *
+ *  @return 是否连续闪退
+ */
++ (BOOL)isAppCrashedOnStartUpExceedTheLimit;
+
+BLY_END_NONNULL
+
+@end

+ 7 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/Bugly.h.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 841e5a51a12834159aeebd4cbad0d2ce
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 136 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/BuglyConfig.h

@@ -0,0 +1,136 @@
+//
+//  BuglyConfig.h
+//  Bugly
+//
+//  Copyright (c) 2016年 Tencent. All rights reserved.
+//
+
+#pragma once
+
+#define BLY_UNAVAILABLE(x) __attribute__((unavailable(x)))
+
+#if __has_feature(nullability)
+#define BLY_NONNULL __nonnull
+#define BLY_NULLABLE __nullable
+#define BLY_START_NONNULL _Pragma("clang assume_nonnull begin")
+#define BLY_END_NONNULL _Pragma("clang assume_nonnull end")
+#else
+#define BLY_NONNULL
+#define BLY_NULLABLE
+#define BLY_START_NONNULL
+#define BLY_END_NONNULL
+#endif
+
+#import <Foundation/Foundation.h>
+
+#import "BuglyLog.h"
+
+BLY_START_NONNULL
+
+@protocol BuglyDelegate <NSObject>
+
+@optional
+/**
+ *  发生异常时回调
+ *
+ *  @param exception 异常信息
+ *
+ *  @return 返回需上报记录,随异常上报一起上报
+ */
+- (NSString * BLY_NULLABLE)attachmentForException:(NSException * BLY_NULLABLE)exception;
+
+
+/**
+ *  策略激活时回调
+ *
+ *  @param tacticInfo
+ *
+ *  @return app是否弹框展示
+ */
+- (BOOL) h5AlertForTactic:(NSDictionary *)tacticInfo;
+
+@end
+
+@interface BuglyConfig : NSObject
+
+/**
+ *  SDK Debug信息开关, 默认关闭
+ */
+@property (nonatomic, assign) BOOL debugMode;
+
+/**
+ *  设置自定义渠道标识
+ */
+@property (nonatomic, copy) NSString *channel;
+
+/**
+ *  设置自定义版本号
+ */
+@property (nonatomic, copy) NSString *version;
+
+/**
+ *  设置自定义设备唯一标识
+ */
+@property (nonatomic, copy) NSString *deviceIdentifier;
+
+/**
+ *  卡顿监控开关,默认关闭
+ */
+@property (nonatomic) BOOL blockMonitorEnable;
+
+/**
+ *  卡顿监控判断间隔,单位为秒
+ */
+@property (nonatomic) NSTimeInterval blockMonitorTimeout;
+
+/**
+ *  设置 App Groups Id (如有使用 Bugly iOS Extension SDK,请设置该值)
+ */
+@property (nonatomic, copy) NSString *applicationGroupIdentifier;
+
+/**
+ *  进程内还原开关,默认开启
+ */
+@property (nonatomic) BOOL symbolicateInProcessEnable;
+
+/**
+ *  非正常退出事件记录开关,默认关闭
+ */
+@property (nonatomic) BOOL unexpectedTerminatingDetectionEnable;
+
+/**
+ *  页面信息记录开关,默认开启
+ */
+@property (nonatomic) BOOL viewControllerTrackingEnable;
+
+/**
+ *  Bugly Delegate
+ */
+@property (nonatomic, assign) id<BuglyDelegate> delegate;
+
+/**
+ * 控制自定义日志上报,默认值为BuglyLogLevelSilent,即关闭日志记录功能。
+ * 如果设置为BuglyLogLevelWarn,则在崩溃时会上报Warn、Error接口打印的日志
+ */
+@property (nonatomic, assign) BuglyLogLevel reportLogLevel;
+
+/**
+ *  崩溃数据过滤器,如果崩溃堆栈的模块名包含过滤器中设置的关键字,则崩溃数据不会进行上报
+ *  例如,过滤崩溃堆栈中包含搜狗输入法的数据,可以添加过滤器关键字SogouInputIPhone.dylib等
+ */
+@property (nonatomic, copy) NSArray *excludeModuleFilter;
+
+/**
+ * 控制台日志上报开关,默认开启
+ */
+@property (nonatomic, assign) BOOL consolelogEnable;
+
+/**
+ * 崩溃退出超时,如果监听到崩溃后,App一直没有退出,则到达超时时间后会自动abort进程退出
+ * 默认值 5s, 单位 秒
+ * 当赋值为0时,则不会自动abort进程退出
+ */
+@property (nonatomic, assign) NSUInteger crashAbortTimeout;
+
+@end
+BLY_END_NONNULL

+ 7 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/BuglyConfig.h.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: dca72c35ab06f4c9abf2877ad9a9f718
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 78 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/BuglyLog.h

@@ -0,0 +1,78 @@
+//
+//  BuglyLog.h
+//  Bugly
+//
+//  Copyright (c) 2017年 Tencent. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+// Log level for Bugly Log
+typedef NS_ENUM(NSUInteger, BuglyLogLevel) {
+    BuglyLogLevelSilent  = 0,
+    BuglyLogLevelError   = 1,
+    BuglyLogLevelWarn    = 2,
+    BuglyLogLevelInfo    = 3,
+    BuglyLogLevelDebug   = 4,
+    BuglyLogLevelVerbose = 5,
+};
+#pragma mark -
+
+OBJC_EXTERN void BLYLog(BuglyLogLevel level, NSString *format, ...) NS_FORMAT_FUNCTION(2, 3);
+
+OBJC_EXTERN void BLYLogv(BuglyLogLevel level, NSString *format, va_list args) NS_FORMAT_FUNCTION(2, 0);
+
+#pragma mark -
+#define BUGLY_LOG_MACRO(_level, fmt, ...) [BuglyLog level:_level tag:nil log:fmt, ##__VA_ARGS__]
+
+#define BLYLogError(fmt, ...)   BUGLY_LOG_MACRO(BuglyLogLevelError, fmt, ##__VA_ARGS__)
+#define BLYLogWarn(fmt, ...)    BUGLY_LOG_MACRO(BuglyLogLevelWarn,  fmt, ##__VA_ARGS__)
+#define BLYLogInfo(fmt, ...)    BUGLY_LOG_MACRO(BuglyLogLevelInfo, fmt, ##__VA_ARGS__)
+#define BLYLogDebug(fmt, ...)   BUGLY_LOG_MACRO(BuglyLogLevelDebug, fmt, ##__VA_ARGS__)
+#define BLYLogVerbose(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelVerbose, fmt, ##__VA_ARGS__)
+
+#pragma mark - Interface
+@interface BuglyLog : NSObject
+
+/**
+ *    @brief  初始化日志模块
+ *
+ *    @param level 设置默认日志级别,默认BLYLogLevelSilent
+ *
+ *    @param printConsole 是否打印到控制台,默认NO
+ */
++ (void)initLogger:(BuglyLogLevel) level consolePrint:(BOOL)printConsole;
+
+/**
+ *    @brief 打印BLYLogLevelInfo日志
+ *
+ *    @param format   日志内容 总日志大小限制为:字符串长度30k,条数200
+ */
++ (void)log:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
+
+/**
+ *    @brief  打印日志
+ *
+ *    @param level 日志级别
+ *    @param message   日志内容 总日志大小限制为:字符串长度30k,条数200
+ */
++ (void)level:(BuglyLogLevel) level logs:(NSString *)message;
+
+/**
+ *    @brief  打印日志
+ *
+ *    @param level 日志级别
+ *    @param format   日志内容 总日志大小限制为:字符串长度30k,条数200
+ */
++ (void)level:(BuglyLogLevel) level log:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
+
+/**
+ *    @brief  打印日志
+ *
+ *    @param level  日志级别
+ *    @param tag    日志模块分类
+ *    @param format   日志内容 总日志大小限制为:字符串长度30k,条数200
+ */
++ (void)level:(BuglyLogLevel) level tag:(NSString *) tag log:(NSString *)format, ... NS_FORMAT_FUNCTION(3, 4);
+
+@end

+ 7 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Headers/BuglyLog.h.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 52d616a4d69ce46469563ec4166a5da7
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Modules.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 877eab29b0d76443883ae4dbb398cb69
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 12 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Modules/module.modulemap

@@ -0,0 +1,12 @@
+framework module Bugly {
+	umbrella header "Bugly.h"
+	
+	export *
+	module * { export * }
+	
+	link framework "Foundation"
+	link framework "Security"
+	link framework "SystemConfiguration"
+	link "c++"
+	link "z"
+}

+ 7 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/Bugly.framework/Modules/module.modulemap.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 01fcf8f3340eb42758a274ba09bbfa74
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 5 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/BuglyBridge.meta

@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: d6b25bfcf65a44ec0a0e6973f612af2a
+folderAsset: yes
+DefaultImporter:
+  userData: 

+ 101 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/BuglyBridge/BuglyBridge.h

@@ -0,0 +1,101 @@
+//
+//  BuglyBridge.h
+//  BuglyAgent
+//
+//  Created by Yeelik on 15/11/25.
+//  Copyright © 2015年 Bugly. All rights reserved.
+//
+//  Version: 1.3.3
+//
+
+#import <Foundation/Foundation.h>
+
+#pragma mark - Interface for Bridge
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+    
+    /**
+     *    @brief  初始化
+     *
+     *    @param appId 应用标识
+     *    @param debug 是否开启debug模式,开启后会在控制台打印调试信息,默认为NO
+     *    @param level 自定义日志上报级别,使用SDK接口打印的日志会跟崩溃信息一起上报,默认为Info(即Info、Warning、Error级别的日志都会上报)
+     *    Debug=4,Info=3,Warnning=2,Error=1,Off=0
+     */
+    void _BuglyInit(const char * appId, bool debug, int level);
+    
+    /**
+     *    @brief  设置用户唯一标识
+     *
+     *    @param userId
+     */
+    void _BuglySetUserId(const char * userId);
+    
+    /**
+     *    @brief  设置自定义标签
+     *
+     *    @param tag
+     */
+    void _BuglySetTag(int tag);
+    
+    /**
+     *    @brief  设置自定义键值对数据
+     *
+     *    @param key
+     *    @param value
+     */
+    void _BuglySetKeyValue(const char * key, const char * value);
+    
+    /**
+     *    @brief  自定义异常数据上报
+     *
+     *    @param type
+     *    @param name       异常类型
+     *    @param reason     异常原因
+     *    @param stackTrace 异常堆栈
+     *    @param extras     附加数据
+     *    @param quit       上报后是否退出应用
+     */
+    void _BuglyReportException(int type, const char * name, const char * reason, const char * stackTrace, const char * extras, bool quit);
+    
+    /**
+     *    @brief  设置默认的应用配置,在初始化之前调用
+     *
+     *    @param channel  渠道
+     *    @param version  应用版本
+     *    @param user     用户
+     *    @param deviceId 设备唯一标识
+     */
+    void _BuglyDefaultConfig(const char * channel, const char * version, const char *user, const char * deviceId);
+    
+    /**
+     *    @brief  自定义日志打印接口
+     *
+     *    @param level 日志级别, 1=Error、2=Warning、3=Info、4=Debug
+     *    @param tag   日志标签
+     *    @param log   日志内容
+     */
+    void _BuglyLogMessage(int level, const char * tag, const char * log);
+    
+    /**
+     *    @brief  设置崩溃上报组件的类别
+     *
+     *    @param type 0=Default、1=Bugly、2=MSDK、3=IMSDK
+     */
+    void _BuglyConfigCrashReporterType(int type);
+    
+    /**
+     *    @brief  设置额外的配置信息
+     *
+     *    @param key
+     *    @param value
+     */
+    void _BuglySetExtraConfig(const char *key, const char * value);
+    
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#pragma mark -

+ 20 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/BuglyBridge/BuglyBridge.h.meta

@@ -0,0 +1,20 @@
+fileFormatVersion: 2
+guid: aded946ff2bdf40ff9ac3e5c10f8fa5d
+timeCreated: 1497947595
+licenseType: Free
+PluginImporter:
+  serializedVersion: 1
+  iconMap: {}
+  executionOrder: {}
+  isPreloaded: 0
+  platformData:
+    Any:
+      enabled: 0
+      settings: {}
+    Editor:
+      enabled: 1
+      settings:
+        DefaultValueInitialized: true
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/BuglyBridge/libBuglyBridge.a


+ 20 - 0
GameClient/Assets/ThirdParty/Bugly/Plugins/BuglyPlugins/iOS/BuglyBridge/libBuglyBridge.a.meta

@@ -0,0 +1,20 @@
+fileFormatVersion: 2
+guid: 8e4622a66135549e18a59de3c9348ba7
+timeCreated: 1497947594
+licenseType: Free
+PluginImporter:
+  serializedVersion: 1
+  iconMap: {}
+  executionOrder: {}
+  isPreloaded: 0
+  platformData:
+    Any:
+      enabled: 0
+      settings: {}
+    Editor:
+      enabled: 1
+      settings:
+        DefaultValueInitialized: true
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: