示例#1
0
    def UpLoadSignAndroid(self):
        webcmd = WebDriverCmd(self.driver)
        # E:\Users\moon\Downloads

        if Platform.isWindowsSystem():
            downloadDir = "C:\\Users\\moon\\Downloads"

        if Platform.isMacSystem():
            downloadDir = "/Users/moon/Downloads"

        self.DeleteAllDownloadFile(downloadDir, ".apk")

        # 下载空包 E:\Users\moon\Downloads\mssp-verify-b8920a35.apk
        key = "//button[@class='veui-button bottom20']"
        webcmd.AddCmd(CmdType.CLICK, key)
        webcmd.Run(True)

        time.sleep(3)
        apk_unsign = self.GetDownloadFile(downloadDir, ".apk")
        apk_sign = mainResource.GetProjectOutPut() + "/mssp_baidu/signed.apk"
        FileUtil.CreateDir(FileUtil.GetLastDirofDir(apk_sign))
        jks = mainResource.GetDirProductCommon() + "/Ad/moonma.jks"

        if Platform.isWindowsSystem():

            # sign apk:
            # jarsigner -verbose -keystore ~/sourcecode/mssp_baidu/moonma.jks -signedjar ~/sourcecode/mssp_baidu/signed.apk ~/sourcecode/mssp_baidu/empty.apk moonma -storepass qianlizhiwai
            cmd = "jarsigner -verbose -keystore " + jks + " -signedjar " + apk_sign + " " + apk_unsign + " moonma -storepass qianlizhiwai"

        if Platform.isMacSystem():
            # sign apk:
            # jarsigner -verbose -keystore ~/sourcecode/mssp_baidu/moonma.jks -signedjar ~/sourcecode/mssp_baidu/signed.apk ~/sourcecode/mssp_baidu/empty.apk moonma -storepass qianlizhiwai
            cmd = "jarsigner -verbose -keystore " + jks + " -signedjar " + apk_sign + " " + apk_unsign + " moonma -storepass qianlizhiwai"

        print(cmd)
        os.system(cmd)
        time.sleep(1)

        # sign end

        # 滚动到浏览器顶部
        js_top = "var q=document.documentElement.scrollTop=0"
        # 滚动到浏览器底部
        js_bottom = "var q=document.documentElement.scrollTop=document.documentElement.scrollHeight"
        self.driver.execute_script(js_bottom)
        time.sleep(2)

        # 上传签名包
        # key = "//input[@accept='.apk' and @name='file']"
        key = "//label[@class='veui-button veui-uploader-input-label']"
        item = webcmd.AddCmd(CmdType.CLICK_Action, key)
        # webcmd.SetItemVisible(item)
        webcmd.Run(True)

        self.OpenFileBrowser(apk_sign)
