def ScanPrefabFile(self, dir, filejson): if not os.path.exists(dir): return listFile = [] dirsave = FileUtil.GetLastDirofDir(filejson) FileUtil.CreateDir((dirsave)) FileUtil.GetFileList(dir, "prefab", listFile) dataRoot = json.loads("{}") # "BtnIconPlay" : { # "path" : "App/UI/Common/Button/BtnIconPlay.png" # }, for fileimage in listFile: # item= json.loads("{}") filepath = fileimage.replace( mainResource.GetRootUnityAssets() + "/", "") # item["path"]=filepath name = FileUtil.GetPathNameWithoutExt(fileimage) dataRoot[name] = filepath json_str = json.dumps(dataRoot, ensure_ascii=False, indent=4, sort_keys=True) FileUtil.SaveString2File(json_str, filejson)
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)
def MakeCodeDoc(self, isHd): title = mainAppInfo.GetAppName(Source.ANDROID, isHd, Source.LANGUAGE_CN) + "V1.0.0" codedir = "/Users/moon/sourcecode/LearnWord" codedir = mainResource.GetRootUnityAssets( ) + "/Script/Apps/" + mainResource.getGameType() # codedir = mainResource.GetRootUnityAssets()+"/Script/Apps/"+mainResource.getGameType()+"/Base" outputdir = mainResource.GetProjectOutPutApp() FileUtil.CreateDir(outputdir) docoutput = outputdir + "/" + mainResource.getGameType() + ".docx" if isHd: docoutput = outputdir + "/" + mainResource.getGameType( ) + "_HD.docx" os.system("pyerz -e cs -i " + codedir + " -o " + docoutput + " -t " + title) self.WordToPdf(docoutput)
def MakeGuideDoc(self, isHd): title = mainAppInfo.GetAppName(Source.ANDROID, isHd, Source.LANGUAGE_CN) + "V1.0.0" detail = mainAppInfo.GetAppDetail(isHd, Source.LANGUAGE_CN) # detail +="/n" detail += mainAppInfo.GetAppDetail(isHd, Source.LANGUAGE_EN) outputdir = mainResource.GetProjectOutPutApp() FileUtil.CreateDir(outputdir) docoutput = outputdir + "/" + mainResource.getGameType( ) + "_guide.docx" dirscreenshot = mainResource.GetProjectOutPutApp( ) + "/screenshot/shu/cn/1080p" filedetail = mainResource.GetProjectConfigApp( ) + "/appinfo/app_description.xml" if isHd: dirscreenshot = mainResource.GetProjectOutPutApp( ) + "/screenshot/heng/cn/1080p" filedetail = mainResource.GetProjectConfigApp( ) + "/appinfo/app_description_hd.xml" docoutput = outputdir + "/" + mainResource.getGameType( ) + "_guide_hd.docx" filedst = dirscreenshot + "/detail.xml" FileUtil.SaveString2File(detail, filedst) # FileUtil.CopyFile(filedetail,filedst) cmd = "pyerz -e xml -i " + dirscreenshot + " -o " + docoutput + " -t " + title + " --font-size 16 --space-before 2 --space-after 10 --line-spacing 16 " # print("cmd=",cmd) for i in range(5): pic = dirscreenshot + "/" + str(i + 1) + ".jpg" if os.path.exists(pic): cmd += " -pic " + pic os.system(cmd) os.remove(filedst) self.WordToPdf(docoutput)