def check5():
    '''
    check5 - Locate the "GLA.entitlements"
    '''

    logging.info("Check 5: Locate the 'GLA.entitlements'")

    fileName = rootFolder + "GLA.entitlements"

    checkMethods.checkFileExists(fileName)

    try:
        with open(fileName, "r") as the_file:
            xml_string = checkMethods.xmlSnippet(the_file.read())

            xmldoc = minidom.parseString(xml_string)

            keyElems = xmldoc.getElementsByTagName("key")

            checkMethods.checkXMLValue(
                    keyElems,
                    "com.apple.developer.associated-domains",
                    "activitycontinuation:www.theguardian.com"
            )

            checkMethods.checkXMLValue(
                    keyElems,
                    "com.apple.security.application-groups",
                    "group.uk.co.guardian.iphone2"
            )

            checkMethods.checkXMLValueTrue(
                    keyElems,
                    "beta-reports-active"
            )

            checkMethods.checkXMLValue(
                    keyElems,
                    "keychain-access-groups",
                    "$(AppIdentifierPrefix)uk.co.guardian.SharedKeychain"
            )
        logging.info('\n')
    except IOError:
        logging.error("ERROR file missing: " + fileName)
        sys.exit(1)
def check22():
    '''
    check22 - Locate the "embedded.mobileprovision"
    '''

    logging.info("Check 22: Locate the 'embedded.mobileprovision'")

    fileName = rootFolder + "PlugIns/GLAExtensionWatchKit.appex/GLAWatchApp.app/embedded.mobileprovision"

    checkMethods.checkFileExists(fileName)

    try:
        with open(fileName, "r") as the_file:
            xml_string = checkMethods.xmlSnippet(the_file.read())

            xmldoc = minidom.parseString(xml_string)

            keyElems = xmldoc.getElementsByTagName("key")

            checkMethods.checkXMLValue(
                    keyElems,
                    "ApplicationIdentifierPrefix",
                    "U9LTYR56M6"
            )

            checkMethods.checkXMLValue(
                    keyElems,
                    "application-identifier",
                    "U9LTYR56M6.uk.co.guardian.iphone2.watchapp"
            )

            checkMethods.checkXMLValueTrue(
                    keyElems,
                    "beta-reports-active"
            )

            checkMethods.checkXMLValue(
                    keyElems,
                    "com.apple.developer.team-identifier",
                    "998P9U5NGJ"
            )

            checkMethods.checkXMLValueFalse(
                    keyElems,
                    "get-task-allow"
            )

            checkMethods.checkXMLValue(
                    keyElems,
                    "keychain-access-groups",
                    "U9LTYR56M6.*"
            )

            checkMethods.checkXMLValue(
                    keyElems,
                    "Name",
                    "Guardian Live WatchApp App Store"
            )

            checkMethods.checkXMLValue(
                    keyElems,
                    "TeamName",
                    "Guardian News & Media Ltd"
            )
        logging.info('\n')
    except IOError:
        logging.error("ERROR file missing: " + fileName)
        sys.exit(1)
def check4():
    '''
    check4 - Locate the "embedded.mobileprovision)
    '''

    logging.info("Check 4: Locate the 'embedded.mobileprovision'")

    fileName = rootFolder + "embedded.mobileprovision"

    checkMethods.checkFileExists(fileName)

    try:
        with open(fileName, "r") as the_file:
            xml_string = checkMethods.xmlSnippet(the_file.read())

            xmldoc = minidom.parseString(xml_string)

            keyElems = xmldoc.getElementsByTagName("key")

            checkMethods.checkXMLValue(
                keyElems,
                "ApplicationIdentifierPrefix",
                "U9LTYR56M6"
            )

            checkMethods.checkXMLValue(
                keyElems,
                "application-identifier",
                "U9LTYR56M6.uk.co.guardian.iphone2"
            )

            checkMethods.checkXMLValue(
                keyElems,
                "aps-environment",
                "production"
            )

            checkMethods.checkXMLValueTrue(
                keyElems,
                "beta-reports-active"
            )

            checkMethods.checkXMLValue(
                keyElems,
                "com.apple.developer.associated-domains",
                "*"
            )

            checkMethods.checkXMLValue(
                keyElems,
                "com.apple.developer.team-identifier",
                "998P9U5NGJ"
            )

            checkMethods.checkXMLValue(
                keyElems,
                "com.apple.security.application-groups",
                "group.uk.co.guardian.iphone2"
            )

            checkMethods.checkXMLValueFalse(
                keyElems,
                "get-task-allow"
            )

            checkMethods.checkXMLValue(
                keyElems,
                "keychain-access-groups",
                "U9LTYR56M6.*"
            )

            checkMethods.checkXMLValue(
                keyElems,
                "Name",
                "Guardian Live App Store"
            )

            checkMethods.checkXMLValue(
                keyElems,
                "TeamName",
                "Guardian News & Media Ltd"
            )
        logging.info('\n')
    except IOError:
        logging.error("ERROR file missing: " + fileName)
        exit