示例#2
0
    def GenerateProject(self, isHD, channel):
        name = self.GetProjectName(channel)
        # cloudres
        # output
        dir = mainResource.GetRootCocosBuildOutput() + "/" + name
        FileUtil.RemoveDir(dir)

        # 0f6 2f1
        UNITYPATH = ""
        if Platform.isWindowsSystem():
            # UNITYPATH="E:/Unity/"+Source.UNITY_VERSION_WIN+"/Editor/Unity.exe"
            UNITYPATH = "CocosCreator.exe"
        else:
            # UNITYPATH="/Applications/Unity/Hub/Editor/"+Source.UNITY_VERSION_MAC+"/Unity.app/Contents/MacOS/Unity"
            UNITYPATH = "/Applications/CocosCreator/Creator/" + Source.Cocos_Version + "/CocosCreator.app/Contents/MacOS/CocosCreator"
            #  --project projectPath--build "platform=web-desktop;debug=true"

        appid = mainAppInfo.GetAppId(isHD, channel)
        PROJECT_PATH = mainResource.GetRootProjectUnity()
        # cmd = UNITYPATH+" --project "+ PROJECT_PATH+" --build "+ "\"platform=wechatgame;debug=false\""

        # package = "packages: { wechatgame: {appid: '*****',}}"
        package = "packages: { wechatgame: {appid: '" + appid + "',}}"
        # cmd = UNITYPATH+" --project "+ PROJECT_PATH+" --build "+ "\"platform="+name+";debug=false;packages="+package+"\""
        cmd = UNITYPATH + " --project " + PROJECT_PATH + " --build " + "\"platform=" + name + ";debug=false" + "\""

        print("BuildWeixin  cmd=" + cmd)
        # ps = subprocess.Popen(cmd)
        # ps.wait()#让程序阻塞
        os.system(cmd)

        print("BuildWeixin  end")
    def UploadScreenShot(self, isHD):
        appid = mainAppInfo.GetAppId(isHD, Source.HUAWEI)
        # mainHuaweiAppGalleryApi.DeleteLanuage(appid,"zh-CN")
        # return

        pic = mainResource.GetOutPutCopyRightPathWin32(
            mainResource.GetProjectOutPut(), isHD) + "\\huawei.png"
        mainHuaweiAppGalleryApi.UploadImageCopyRight(appid, pic)
        # return

        idx = 0
        for country in self.listCountry:
            lan = self.listCountryLanguage[idx]
            icon = mainResource.GetOutPutIconPathWin32(
                mainResource.GetProjectOutPut(), Source.TAPTAP,
                isHD) + "\\huawei\\icon_android_216.png"
            mainHuaweiAppGalleryApi.UploadImageIcon(appid, icon, country)
            mainHuaweiAppGalleryApi.StartScreenShot()
            for i in range(0, 5):
                pic = mainResource.GetOutPutScreenshotPathWin32(
                    mainResource.GetProjectOutPut(), Source.TAPTAP,
                    isHD) + "\\" + lan + "\\1080p\\" + str(i + 1) + ".jpg"
                if Platform.isMacSystem():
                    pic = pic.replace("\\", "/")

                if os.path.exists(pic):
                    print(pic)
                    mainHuaweiAppGalleryApi.UploadOneScreenShot(
                        appid, pic, isHD)

            mainHuaweiAppGalleryApi.CommitScreenShot(appid, isHD, country)

            idx += 1
示例#4
0
 def Run(self):
     cmdPath = mainResource.cmdPath
     dir2 = cmdPath
     if Platform.IsVMWare():
         cmdPath = "/Volumes/VMware Shared Folders/" + cmdPath
     print("dir2=" + dir2)
     self.ScanDir(cmdPath, dir2)
    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
示例#6
0
    def ScanDir(self, sourceDir, dir2):
        for file in os.listdir(sourceDir):
            sourceFile = os.path.join(sourceDir, file)
            if os.path.isdir(sourceFile):
                if Platform.isWindowsSystem():
                    key = "/cmd_win"
                else:
                    key = "/cmd_mac"

                dirsrc = mainResource.GetProjectConfigDefault() + key
                dir = sourceFile + key
                flag = os.path.exists(dir)
                if flag:
                    shutil.rmtree(dir)
                    shutil.copytree(dirsrc, dir)
                    if Platform.isMacSystem():
                        self.UpdateMacFile(dir)
示例#7
0
 def GetDirNameofPath(path):
     str_split = '/'
     if Platform.isWindowsSystem():
         str_split = '\\'
     idx = path.rfind(str_split)
     s_len = len(path)
     game = path[idx + 1:s_len]
     return game
示例#8
0
    def GetLastDirofDir(path):
        str_split = '/'
        if Platform.isWindowsSystem():
            str_split = '\\'
        idx = path.rfind(str_split)

        ret = path[0:idx]
        return ret
示例#9
0
 def GetRootDir(self):
     #Users/moon/sourcecode/unity/product/kidsgame
     key = "/"
     if Platform.isWindowsSystem():
         key = "\\"
     dir = self.GetDirProduct() + key + self.GetProjectName()
     # print("GetRootDir dir=",dir)
     return dir
示例#10
0
 def GetDirProduct(self):
     #Users/moon/sourcecode/unity/product
     key = "/product/"
     if Platform.isWindowsSystem():
         key = "\\product\\"
     idx = self.cmdPath.find(key) + len(key) - 1
     dir = self.cmdPath[0:idx]
     # print("GetDirProduct dir=",dir)
     return dir
示例#11
0
 def SetCmdPath(self, cmdPath):
     self.cmdPath = cmdPath
     # print("SetCmdPath cmdPath=",cmdPath)
     key = "/cmd_"
     if Platform.isWindowsSystem():
         key = "\\cmd_"
     idx = cmdPath.find(key)
     # print("SetCmdPath idx=",idx)
     if idx >= 0:
         self.cmdPath = cmdPath[0:idx]
