Пример #1
0
    def DeleteAllScreenShot(self, isHD):
        print("DeleteAllScreenShot isHD=", isHD)
        if not Platform.isWindowsSystem():
            mainUpdateAppstore.DeleteAllScreenshots(isHD)
            self.UpdateAppInfo(isHD)
            return

        # isHD = True
        appid = mainAppInfo.GetAppId(isHD, Source.APPSTORE)
        version = mainAppInfo.GetAppVersion(Source.IOS, isHD)
        total_screenshot = 5
        idx_country = 0
        idx_display = 0
        for country in self.listCountry:
            idx_display = 0
            for type in self.listDisplay:
                try:
                    mainAppConnectApi.DeleteAllScreenShot(
                        appid, version, country, type)
                except Exception as e:
                    print("DeleteAllScreenShot eror=", e)

                idx_display += 1

            idx_country += 1
Пример #2
0
    def UploadScreenShot(self, isHD):
        self.UpdateAppInfo(isHD)
        appid = mainAppInfo.GetAppId(isHD, Source.APPSTORE)
        package = mainAppInfo.GetAppPackage(Source.IOS, isHD)

        # isHD = True

        version = mainAppInfo.GetAppVersion(Source.IOS, isHD)
        total_screenshot = 5
        idx_country = 0
        idx_display = 0

        for country in self.listCountryScreentShot:
            idx_display = 0
            for type in self.listDisplay:

                # try:
                #     mainAppConnectApi.DeleteAllScreenShot(appid, version, country, type)
                # except Exception as e:
                #     print("DeleteAllScreenShot eror=",e)

                for i in range(total_screenshot):
                    filepath = mainResource.GetOutPutScreenshot(
                        isHD) + "/" + self.listCountryLanguage[
                            idx_country] + "/" + self.listDisplayName[
                                idx_display] + "/" + str(i + 1) + ".jpg"
                    print("UploadScreenShot filepath=", filepath)
                    if os.path.exists(filepath):
                        mainAppConnectApi.UploadScreenShot(
                            appid, version, country, type, filepath)

                idx_display += 1

            idx_country += 1
    def UpdateAppInfo(self, isHD):

        package = mainAppInfo.GetAppPackage(Source.ANDROID, isHD)
        version = mainAppInfo.GetAppVersion(Source.ANDROID, isHD)
        idx = 0
        print("google UpdateAppInfo=", package)

        for country in self.listCountry:
            lan = self.listCountryLanguage[idx]
            name = mainAppInfo.GetAppName(Source.IOS, isHD, lan)
            description = mainAppInfo.GetAppDetail(isHD, lan)
            promotionalText = mainAppInfo.GetAppPromotion(isHD, lan)
            mainGooglePlayApi.UpdateAppInfo(package, country, name,
                                            description, promotionalText,
                                            str(isHD), lan)
            idx += 1
Пример #4
0
    def DeleteAllScreenshots(self, isHd):
        verison = mainAppInfo.GetAppVersion(Source.IOS, isHd)

        rootConfig = mainResource.GetProjectConfigDefault()
        str_metadata_xml = FileUtil.GetFileString(
            rootConfig + "/appstore/metadata_clear_screenshots.xml")
        str_metadata_xml = str_metadata_xml.replace(
            "_VENDOR_ID_", mainAppInfo.GetAppSKU(isHd))
        str_metadata_xml = str_metadata_xml.replace("_VERSION_", verison)

        rootConfig = mainResource.GetProjectConfigApp()
        file_metadata_ios = rootConfig + "/appstore/ios/app.itmsp/metadata.xml"
        if isHd:
            file_metadata_ios = rootConfig + "/appstore/ios/app_pad.itmsp/metadata.xml"

        FileUtil.SaveString2File(str_metadata_xml, file_metadata_ios)
        mainAppstoreUploadiOS.Run(isHd)
    def UploadScreenShot(self, isHD):
        # isHD = True
        package = mainAppInfo.GetAppPackage(Source.ANDROID, isHD)
        version = mainAppInfo.GetAppVersion(Source.ANDROID, isHD)

        total_screenshot = 5
        idx_country = 0
        idx_display = 0
        for country in self.listCountry:
            idx_display = 0
            for type in self.listDisplay:
                for i in range(total_screenshot):
                    applan = self.listCountryLanguage[idx_country]
                    filepath = mainResource.GetOutPutScreenshot(
                        isHD) + "/" + applan + "/" + self.listDisplayName[
                            idx_display] + "/" + str(i + 1) + ".jpg"
                    if self.listDisplayName[idx_display] == "icon":
                        filepath = mainResource.GetOutPutIconPathWin32(
                            mainResource.GetProjectOutPut(), Source.TAPTAP,
                            isHD) + "\\icon_android_512.png"
                        if i > 0:
                            continue

                    if self.listDisplayName[idx_display] == "adhome":
                        filepath = mainResource.GetOutPutAdPathWin32(
                            mainResource.GetProjectOutPut(), Source.TAPTAP,
                            isHD
                        ) + "\\" + applan + "\\" + "ad_home_1024x500.png"
                        if i > 0:
                            continue

                    print("UploadScreenShot filepath=", filepath)
                    if os.path.exists(filepath):
                        mainGooglePlayApi.DeleteAllScreenShot(
                            package, version, country, type)
                        mainGooglePlayApi.UploadOneScreenShot(
                            package, filepath, country, type)

                idx_display += 1

            idx_country += 1
