From 3a35ffcbc5ded787cd0b6cfa6eaf4b8b6a7c2d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=E8=99=9E=E6=B8=A0=E6=88=90=E2=80=9D?= <“yuqucheng2006@qq.com”> Date: Tue, 23 Jun 2026 08:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dios=E8=93=9D=E7=89=99?= =?UTF-8?q?=E9=80=9A=E4=BF=A1=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editor/Firebase.Messaging.Editor.dll | Bin 8192 -> 0 bytes .../Editor/Firebase.Messaging.Editor.dll.meta | 118 -------- ...ebaseMessaging_version-13.5.0_manifest.txt | 74 ----- ...Messaging_version-13.5.0_manifest.txt.meta | 10 - Assets/Firebase/Editor/Messaging.meta | 8 - .../FirebaseMessagingActivityGenerator.asmdef | 16 -- ...baseMessagingActivityGenerator.asmdef.meta | 11 - .../FirebaseMessagingActivityGenerator.cs | 271 ------------------ ...FirebaseMessagingActivityGenerator.cs.meta | 11 - .../Firebase/Editor/MessagingDependencies.xml | 26 -- .../Editor/MessagingDependencies.xml.meta | 11 - Assets/Plugins/Android/mainTemplate.gradle | 6 +- .../Plugins/Android/settingsTemplate.gradle | 2 +- Assets/Plugins/BluetoothDeviceScript.cs | 2 + .../AndroidResolverDependencies.xml | 4 - 15 files changed, 4 insertions(+), 566 deletions(-) delete mode 100644 Assets/Firebase/Editor/Firebase.Messaging.Editor.dll delete mode 100644 Assets/Firebase/Editor/Firebase.Messaging.Editor.dll.meta delete mode 100644 Assets/Firebase/Editor/FirebaseMessaging_version-13.5.0_manifest.txt delete mode 100644 Assets/Firebase/Editor/FirebaseMessaging_version-13.5.0_manifest.txt.meta delete mode 100644 Assets/Firebase/Editor/Messaging.meta delete mode 100644 Assets/Firebase/Editor/Messaging/FirebaseMessagingActivityGenerator.asmdef delete mode 100644 Assets/Firebase/Editor/Messaging/FirebaseMessagingActivityGenerator.asmdef.meta delete mode 100644 Assets/Firebase/Editor/Messaging/FirebaseMessagingActivityGenerator.cs delete mode 100644 Assets/Firebase/Editor/Messaging/FirebaseMessagingActivityGenerator.cs.meta delete mode 100644 Assets/Firebase/Editor/MessagingDependencies.xml delete mode 100644 Assets/Firebase/Editor/MessagingDependencies.xml.meta diff --git a/Assets/Firebase/Editor/Firebase.Messaging.Editor.dll b/Assets/Firebase/Editor/Firebase.Messaging.Editor.dll deleted file mode 100644 index 34b86d43be4deb2299b3a0e6aba58f719c6536e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeHMe{3YzUH{JRdhJ`EH(C1?!!=AO{JKtSmJ6_xCyG{HH@A|H#tv0i} z&+Cb2XErmlK09@cLrav3fCv&uC{SJ0N{tW_RISoN6%{GvM?nFhDuPPQHAP4S2^B?1 zr~+}v=lf>%M|?jh@COp)+4G(EzQ5o1y?O8Z-Y)*^uTYqXB6x1xAo>R0T&5+wGuQ_? ze(Vq8^tD589sh>1@YeCdhT*Dp$F4ehO)cw|WqWE#s7}LD4NIL{&Z{-MBDB7~*h7Kp zl`PSM5~kmMuGeTZA-Y@EL%!dPVE<*=2Lzr=n5KV$ zS^2;H4w{TY`SUYG%UqczdM}XUW~)3!bQq15(?sW5$e*C167_Vj^`L#Rqpf*j+e7=I zdjUX`eLY|w=%+Ntb;=-1-=z;=L^0=Bv$hXH#7U#M z4>u!w+}z`us71z^L2H z_!K$-hEqvOL06Pc5#2u$p-;mOtRyJa2l}zT>k2gV9U6+#xhzPjIIxZj8`6zfRQe_B zz1=BvgAEQu5|N>^MBOP&s@TWq+Npsq+GFqbq}w|zo&YJ;4?u~o)BwNV`8y6?RPsoT zhkH^-Kwyp0MD+Y0G5N?qH>K_Yc8~jQV`jt#dJ;YEPjTfCB@Ws6AYx#;)|WUm)Pwd> zwC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6ZMQ?cBFg@Y;fs|8%gK1j_ zLK%cY^My2@M_bI~mXd0^Ll|p|s3LW`vv`wBTga>}&0fr|b|{%h-_o&(n(*{tIVGCI z;tz6zQ*&NYgrmu!X-?Z@%ZDx9Y+(F6ry*K~CeqDG6U-qbNSr^lgl<2DYOM^{|7rws znkyJh%;X>mJ1`-d4%b`R`ed>h&^At+$t}$lpIDwL=CiApaecK};D0*k z05{RO_Np`$i%q1P>*f^hQMl~Af91=hEUxgeaS+S!i?|PZk?%Q!!Yeaw#pooSFX8_2 zOSs@#&CliE`EmJce|Yb2E_}0hAo=?D{^UE%m*(WsO*;(>$DK5P^y%j3HY`VH*sa_W zRnyD1Ta+y6?Q`SB@zZG`)82F|#A&J$_N}U(zi{UwR)ulXa1K;{$l2lGvgG5 z=cRuO!oy+y)+>oGE}nX8FthvBKmO<7Dwn~*ja%mZ5BAN!_Zztdp85E=>RjG9r@v75~^t?(Nh=uQSMf$KD;5j<%Lo?Fc`k(u9TE=As zHf(uTEW`T2=(OX)G2-9fIF`+Gc1@n#b`a(NOb((SmfJ-Df#u&*RNgQ?EdTE!@E-xh B3aWhen the app is in the background, if a message with both a data and notification payload is", -" * received the data payload is stored on the Intent passed to onNewIntent. By default, that", -" * intent does not get set as the Intent that started the app, so when the app comes back online", -" * it doesn't see a new FCM message to respond to. As a workaround, we override onNewIntent so", -" * that it sends the intent to the MessageForwardingService which forwards the message to the", -" * FirebaseMessagingService which in turn sends the message to the application.", -" */", -" @Override", -" protected void onNewIntent(Intent intent) {{", -" super.onNewIntent(intent);", -"", -" // If we do not have a 'from' field this intent was not a message and should not be handled. It", -" // probably means this intent was fired by tapping on the app icon.", -" Bundle extras = intent.getExtras();", -" if (extras == null) {{", -" return;", -" }}", -" String from = extras.getString(EXTRA_FROM);", -" String messageId = extras.getString(EXTRA_MESSAGE_ID_KEY);", -" if (messageId == null) {{", -" messageId = extras.getString(EXTRA_MESSAGE_ID_KEY_SERVER);", -" }}", -" if (from != null && messageId != null) {{", -" Intent message = new Intent(this, MessageForwardingService.class);", -" message.setAction(MessageForwardingService.ACTION_REMOTE_INTENT);", -" message.putExtras(intent);", -" message.setData(intent.getData());", -" MessageForwardingService.enqueueWork(this, message);", -" }}", -" setIntent(intent);", -" }}", -"", -" /**", -" * Dispose of the mUnityPlayer when restarting the app.", -" *", -" *

This ensures that when the app starts up again it does not start with stale data.", -" */", -" @Override", -" protected void onCreate(Bundle savedInstanceState) {{", -" if (mUnityPlayer != null) {{", -" mUnityPlayer.{1}();", -" mUnityPlayer = null;", -" }}", -" super.onCreate(savedInstanceState);", -" }}", -"}}" - }; - private readonly string BaseActivityClass = "UnityPlayerActivity"; -#if UNITY_2023_1_OR_NEWER - private readonly string BaseGameActivityClass = "UnityPlayerGameActivity"; -#endif - -#if UNITY_2023_1_OR_NEWER - private readonly string UnityPlayerQuitFunction = "destroy"; -#else - private readonly string UnityPlayerQuitFunction = "quit"; -#endif - - private readonly string GeneratedFileTag = "FirebaseMessagingActivityGenerated"; - // If this tag is present on the generated file, it will not be replaced. - private readonly string PreserveTag = "FirebasePreserve"; - - private readonly string OutputPath = Path.Combine("Plugins", "Android"); - private readonly string OutputFilename = "MessagingUnityPlayerActivity.java"; - - public int callbackOrder { get { return 0; } } - public void OnPreprocessBuild(BuildReport report) { - // Only run this logic when building for Android. - if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android) { - return; - } - - // Determine what the contents of the generated file should be. - string baseClass = BaseActivityClass; -#if UNITY_2023_1_OR_NEWER - // If using the new GameActivity logic, we want to generate with that base class. - if (PlayerSettings.Android.applicationEntry.HasFlag(AndroidApplicationEntry.GameActivity)) { - baseClass = BaseGameActivityClass; - } -#endif - string fileContents = System.String.Format(System.String.Join("\n", ActivityClassContents), - baseClass, UnityPlayerQuitFunction); - - // Check if the file has already been generated. - string[] oldAssetGuids = AssetDatabase.FindAssets("l:" + GeneratedFileTag); - if (oldAssetGuids != null && oldAssetGuids.Length > 0) { - if (oldAssetGuids.Length != 1) { - Debug.LogWarning("FirebaseMessagingActivityEditor found multiple generated files with the label: " + - GeneratedFileTag + " \n" + - "No changes will be made, but this can potentially cause problems on Android with duplicate classes.\n" + - "Please check for duplicate classes, and remove any unnecessary uses of the label."); - return; - } - string oldAssetPath = AssetDatabase.GUIDToAssetPath(oldAssetGuids[0]); - Object oldAsset = AssetDatabase.LoadMainAssetAtPath(oldAssetPath); - if (oldAsset != null) { - string oldAssetFullPath = Path.Combine(Application.dataPath, "..", oldAssetPath); - string oldFileContents = System.IO.File.ReadAllText(oldAssetFullPath); - // If the old file matches what we would generate, exit early. - if (oldFileContents == fileContents) { - return; - } - // If the generated file has been tagged to be preserved, don't change it. - string[] labelList = AssetDatabase.GetLabels(oldAsset); - if (labelList.Contains(PreserveTag)) { - return; - } - // Delete the old asset. - Debug.Log("Changes detected, regenerating " + oldAssetPath + "\n" + - "To preserve local changes to that file, add the label: " + PreserveTag); - AssetDatabase.DeleteAsset(oldAssetPath); - } - } - - // Generate the new file. - string newAssetFullDirectory = Path.Combine(Application.dataPath, OutputPath); - System.IO.Directory.CreateDirectory(newAssetFullDirectory); - System.IO.File.WriteAllText(Path.Combine(newAssetFullDirectory, OutputFilename), fileContents); - string newAssetLocalPath = Path.Combine("Assets", OutputPath, OutputFilename); - AssetDatabase.ImportAsset(newAssetLocalPath); - Object newAsset = AssetDatabase.LoadMainAssetAtPath(newAssetLocalPath); - AssetDatabase.SetLabels(newAsset, new[]{GeneratedFileTag}); - } - } - - // Handles adding the android:theme to the AndroidManifest file if it isn't present, - // and swaps it on Unity versions that support GameActivity, which uses a different theme - // by default. - public class FirebaseMessagingAndroidManifestModifier : IPreprocessBuildWithReport { - // Hard coded directories and file names. - private static readonly string ANDROID_MANIFEST_DIRECTORY = - Path.Combine(Path.Combine("Assets", "Plugins"), "Android"); - private static readonly string ANDROID_MANIFEST_FILE = "AndroidManifest.xml"; - private static readonly string ANDROID_MANIFEST_PATH = - Path.Combine(ANDROID_MANIFEST_DIRECTORY, ANDROID_MANIFEST_FILE); - - private static readonly string MESSAGING_ACTIVITY = "com.google.firebase.MessagingUnityPlayerActivity"; - - private static readonly string DEFAULT_THEME = "@style/UnityThemeSelector"; -#if UNITY_2023_1_OR_NEWER - private static readonly string DEFAULT_GAME_THEME = "@style/BaseUnityGameActivityTheme"; -#endif - - public int callbackOrder { get { return 0; } } - public void OnPreprocessBuild(BuildReport report) { - string projectDir = Path.Combine(Application.dataPath, ".."); - string manifestFile = Path.Combine(projectDir, ANDROID_MANIFEST_PATH); - - if (!File.Exists(manifestFile)) { - // Unable to locate the file, so exit early. - return; - } - - var manifest = new XmlDocument(); - manifest.Load(manifestFile); - - CheckTheme(manifest); - - manifest.Save(manifestFile); - } - - private void CheckTheme(XmlDocument manifest) { - // Create a NamespaceManager with the 'android' namespace. - var nsManager = new XmlNamespaceManager(manifest.NameTable); - var androidNamespace = manifest.DocumentElement.GetNamespaceOfPrefix("android"); - if (string.IsNullOrEmpty(androidNamespace)) { - // If unable to find the android namespace, just exit out early, since we depend on it - return; - } - nsManager.AddNamespace("android", androidNamespace); - - // Find the activity node - XmlNode activityNode = manifest.SelectSingleNode( - $"//application/activity[@android:name='{MESSAGING_ACTIVITY}']", - nsManager); - - if (activityNode != null && activityNode is XmlElement activityElement) { - string existingTheme = activityElement.GetAttribute("theme", androidNamespace); - - string defaultTheme = DEFAULT_THEME; - bool setTheme = string.IsNullOrEmpty(existingTheme); -#if UNITY_2023_1_OR_NEWER - string otherTheme = DEFAULT_GAME_THEME; - // If using the new GameActivity logic, we want to use the default game theme. - if (PlayerSettings.Android.applicationEntry.HasFlag(AndroidApplicationEntry.GameActivity)) { - defaultTheme = DEFAULT_GAME_THEME; - otherTheme = DEFAULT_THEME; - } - // We also want to change the theme if is is using the other default. - setTheme |= existingTheme == otherTheme; -#endif - if (setTheme) { - activityElement.SetAttribute("theme", androidNamespace, defaultTheme); - } - } - } - } -} // namespace Firebase.Messaging.Editor diff --git a/Assets/Firebase/Editor/Messaging/FirebaseMessagingActivityGenerator.cs.meta b/Assets/Firebase/Editor/Messaging/FirebaseMessagingActivityGenerator.cs.meta deleted file mode 100644 index 87685be..0000000 --- a/Assets/Firebase/Editor/Messaging/FirebaseMessagingActivityGenerator.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 38cf8316372e4943aee735c624262e05 -labels: -- gvh -- gvh_version-13.5.0 -- gvhp_exportpath-Firebase/Editor/Messaging/FirebaseMessagingActivityGenerator.cs -timeCreated: 1480838400 -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Firebase/Editor/MessagingDependencies.xml b/Assets/Firebase/Editor/MessagingDependencies.xml deleted file mode 100644 index ba98554..0000000 --- a/Assets/Firebase/Editor/MessagingDependencies.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - Assets/Firebase/m2repository - - - - diff --git a/Assets/Firebase/Editor/MessagingDependencies.xml.meta b/Assets/Firebase/Editor/MessagingDependencies.xml.meta deleted file mode 100644 index e8d638c..0000000 --- a/Assets/Firebase/Editor/MessagingDependencies.xml.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 992fedef98ac42209a9d26d5bf364adf -labels: -- gvh -- gvh_version-13.5.0 -- gvhp_exportpath-Firebase/Editor/MessagingDependencies.xml -timeCreated: 1480838400 -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Android/mainTemplate.gradle b/Assets/Plugins/Android/mainTemplate.gradle index 0a18731..e9453e1 100644 --- a/Assets/Plugins/Android/mainTemplate.gradle +++ b/Assets/Plugins/Android/mainTemplate.gradle @@ -5,7 +5,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) // Android Resolver Dependencies Start implementation 'com.google.android.gms:play-services-base:18.10.0' // Assets/Firebase/Editor/DatabaseDependencies.xml:20 - // implementation 'com.google.firebase:firebase-analytics:23.0.0' // Assets/Firebase/Editor/MessagingDependencies.xml:15 + // implementation 'com.google.firebase:firebase-analytics:23.0.0' // Assets/Firebase/Editor/AnalyticsDependencies.xml:13 implementation 'com.google.firebase:firebase-analytics:23.2.0' // Assets/Firebase/Editor/DatabaseDependencies.xml:18 implementation 'com.google.firebase:firebase-analytics-unity:13.5.0' // Assets/Firebase/Editor/AnalyticsDependencies.xml:18 implementation 'com.google.firebase:firebase-app-unity:13.12.0' // Assets/Firebase/Editor/AppDependencies.xml:25 @@ -14,10 +14,6 @@ dependencies { implementation 'com.google.firebase:firebase-common:22.0.1' // Assets/Firebase/Editor/AppDependencies.xml:16 implementation 'com.google.firebase:firebase-database:22.0.1' // Assets/Firebase/Editor/DatabaseDependencies.xml:16 implementation 'com.google.firebase:firebase-database-unity:13.12.0' // Assets/Firebase/Editor/DatabaseDependencies.xml:25 - implementation 'com.google.firebase:firebase-iid:21.1.0' // Assets/Firebase/Editor/MessagingDependencies.xml:17 - implementation 'com.google.firebase:firebase-messaging:25.0.1' // Assets/Firebase/Editor/MessagingDependencies.xml:13 - implementation 'com.google.firebase:firebase-messaging-unity:13.5.0' // Assets/Firebase/Editor/MessagingDependencies.xml:24 - implementation 'com.google.flatbuffers:flatbuffers-java:1.12.0' // Assets/Firebase/Editor/MessagingDependencies.xml:19 // Android Resolver Dependencies End **DEPS**} diff --git a/Assets/Plugins/Android/settingsTemplate.gradle b/Assets/Plugins/Android/settingsTemplate.gradle index b8ba93c..8399e55 100644 --- a/Assets/Plugins/Android/settingsTemplate.gradle +++ b/Assets/Plugins/Android/settingsTemplate.gradle @@ -19,7 +19,7 @@ dependencyResolutionManagement { // Android Resolver Repos Start def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/") maven { - url (unityProjectPath + "/Assets/GeneratedLocalRepo/Firebase/m2repository") // Assets/Firebase/Editor/AnalyticsDependencies.xml:18, Assets/Firebase/Editor/AppDependencies.xml:25, Assets/Firebase/Editor/AuthDependencies.xml:23, Assets/Firebase/Editor/DatabaseDependencies.xml:25, Assets/Firebase/Editor/MessagingDependencies.xml:24 + url (unityProjectPath + "/Assets/GeneratedLocalRepo/Firebase/m2repository") // Assets/Firebase/Editor/AnalyticsDependencies.xml:18, Assets/Firebase/Editor/AppDependencies.xml:25, Assets/Firebase/Editor/AuthDependencies.xml:23, Assets/Firebase/Editor/DatabaseDependencies.xml:25 } mavenLocal() // Android Resolver Repos End diff --git a/Assets/Plugins/BluetoothDeviceScript.cs b/Assets/Plugins/BluetoothDeviceScript.cs index fd0cf93..d510a1c 100644 --- a/Assets/Plugins/BluetoothDeviceScript.cs +++ b/Assets/Plugins/BluetoothDeviceScript.cs @@ -311,6 +311,8 @@ public class BluetoothDeviceScript : MonoBehaviour #if UNITY_IOS if (BLEStandardUUIDs.ContainsKey(characteristic)) characteristic = BLEStandardUUIDs[characteristic]; + // iOS 通常返回 16-bit 短 UUID (如 FFE1),而 C# 层订阅时使用的是完整 128-bit UUID + characteristic = BluetoothLEHardwareInterface.FullUUID(characteristic).ToUpper(); #endif BluetoothLEHardwareInterface.Log ("Device: " + deviceAddress + " Characteristic Received: " + characteristic); diff --git a/ProjectSettings/AndroidResolverDependencies.xml b/ProjectSettings/AndroidResolverDependencies.xml index ac5b3b7..024bb9d 100644 --- a/ProjectSettings/AndroidResolverDependencies.xml +++ b/ProjectSettings/AndroidResolverDependencies.xml @@ -10,10 +10,6 @@ com.google.firebase:firebase-common:22.0.1 com.google.firebase:firebase-database:22.0.1 com.google.firebase:firebase-database-unity:13.12.0 - com.google.firebase:firebase-iid:21.1.0 - com.google.firebase:firebase-messaging:25.0.1 - com.google.firebase:firebase-messaging-unity:13.5.0 - com.google.flatbuffers:flatbuffers-java:1.12.0 Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-analytics-unity/13.5.0/firebase-analytics-unity-13.5.0.aar