示例#12
0
    def UploadScreenShot(self, webcmd, isHD, lan, applan):
        # screenshot
        for i in range(0, 1):
            # bug 上传图片之前先要重新选择语言 不然无法弹出文件浏览器
            # self.SelectLanguage(webcmd,lan)
            time.sleep(1)

            # 将 滚动条 底部对齐

            # lan_shot = "chs-contents"
            # key = "//div[@id='"+lan_shot+"']"
            # div = self.driver.find_element(By.XPATH, key)
            # if div==None:
            #     print("not find screenshot div")
            #     return

            # 查找子元素
            # 当您启动XPath表达式时//,它会从文档的根目录中搜索,忽略您的父元素。你应该在表达前加上.

            # element2 = driver.find_element_by_xpath("//div[@title='div2']")
            # element2.find_element_by_xpath(".//p[@class='test']").text

            # key = ".//input[@type='file' and @data-target='#screenshots']"
            # item = div.find_element(By.XPATH, key)
            item_root = self.GetItemOfScreenShot(lan)

            key = ".//div[@class='ant-upload-drag-container']"
            item_div = webcmd.FindChild(item_root, key)

            # item = self.driver.find_element(By.XPATH, key)
            # item_div = webcmd.AddCmd2(CmdType.CLICK_Action, key)
            self.SetItemVisible(item_div)
            webcmd.DoCmd(item_div, CmdType.CLICK)

            time.sleep(1)

            pic = mainResource.GetOutPutScreenshotPathWin32(
                mainResource.GetProjectOutPut(), Source.TAPTAP,
                isHD) + "\\" + applan + "\\1080p\\" + str(i + 1) + ".jpg"
            if Platform.isMacSystem():
                # apk = FileUtil.GetLastDirofDir(apk)
                pic = pic.replace("\\", "/")
                pic = FileUtil.GetLastDirofDir(pic)
                test = 0

            flag = os.path.exists(pic)
            if flag:
                print(pic)
                self.OpenFileBrowser(pic, True)
                time.sleep(2)

            # 等待上传完成
            key = ".//span[@class='upload_img']"
            # print(key)
            item = webcmd.FindChild(item_root, key, True)
示例#13
0
    def ScanDirs(self, sourceDir, channel, dir2):
        for file in os.listdir(sourceDir):
            sourceFile = os.path.join(sourceDir, file)
            if os.path.isdir(sourceFile):
                # python 里无法直接执行cd目录,想要用chdir改变当前的工作目录
                if Platform.isWindowsSystem():
                    os.chdir(sourceFile + "/cmd_win")
                    os.system("echo.| copy_cmd.bat")
                else:
                    dirapp = dir2 + "/" + file + "/cmd_mac"
                    if Platform.IsVMWare():
                        dirapp = "/Volumes/VMware\\ Shared\\ Folders/" + dir2 + "/" + file + "/cmd_mac"
                        # os.system("cd /Volumes/VMware\\ Shared\\ Folders")

                        # cmdPath="/Volumes/VMware Shared Folders/"+cmdPath

                        os.system("cd " + dirapp)
                    else:
                        os.chdir(dirapp)

                    os.system("sh " + "./copy_cmd")
                    # os.system("sh "+dirapp+"/build_all_ios")

                print(file)
                # update_appname build_huawei

                if channel == "huawei":
                    os.system("echo.| call build_huawei.bat")
                if channel == "gp":
                    os.system("echo.| call build_gp.bat")
                if channel == "android":
                    os.system("echo.| call build_all_android.bat")
                if channel == "ios":
                    if Platform.isWindowsSystem():
                        os.system("echo.| build_all_ios.bat")
                        # else:
                        # os.system("build_all_ios")
                        # os.system("cd "+dirapp)
                        os.system("sh " + "./build_all_ios")

                if channel == "ios_copy_cmd":
                    print("ios_copy_cmd")
