| 
									
										
										
										
											2025-08-30 04:15:48 +00:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using UnityEngine; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace BigoAds.Scripts.Platforms.Android | 
					
						
							|  |  |  |  | { | 
					
						
							| 
									
										
										
										
											2025-08-30 05:49:11 +00:00
										 |  |  |  |     internal static class KwaiAndroidPlatformTool | 
					
						
							| 
									
										
										
										
											2025-08-30 04:15:48 +00:00
										 |  |  |  |     { | 
					
						
							|  |  |  |  |         public const string ClassPackage = "com.kwai.network.sdk"; | 
					
						
							|  |  |  |  |         private const string CurrentActivityMethod = "currentActivity"; | 
					
						
							|  |  |  |  |         private const string UnityPlayerClassName = "com.unity3d.player.UnityPlayer"; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public static AndroidJavaObject GetGameActivity() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return new AndroidJavaClass(UnityPlayerClassName).GetStatic<AndroidJavaObject>(CurrentActivityMethod); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public static void CallMethodOnMainThread(Action task) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             GetGameActivity()?.Call("runOnUiThread", new AndroidJavaRunnable(task)); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |