PlatformIOS.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //
  2. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  3. // LICENSE: Atomic Game Engine Editor and Tools EULA
  4. // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
  5. // license information: https://github.com/AtomicGameEngine/AtomicGameEngine
  6. //
  7. #include <ThirdParty/PugiXml/src/pugixml.hpp>
  8. #include "../Build/BuildIOS.h"
  9. #include "../License/LicenseSystem.h"
  10. #include "PlatformIOS.h"
  11. #ifdef ATOMIC_PLATFORM_OSX
  12. #include "PlatformIOSUtils.h"
  13. #endif
  14. namespace ToolCore
  15. {
  16. PlatformIOS::PlatformIOS(Context* context) : Platform(context)
  17. {
  18. }
  19. PlatformIOS::~PlatformIOS()
  20. {
  21. }
  22. String PlatformIOS::ParseProvisionAppIdentifierPrefix(const String& provisionFile)
  23. {
  24. #if defined(ATOMIC_PLATFORM_WINDOWS) || defined(ATOMIC_PLATFORM_LINUX)
  25. return String::EMPTY;
  26. #else
  27. String pdata = GetMobileProvisionData(provisionFile.CString());
  28. if (!pdata.Length())
  29. return String::EMPTY;
  30. pugi::xml_document doc;
  31. if (!doc.load(pdata.CString()))
  32. {
  33. return String::EMPTY;
  34. }
  35. String AppIDName;
  36. String ApplicationIdentifierPrefix;
  37. pugi::xml_node dict = doc.document_element().child("dict");
  38. for (pugi::xml_node key = dict.child("key"); key; key = key.next_sibling("key"))
  39. {
  40. String keyName = key.child_value();
  41. if (keyName == "AppIDName")
  42. {
  43. pugi::xml_node value = key.next_sibling();
  44. if (!strcmp(value.name(), "string"))
  45. AppIDName = value.child_value();
  46. }
  47. else if (keyName == "ApplicationIdentifierPrefix")
  48. {
  49. pugi::xml_node array = key.next_sibling();
  50. if (!strcmp(array.name(), "array"))
  51. {
  52. pugi::xml_node value = array.first_child();
  53. if (!strcmp(value.name(), "string"))
  54. ApplicationIdentifierPrefix = value.child_value();
  55. }
  56. }
  57. }
  58. return ApplicationIdentifierPrefix;
  59. #endif
  60. }
  61. BuildBase* PlatformIOS::NewBuild(Project *project)
  62. {
  63. return new BuildIOS(context_, project);
  64. }
  65. bool PlatformIOS::GetLicense()
  66. {
  67. // BEGIN LICENSE MANAGEMENT
  68. return GetSubsystem<LicenseSystem>()->GetLicenseIOS();
  69. // END LICENSE MANAGEMENT
  70. }
  71. }