示例#14
0
    def UpLoadApk(self, isHD):
        webcmd = WebDriverCmd(self.driver)

        self.urlold = self.driver.current_url
        old_window = self.driver.current_window_handle
        print("urlold=", self.urlold)

        # key = "//span[contains(text(),上传APK)]"
        key = "//span[text()='上传APK']"
        item = webcmd.Find(key, True)

        webcmd.AddCmd(CmdType.CLICK_Action, key)
        webcmd.Run(True)

        key = "//span[text()='确 定']"
        webcmd.AddCmd(CmdType.CLICK_Action, key)
        webcmd.Run(True)

        # key =  "//div[@class='container--form upload-apk-wrapper old-style']"
        # item = webcmd.Find(key)
        # key = ".//button[@class='btn--edit ant-btn ant-btn-primary']"
        # subitem = webcmd.FindChild(item,key)
        # webcmd.DoCmd(subitem,CmdType.CLICK)

        # # <a data-toggle="modal" data-target=".confirm-upload-apk" class="btn btn-primary">上传APK</a>
        # # item = self.driver.find_element(
        # #     By.XPATH, "//a[@data-target='.confirm-upload-apk']")
        # # # item = self.driver.find_element(By.XPATH, "//a[@data-toggle='modal']")
        # # item.click()
        # time.sleep(2)

        # # <a id="selectfiles" href="javascript:void(0);" class="btn btn-primary" style="position: relative; z-index: 1;">开始上传APK</a>
        # item = self.driver.find_element(By.XPATH, "//a[@id='selectfiles']")
        # item.click()
        # time.sleep(2)

        # 手动点击上传
        # webcmd.WaitKeyBoard("q")
        apk = mainResource.GetOutPutApkPathWin32(
            mainResource.GetProjectOutPut(), Source.TAPTAP, isHD)
        if not os.path.exists(apk):
            apk = mainResource.GetOutPutApkPathWin32(
                mainResource.GetProjectOutPut(), Source.HUAWEI, isHD)

        if Platform.isMacSystem():
            apk = FileUtil.GetLastDirofDir(apk)

        # F:\\sourcecode\\unity\\product\\kidsgame\\ProjectOutPut\\xiehanzi\\hanziyuan\\screenshot\\shu\\cn\\480p\\1.jpg
        self.OpenFileBrowser(apk, True)
        time.sleep(1)

        # 等待文件長傳結束
        key = "//a[@title='基础信息']"
        item = webcmd.Find(key, True)
示例#15
0
    def SetText(self, key, title):
        webcmd = WebDriverCmd(self.driver)
        if Platform.isWindowsSystem():
            pyperclip.copy(title)
            pyperclip.paste()
            webcmd.AddCmd2(CmdType.CLICK_Action, key)
            webcmd.AddCmd2(CmdType.CTR_V, key)
        else:
            webcmd.AddCmd(CmdType.INPUT, key, title)

        webcmd.Run(True)
示例#16
0
    def GetProjectName(self):
        #  F:\sourcecode\unity\product\kidsgame
        path = self.cmdPath
        # print("GetProjectName path=",path)
        key = "/product/"
        if Platform.isWindowsSystem():
            key = "\\product\\"
        idx = path.find(key) + len(key)
        name = path[idx:]
        # print("GetProjectName name=",name)
        key = "/"
        if Platform.isWindowsSystem():
            key = "\\"
        idx = name.find(key)
        name = name[0:idx]
        # path = getLastDirofDir(path)
        # path = getLastDirofDir(path)
        # name = getDirNameofPath(path)
        # print("GetProjectName,name = "+name)

        # print("GetProjectName name=",name)
        return name
示例#17
0
    def CopyXcodeProject(self,isDel):
    #copy共享目录
        if not Platform.IsVMWare():
            return

        self.ZipProject()

        dirsrc = mainResource.GetRootDirXcodeNormal()+ ".zip" 
        dirdst = mainResource.GetRootDirXcodeUser()+ ".zip" 
        flag = os.path.exists(dirsrc)
        if flag:  
            shutil.copyfile(dirsrc,dirdst)
        
        self.UnZipProject()
