diff --git a/Assets/AppCenter/Editor/CreateManifest.cs b/Assets/AppCenter/Editor/CreateManifest.cs index 3de65675..153991b7 100644 --- a/Assets/AppCenter/Editor/CreateManifest.cs +++ b/Assets/AppCenter/Editor/CreateManifest.cs @@ -143,14 +143,8 @@ public class CreateManifest Directory.Delete(loaderFolder, true); return; } - var activityElements = applicationElements[0].Elements().Where(element => element.Name.LocalName == "activity").ToList(); - - // Delete the unzipped folder if the activity element already exists in the AndroidManifest.xml file - if (activityElements.Count == 1) - { - Directory.Delete(loaderFolder, true); - return; - } + var activityElementOld = applicationElements[0].Elements().FirstOrDefault(element => element.Name.LocalName == "activity"); + var intentElement = new XElement("intent-filter"); XNamespace ns = "http://schemas.android.com/apk/res/android"; @@ -171,7 +165,15 @@ public class CreateManifest intentElement.Add(categoryElement2); intentElement.Add(dataElement); activityElement.Add(intentElement); - applicationElements[0].Add(activityElement); + + if (activityElementOld != null) + { + activityElementOld.ReplaceWith(activityElement); + } + else + { + applicationElements[0].Add(activityElement); + } xmlFile.Save(manifestPath); // Delete the AndroidManifest.xml.meta file if generated @@ -185,4 +187,4 @@ public class CreateManifest ZipFile(loaderFolder, loaderZipFile); Directory.Delete(loaderFolder, true); } -} +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d55b9f9..a545a66b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ Updated native SDK versions: * **[Fix]** Fix `AppCenterStarter.m` was not included in the first build. * **[Fix]** Fix Unity 2019.3 iOS build. +### App Center Auth + +* **[Fix]** Fix Auth was incorrectly caching the old app secret in the manifest if it was changed. + ### App Center Crashes #### Android