Пример #6
0
    def UpdateAppInfo(self, isHD, isUpdateName=True):

        if not Platform.isWindowsSystem():
            # self.UpdateAppstore(isHD)
            self.UpdateIAPInfo(isHD)

        appid = mainAppInfo.GetAppId(isHD, Source.APPSTORE)
        version = mainAppInfo.GetAppVersion(Source.IOS, isHD)
        idx = 0
        print("UpdateAppInfo 1 appid=" + appid + " isHD=" + str(isHD))
        for country in self.listCountry:
            lan = self.listCountryLanguage[idx]
            name = mainAppInfo.GetAppName(Source.IOS, isHD, lan)
            subtitle = mainAppInfo.GetAppSubtitle(isHD, lan)
            # policyUrl= mainAppInfo.GetAppPrivacyUrl(isHD)
            policyUrl = mainAppStoreAcount.GetPrivacy(
                Source.APPSTORE,
                mainAppInfo.GetAppStoreAcount(isHD, Source.APPSTORE))
            policyText = ""

            description = mainAppInfo.GetAppDetail(isHD, lan)
            keywords = mainAppInfo.GetAso(isHD, Source.APPSTORE, lan)
            marketingUrl = mainAppInfo.GetAppSoftwareUrl(isHD)
            promotionalText = mainAppInfo.GetAppPromotion(isHD, lan)
            supportUrl = mainAppInfo.GetAppSupportUrl(isHD)
            whatsNew = mainAppInfo.GetAppUpdate(isHD, lan)
            print("UpdateAppInfo  whatsNew=" + whatsNew + " lan=" + lan)
            mainAppConnectApi.UpdateAppInfo(appid, version, country,
                                            description, keywords,
                                            marketingUrl, promotionalText,
                                            supportUrl, whatsNew)
            if isUpdateName:
                try:
                    test = 0
                    mainAppConnectApi.UpdateAppName(appid, version, country,
                                                    name, policyText,
                                                    policyUrl, subtitle)
                except Exception as e:
                    print("UpdateAppName eror=", e)

            idx += 1
Пример #7
0
 def CreateNewVersion(self, isHD):
     appid = mainAppInfo.GetAppId(isHD, Source.APPSTORE)
     mainAppConnectApi.CreateNewVersion(
         appid, mainAppInfo.GetAppVersion(Source.IOS, isHD),
         mainAppInfo.GetAppPackage(Source.IOS, isHD))
Пример #8
0
    def FillAppInfo(self, isHD):
        appid = mainAppInfo.GetAppId(isHD, Source.APPSTORE)
        webcmd = WebDriverCmd(self.driver)

        # App 隐私
        try:
            self.FillAppPrivacy(isHD)
        except Exception as e:
            print("FillAppPrivacy eror=", e)

        try:
            self.FillAppPrice(isHD)
        except Exception as e:
            print("FillAppPrice eror=", e)

        try:
            self.FillAppInfo2(isHD)
        except Exception as e:
            print("FillAppInfo2 eror=", e)

        # base appinfo

        url = "https://appstoreconnect.apple.com/apps/" + appid + "/appstore/ios/version/inflight"
        self.driver.get(url)
        time.sleep(2)

        key = "//input[@id='versionString']"
        #
        webcmd.Find(key, True)
        version = mainAppInfo.GetAppVersion(Source.IOS, isHD)
        print("FillAppInfo version =", appid)
        webcmd.AddCmd(CmdType.INPUT_CLEAR, key)
        webcmd.Run(True)
        webcmd.AddCmd(CmdType.INPUT, key, version)
        # webcmd.SetInputText(key,version)
        webcmd.Run(True)

        webcmd.AddCmd(CmdType.INPUT, "//input[@id='copyright']", "moonma")
        webcmd.Run(True)
        # 截图
        # <input id="choose-file" type="file" multiple="" class="choose-file-input___33eoI">

        # 分级
        webcmd.AddCmd(CmdType.CLICK,
                      "//button[@type='button' and text()='编辑']")
        key = "//input[@type='radio' and @value='NONE' and contains(@id,'_NONE')]"
        webcmd.AddCmd(CmdType.CLICK_List_ALL, key)
        # <input type="radio" name="violenceCartoonOrFantasy" id="violenceCartoonOrFantasy_NONE" value="NONE">
        webcmd.AddCmd(CmdType.CLICK,
                      "//input[@id='unrestrictedWebAccess_false']")
        webcmd.AddCmd(CmdType.CLICK,
                      "//input[@id='gamblingAndContests_false']")
        webcmd.AddCmd(CmdType.CLICK,
                      "//button[@type='primary' and text()='完成']")

        webcmd.AddCmd(CmdType.CLICK, "//input[@id='demoAccountRequired']")
        webcmd.AddCmd(CmdType.INPUT, "//input[@id='contactFirstName']",
                      "YuanFang")
        webcmd.AddCmd(CmdType.INPUT, "//input[@id='contactLastName']", "Chen")
        webcmd.AddCmd(CmdType.INPUT, "//input[@id='contactPhone']",
                      "+8617370716836")
        webcmd.AddCmd(CmdType.INPUT, "//input[@id='contactEmail']",
                      "*****@*****.**")

        key = "//button[text()='存储']"
        webcmd.AddCmd(CmdType.CLICK, key)
        webcmd.Run(True)