示例#18
0
    def Run(stros):
        # 0f6 2f1
        UNITYPATH = ""
        if Platform.isWindowsSystem():
            UNITYPATH = "E:/Unity/" + Source.UNITY_VERSION_WIN + "/Editor/Unity.exe"
            UNITYPATH = "CocosCreator.exe"
        else:
            # UNITYPATH="/Applications/Unity/Hub/Editor/"+Source.UNITY_VERSION_MAC+"/Unity.app/Contents/MacOS/Unity"
            UNITYPATH = "/Applications/CocosCreator/Creator/3.0.0/CocosCreator.app/Contents/MacOS/CocosCreator"
            #  --project projectPath--build "platform=web-desktop;debug=true"

        PROJECT_PATH = mainResource.GetRootProjectUnity()

        methond = ""
        if stros == Source.ANDROID:
            methond = "BuildPlayer.PerformAndroidBuild"
        if stros == Source.IOS:
            methond = "BuildPlayer.PerformiPhoneBuild"
        if stros == Source.ScreenShot:
            methond = "BuildPlayer.ScreenshotBuild"

        print("unity_build  start stros=", stros)
        # cmd = UNITYPATH+" -quit "+" -batchmode "+" -projectPath "+PROJECT_PATH+" -executeMethod  "+methond
        cmd = UNITYPATH + " --project" + PROJECT_PATH + "--build" + "\"platform=web-desktop;debug=true\""
        # ps = subprocess.Popen(cmd)
        # ps.wait()#让程序阻塞
        os.system(cmd)
        print("unity_build  end")

        if stros == Source.ScreenShot:
            if Platform.isWindowsSystem():
                cmd = mainResource.GetDirProduct() + "/bin/game.exe"
            if Platform.isMacSystem():
                cmd = "open " + mainResource.GetDirProduct() + "/bin/game.app"

            os.system(cmd)
示例#19
0
    def GetOutPutIconPathWin32(self, rootdir, channel, isHd):
        gameType = self.getGameType()
        gameName = self.getGameName()
        # GetProjectOutPut
        dirapk = rootdir + "\\" + gameType + "\\" + gameName
        if isHd == True:
            dirapk += "\\iconhd"
        else:
            dirapk += "\\icon"

        path = os.path.normpath(dirapk)
        if Platform.isMacSystem():
            path = path.replace("\\", "/")

        return path
示例#20
0
    def UploadIcon(self, webcmd, isHD, lan):
        # bug 上传图片之前先要重新选择语言 不然无法弹出文件浏览器
        # self.SelectLanguage(webcmd,lan)
        # icon
        # <input type="file" name="image" data-valid-width="512" data-valid-height="512" data-taptap-ajax="upload" data-target="#icon-zh_CN" data-target-input="#icon-input-zh_CN" data-url="https://www.taptap.com/ajax/image">
        # "//input[@type='file' and @data-target='#icon-zh_CN']"
        key = "//div[@id='submitApp_translations.zh_CN.icon']"
        if lan == self.LAN_KEY_EN:
            key = "//div[@id='submitApp_translations.en_US.icon']"

            # key ="//img[@id='icon-" +   lanKeys[lan]+"']"
            # key = "//input[@type='file' and  @name='image']"
            # key = "//span[@class='fileinput-button fixed-size square icon']"

            # "//input[@name='anti_addiction_read']"
        print(key)
        item_root = webcmd.Find(key)

        key = ".//div[@class='ant-upload-drag-container']"
        item_div = webcmd.FindChild(item_root, key)

        # item = self.driver.find_element(By.XPATH, key)
        # item_div = webcmd.AddCmd2(CmdType.CLICK_Action, key)
        self.SetItemVisible(item_div)
        webcmd.DoCmd(item_div, CmdType.CLICK)
        # webcmd.Run(True)
        # self.driver.execute_script("arguments[0].click();", item)
        time.sleep(2)

        icon = mainResource.GetOutPutIconPathWin32(
            mainResource.GetProjectOutPut(), Source.TAPTAP,
            isHD) + "\\icon_android_512.png"
        print(icon)
        if Platform.isMacSystem():
            icon = icon.replace("\\", "/")
            icon = FileUtil.GetLastDirofDir(icon)
            test = 0

            # webcmd.Run(True)
        self.OpenFileBrowser(icon, True)
        time.sleep(1)

        # 等待上传完成
        key = ".//span[@class='upload_img']"
        # print(key)
        item = webcmd.FindChild(item_div, key, True)
示例#21
0
    def GetOutPutApkPathWin32(self, rootdir, channel, isHd):
        gameType = self.getGameType()
        gameName = self.getGameName()
        # GetProjectOutPut
        dirapk = rootdir + "\\" + gameType + "\\" + gameName + "\\apk"
        if isHd == True:
            dirapk += "\\heng"
            gameName += "_hd"
        else:
            dirapk += "\\shu"

        path = dirapk + "\\" + gameType + "_" + gameName + "_" + channel + ".apk"
        path = os.path.normpath(path)
        if Platform.isMacSystem():
            path = path.replace("\\", "/")

        return path
