PlatformIOS.cpp 1.9 KB

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