void SetupApiKey() { var manifestPath = Path.Combine(Application.dataPath, MainManifestPath); EnsureManifestExists(manifestPath); var changed = false; var apiKey = new MetaData("com.google.android.geo.API_KEY", GoogleMapsViewSettings.AndroidApiKey.Trim()); var manifest = new AndroidManifest(manifestPath); if (!manifest.Contains(apiKey)) { manifest.RemoveSimilar(apiKey); manifest.Add(apiKey); changed = true; } // https://developers.google.com/maps/documentation/android-sdk/config#specify_requirement_for_apache_http_legacy_library if (!manifest.Contains(UsesApacheHttpLibrary)) { manifest.RemoveSimilar(UsesApacheHttpLibrary); manifest.Add(UsesApacheHttpLibrary); changed = true; } if (GoogleMapsViewSettings.AddLocationPermission && !manifest.Contains(LocationPermission)) { manifest.Add(LocationPermission); changed = true; } if (changed) { manifest.Save(); } }
public void Regenerate() { GetSocialModifications.ForEach(node => { _manifest.RemoveSimilar(node); _manifest.Add(node); }); DeprecatedModifications.ForEach(node => { _manifest.RemoveSimilar(node); }); _manifest.Save(); Debug.Log("GetSocial: successfully regenerated AndroidManifest.xml with GetSocial modifications"); }