示例#22
0
    def Run(self, isHD):
        strFile = "app.itmsp"
        if isHD:
            strFile = "app_pad.itmsp"

        if Platform.isWindowsSystem():
            strCmd = " "
        else:
            if mainIPABuild.IsXcode10():
                strCmd = "/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/itms/bin/iTMSTransporter -m upload -u " + Source.APPSTORE_USER + " -p " + Source.APPSTORE_PASSWORD + "  -v eXtreme -f " + mainResource.GetProjectConfigApp(
                ) + "/appstore/ios/" + strFile
            else:
                #xcode 11: 手动更新Transporter组件(java)方法: https://www.lagou.com/lgeduarticle/94642.html
                strCmd = "/Applications/Transporter.app/Contents/itms/bin/iTMSTransporter -m upload -u " + Source.APPSTORE_USER + " -p " + Source.APPSTORE_PASSWORD + "  -v eXtreme -f " + mainResource.GetProjectConfigApp(
                ) + "/appstore/ios/" + strFile
        os.system(strCmd)

        print("appstore_upload_ios sucess")
示例#23
0
    def zipDir(dir_path, file_zip):

        zipf = zipfile.ZipFile(file_zip, "w", zipfile.ZIP_DEFLATED)
        # 压缩目录
        pre_len = len(os.path.dirname(dir_path))
        for parent, dirnames, filenames in os.walk(dir_path):
            for filename in filenames:
                pathfile = os.path.join(parent, filename)
                # print(pathfile)
                arcname = pathfile[pre_len:].strip(os.path.sep)  # 相对路径
                if Platform.isWindowsSystem():
                    # python3
                    arcname = arcname.replace("//", "")

                # print(arcname)
                zipf.write(pathfile, arcname)

        zipf.close()
示例#24
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
示例#25
0
    def BuildApk(self):
        if Platform.isWindowsSystem():
            # dir1 = "C:\Program Files\Android\Android Studio\gradle"
            dir2 = "C:/moon/gradle/gradle-4.10.1"
            flag = os.path.exists(dir2)
            if not flag:
                # shutil.copytree(dir1,dir2)
                dir2 = "E:/Program Files/Android/Android Studio/gradle/gradle-4.10.1"
                flag = os.path.exists(dir2)
                if not flag:
                    # aliyun
                    dir2 = "C:/Program Files/Unity/Hub/Editor/" + source.UNITY_VERSION_WIN + "/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/gradle"

            os.system(dir2 + "/bin/gradle assembleRelease")
        else:
            dir2 = "/Users/moon/sourcecode/gradle/gradle-4.10.1/bin"
            flag = os.path.exists(dir2)
            if flag:
                # os.system("chmod 777 "+dir2+"/gradle")
                os.system(dir2 + "/gradle assembleRelease")
            else:
                os.system("gradle assembleRelease")
示例#26
0
    def WaitKeyBoard(self, key_press):
        # text = pyautogui.confirm('这个消息弹窗是文字+OK+Cancel按钮')
        # print(text)
        # return
        if Platform.isMacSystem():
            self.isMouseClick = False
            with pynput.mouse.Listener(on_click=self.on_click) as listener:
                listener.join()

            while not self.isMouseClick:  #making a loop
                time.sleep(1)
                print('waiting for Mouse Middle Click = ')
        else:
            while True:  #making a loop
                time.sleep(1)
                print('waiting for key press = ', key_press)
                # try:
                if keyboard.is_pressed(key_press):
                    print('You Pressed A Key!')
                    break

                k = PyKeyboard()
示例#27
0
 def GetPython(self):
     python = "python"
     if Platform.isMacSystem():
         python = "python3"
     
     return python
示例#28
0
 def OpenFile(path, isAutoClick):
     if Platform.isWindowsSystem():
         FileBrowser.OpenFileWindow(path, isAutoClick)
     if Platform.isMacSystem():
         FileBrowser.OpenFileMac(path, isAutoClick)
示例#29
0
    def GetRootDirXcode(self):
        if Platform.IsVMWare():
            return self.GetRootDirXcodeUser()

        return self.GetRootDirXcodeNormal()
示例#30
0
 def GetRootProjectIos(self):
     if Platform.IsVMWare():
         return self.GetRootProjectIosUser()
     return self.GetRootProjectIosNormal()