def onOkClicked(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") channel.set("appId", unicode(self.lineEdit.text())) channel.set("appKey", unicode(self.lineEdit_2.text())) channel.set("resVersion", unicode(self.lineEdit_15.text())) #平台信息 platform = root.find("platform") platform.set("gameId", unicode(self.lineEdit_9.text())) platform.set("platformId", unicode(self.lineEdit_10.text())) platform.set("appVersion", unicode(self.lineEdit_12.text())) platform.set("platformType", unicode(self.lineEdit_13.text())) platform.set("datacenter", unicode(self.lineEdit_14.text())) app = root.find("app") app.set("packageName", unicode(self.lineEdit_11.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "WWS_CHANNEL": child.set(value, unicode(self.lineEdit_3.text())) configTree.write(file_operate.getForManifestXmlPath(), "utf-8") except Exception,e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def onOkClicked(self): try: #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "PA_APP_KEY": child.set(value, unicode(self.appkey.text())) elif child.attrib[key] == "PA_APP_PRIVATE_KEY": child.set(value, unicode(self.privatekey.text())) configTree.write(file_operate.getForManifestXmlPath(), "utf-8") #渠道信息 config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #平台信息 platform = root.find("platform") platform.set("gameId", unicode(self.gameId.text())) platform.set("platformId", unicode(self.platformId.text())) platform.set("appVersion", unicode(self.appVersion.text())) platform.set("platformType", unicode(self.platformType.text())) platform.set("datacenter", unicode(self.datacenter.text())) app = root.find("app") app.set("packageName", unicode(self.packageName.text())) channel = root.find("channel") channel.set("appkey", unicode(self.appkey.text())) channel.set("privatekey", unicode(self.privatekey.text())) channel.set("gamename", unicode(self.gamename.text())) channel.set("resVersion", unicode(self.resVersion.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def initDialog(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") self.lineEdit.setText(channel.get("clientId")) self.lineEdit_2.setText(channel.get("channelId")) #read form ForManifest.xml ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "UMENG_APPKEY": self.lineEdit_3.setText(child.attrib[value]) elif child.attrib[key] == "UMENG_CHANNEL": self.lineEdit_4.setText(child.attrib[value]) except Exception, e: print e print "Error: cannot parse file: config.xml." return -1
def initDialog(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") self.lineEdit_2.setText(channel.get("gameId")) self.lineEdit_3.setText(channel.get("appKey")) self.lineEdit_4.setText(channel.get("appSecret")) orienIndex = self.comboBox.findText( channel.get("isOrientationPort")) if orienIndex == -1: self.comboBox.setCurrentIndex(0) else: self.comboBox.setCurrentIndex(orienIndex) orienIndex = self.comboBox.findText(channel.get("isDebugModel")) if orienIndex == -1: self.comboBox.setCurrentIndex(0) else: self.comboBox.setCurrentIndex(orienIndex) if channel.get("resVersion") != None: self.lineEdit_10.setText(channel.get("resVersion")) else: self.lineEdit_10.setText("") #平台信息 platform = root.find("platform") self.lineEdit_5.setText(platform.get("gameId")) self.lineEdit_6.setText(platform.get("platformId")) self.lineEdit_7.setText(platform.get("appVersion")) self.lineEdit_8.setText(platform.get("platformType")) self.lineEdit_9.setText(platform.get("datacenter")) app = root.find("app") self.lineEdit_11.setText(app.get("packageName")) #read form ForManifest.xml ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "CHINA_UNICOM_MOBILE_CHANNEL": self.lineEdit.setText(child.attrib[value]) except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def initDialog(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") self.lineEdit.setText(channel.get("gameId")) if channel.get("resVersion") != None: self.lineEdit_10.setText(channel.get("resVersion")) else: self.lineEdit_10.setText("") #平台信息 platform = root.find("platform") self.lineEdit_5.setText(platform.get("gameId")) self.lineEdit_6.setText(platform.get("platformId")) self.lineEdit_7.setText(platform.get("appVersion")) self.lineEdit_8.setText(platform.get("platformType")) self.lineEdit_9.setText(platform.get("datacenter")) app = root.find("app") self.lineEdit_11.setText(app.get("packageName")) #read form ForManifest.xml ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "BaiduMobAd_CHANNEL": self.lineEdit_3.setText(child.attrib[value]) elif child.attrib[key] == "BaiduMobAd_STAT_ID": self.lineEdit_4.setText(child.attrib[value]) #read pid from res/raw/manifest.txt fileName = file_operate.getFullPath( constant.sdkRelatePath + ConfigParse.shareInstance().getChannelName() + "/ForRes/raw/manifest.txt") f = open(fileName, "r") lines = f.read() #读取全部内容 print lines import json hJson = json.loads(lines) self.lineEdit_2.setText(hJson["pid"]) except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def initDialog(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") self.lineEdit.setText(channel.get("gameName")) self.comboBox.setCurrentIndex( self.comboBox.findText(channel.get("isLandscape"))) self.comboBox_2.setCurrentIndex( self.comboBox_2.findText(channel.get("isTransparent"))) self.lineEdit_4.setText(channel.get("exchangeRate")) if channel.get("resVersion") != None: self.lineEdit_15.setText(channel.get("resVersion")) else: self.lineEdit_15.setText("") #平台信息 platform = root.find("platform") self.lineEdit_9.setText(platform.get("gameId")) self.lineEdit_10.setText(platform.get("platformId")) self.lineEdit_12.setText(platform.get("appVersion")) self.lineEdit_13.setText(platform.get("platformType")) self.lineEdit_14.setText(platform.get("datacenter")) app = root.find("app") self.lineEdit_11.setText(app.get("packageName")) #read form ForManifest.xml ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "QHOPENSDK_APPID": self.lineEdit_5.setText(child.attrib[value]) elif child.attrib[key] == "QHOPENSDK_APPKEY": self.lineEdit_6.setText(child.attrib[value]) elif child.attrib[key] == "QHOPENSDK_WEIXIN_APPID": self.lineEdit_8.setText(child.attrib[value]) #界面 config = ET.parse(file_operate.getUIConfigXmlPath()) root = config.getroot() channel = root.find("channel") self.lineEdit_7.setText(channel.get("appSecret")) except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def initDialog(self): try: #read form ForManifest.xml ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "app_id": self.lineEdit_3.setText(child.attrib[value]) elif child.attrib[key] == "data_key": self.lineEdit_4.setText(child.attrib[value]) elif child.attrib[key] == "channel": self.lineEdit.setText(child.attrib[value]) #渠道信息 config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #平台信息 platform = root.find("platform") self.lineEdit_5.setText(platform.get("gameId")) self.lineEdit_6.setText(platform.get("platformId")) self.lineEdit_7.setText(platform.get("appVersion")) self.lineEdit_8.setText(platform.get("platformType")) self.lineEdit_9.setText(platform.get("datacenter")) app = root.find("app") self.lineEdit_11.setText(app.get("packageName")) channel = root.find("channel") self.lineEdit_3.setText(channel.get("appId")) self.lineEdit_4.setText(channel.get("data_key")) self.lineEdit.setText(channel.get("channel")) self.lineEdit_2.setText(channel.get("secureKey")) self.lineEdit_12.setText(channel.get("aipai_gameid")) self.lineEdit_13.setText(channel.get("aipai_apk_channel")) self.lineEdit_14.setText(channel.get("aipai_sns")) self.lineEdit_15.setText(channel.get("game_activity")) if channel.get("resVersion") != None: self.lineEdit_10.setText(channel.get("resVersion")) else: self.lineEdit_10.setText("") except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def onOkClicked(self): try: #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "WWS_CHANNEL": child.set(value, unicode(self.lineEdit.text())) configTree.write(file_operate.getForManifestXmlPath(), "utf-8") except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def initDialog(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") self.appSecret.setText(channel.get("appSecret")) if channel.get("resVersion") != None: self.resVersion.setText(channel.get("resVersion")) else: self.resVersion.setText("") #平台信息 platform = root.find("platform") self.gameId.setText(platform.get("gameId")) self.platformId.setText(platform.get("platformId")) self.appVersion.setText(platform.get("appVersion")) self.platformType.setText(platform.get("platformType")) self.datacenter.setText(platform.get("datacenter")) app = root.find("app") self.packageName.setText(app.get("packageName")) #read form ForManifest.xml ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "ANQUSDK_CPUIN": self.ANQUSDK_CPUIN.setText(child.attrib[value]) elif child.attrib[key] == "ANQUSDK_APPID": self.ANQUSDK_APPID.setText(child.attrib[value]) elif child.attrib[key] == "ANQUSDK_APPKEY": self.ANQUSDK_APPKEY.setText(child.attrib[value]) elif child.attrib[key] == "ANQUSDK_CHANNEL": self.ANQUSDK_CHANNEL.setText(child.attrib[value]) except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def onOkClicked(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") channel.set("clientId", unicode(self.lineEdit.text())) channel.set("channelId", unicode(self.lineEdit_2.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "UMENG_APPKEY": child.set(value, unicode(self.lineEdit_3.text())) elif child.attrib[key] == "UMENG_CHANNEL": child.set(value, unicode(self.lineEdit_4.text())) configTree.write(file_operate.getForManifestXmlPath(), "utf-8") except Exception, e: print e print "Error: cannot parse file: config.xml." return -1
def initDialog(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() channel = root.find("channel") if channel.get("resVersion") != None: self.lineEdit_12.setText(channel.get("resVersion")) else: self.lineEdit_12.setText("") #平台信息 platform = root.find("platform") self.lineEdit_6.setText(platform.get("gameId")) self.lineEdit_7.setText(platform.get("platformId")) self.lineEdit_8.setText(platform.get("appVersion")) self.lineEdit_9.setText(platform.get("platformType")) self.lineEdit_10.setText(platform.get("datacenter")) app = root.find("app") self.lineEdit_11.setText(app.get("packageName")) #read form ForManifest.xml ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "XMGAME_CHANNEL_CODE": self.lineEdit_2.setText(child.attrib[value]) elif child.attrib[key] == "XMGAME_PRODUCT_CODE": self.lineEdit_3.setText(child.attrib[value]) except Exception, e: print e print "Error: cannot parse file: 360 config.xml." return -1
def initDialog(self): try: #read form ForManifest.xml ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "WWS_CHANNEL": self.lineEdit.setText(child.attrib[value]) except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def onOkClicked(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") channel.set("appId", unicode(self.lineEdit.text())) channel.set("appKey", unicode(self.lineEdit_2.text())) channel.set("waresId", unicode(self.lineEdit_3.text())) channel.set("resVersion", unicode(self.lineEdit_10.text())) #平台信息 platform = root.find("platform") platform.set("gameId", unicode(self.lineEdit_5.text())) platform.set("platformId", unicode(self.lineEdit_6.text())) platform.set("appVersion", unicode(self.lineEdit_7.text())) platform.set("platformType", unicode(self.lineEdit_8.text())) platform.set("datacenter", unicode(self.lineEdit_9.text())) app = root.find("app") app.set("packageName", unicode(self.lineEdit_11.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "com.baidu.lbsapi.API_KEY": child.set(value, unicode(self.lineEdit_4.text())) elif child.attrib[key] == "lenovo.open.appid": child.set(value, unicode(self.lineEdit.text())) receiverList = applicationCfg.findall("receiver") for child in receiverList: if child.attrib[ key] == "com.lenovo.lsf.gamesdk.receiver.GameSdkReceiver": intentfilterNode = child.find("intent-filter") if not intentfilterNode is None: actionList = intentfilterNode.findall("action") for actionNode in actionList: if actionNode.attrib[ key] != "com.lenovo.lsf.gamesdk.receiver.GameSdkReceiver": actionNode.set(key, unicode(self.lineEdit.text())) configTree.write(file_operate.getForManifestXmlPath(), "utf-8") except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
"/ForRes/values/values.xml")) valuesConfigRoot = valuesConfig.getroot() stringNodeList = valuesConfigRoot.findall("string") for stringNode in stringNodeList: if stringNode.attrib['name'] == "gamexdd_fb_app_id": stringNode.text = unicode(self.facebookid.text()) valuesConfig.write( file_operate.getFullPath( constant.sdkRelatePath + ConfigParse.shareInstance().getChannelName() + "/ForRes/values/values.xml"), "utf-8") #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' authorities = '{' + constant.androidNS + '}authorities' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return providerList = applicationCfg.findall("provider") for provider in providerList: if provider.attrib[ key] == "com.facebook.FacebookContentProvider": provider.set( authorities, 'com.facebook.app.FacebookContentProvider' +
def onOkClicked(self): try: #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) #渠道信息 config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #平台信息 platform = root.find("platform") platform.set("gameId", unicode(self.gameId.text())) platform.set("platformId", unicode(self.platformId.text())) platform.set("appVersion", unicode(self.appVersion.text())) platform.set("platformType", unicode(self.platformType.text())) platform.set("datacenter", unicode(self.datacenter.text())) app = root.find("app") app.set("packageName", unicode(self.packageName.text())) channel = root.find("channel") channel.set("qqAppId", unicode(self.qqappid.text())) channel.set("wxAppId", unicode(self.wxappid.text())) channel.set("appKey", unicode(self.qqAppkey.text())) channel.set("wxAppKey", unicode(self.wxAppkey.text())) channel.set("offerId", unicode(self.offerid.text())) channel.set("isRelease", unicode(self.comboBox.currentText())) channel.set("resVersion", unicode(self.resVersion.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") doc = minidom.parse(file_operate.getForManifestXmlPath()) rootNode = doc.documentElement applicationList = rootNode.getElementsByTagName('applicationCfg') for applicationNode in applicationList: activityList = applicationNode.getElementsByTagName('activity') pattern = re.compile(".+\.wxapi\.WXEntryActivity$") patternAuthActivity = re.compile( "com.tencent.tauth.AuthActivity") for activityNode in activityList: if pattern.match( activityNode.getAttribute('android:name')): activityNode.setAttribute( 'android:name', unicode(self.packageName.text()) + '.wxapi.WXEntryActivity') activityNode.setAttribute( 'android:taskAffinity', unicode(self.packageName.text()) + '.diff') intentfilterList = activityNode.getElementsByTagName( 'intent-filter') for intentfilterNode in intentfilterList: dataList = intentfilterNode.getElementsByTagName( 'data') for dataNode in dataList: dataNode.setAttribute( 'android:scheme', unicode(self.wxappid.text())) elif patternAuthActivity.match( activityNode.getAttribute('android:name')): intentfilterList = activityNode.getElementsByTagName( 'intent-filter') for intentfilterNode in intentfilterList: dataList = intentfilterNode.getElementsByTagName( 'data') for dataNode in dataList: dataNode.setAttribute( 'android:scheme', 'tencent' + unicode(self.qqappid.text())) f = codecs.open(file_operate.getForManifestXmlPath(), 'w', 'utf-8') doc.writexml(f, encoding='utf-8') f.close() #modify assets ysdkconfig.ini configiniPath = file_operate.getFullPath( constant.sdkRelatePath + ConfigParse.shareInstance().getChannelName() + "/ForAssets/ysdkconf.ini") ysdk = codecs.open(configiniPath, 'w') if self.comboBox.currentText() == "debug": ysdkUrl = "YSDK_URL=https://ysdktest.qq.com" else: ysdkUrl = "YSDK_URL=https://ysdk.qq.com" configInfo = "" configInfo += ysdkUrl + '\n' configInfo += "QQ_APP_ID=%s" % self.qqappid.text() + '\n' configInfo += "WX_APP_ID=%s" % self.wxappid.text() + '\n' configInfo += "OFFER_ID=%s" % self.offerid.text() + '\n' ysdk.write(configInfo) ysdk.flush() ysdk.close() except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def onOkClicked(self): try: #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) doc = minidom.parse(file_operate.getForManifestXmlPath()) rootNode = doc.documentElement applicationList = rootNode.getElementsByTagName('applicationCfg') for applicationNode in applicationList: receiverList = applicationNode.getElementsByTagName('receiver') for receiverNode in receiverList: if receiverNode.getAttribute( 'android:name' ) == 'com.valuepotion.sdk.push.GcmBroadcastReceiver': intentfilterList = receiverNode.getElementsByTagName( 'intent-filter') for intentfilterNode in intentfilterList: categoryList = intentfilterNode.getElementsByTagName( 'category') for categoryNode in categoryList: categoryNode.setAttribute( 'android:name', unicode(self.packageName.text())) permissionList = rootNode.getElementsByTagName('permissionCfg') for permissionNode in permissionList: pattern = re.compile(".+\.permission\.C2D_MESSAGE") uses_permissionList = permissionNode.getElementsByTagName( 'uses-permission') for uses_permissionNode in uses_permissionList: if pattern.match( uses_permissionNode.getAttribute('android:name')): uses_permissionNode.setAttribute( 'android:name', unicode(self.packageName.text()) + '.permission.C2D_MESSAGE') permissionlist = permissionNode.getElementsByTagName( 'permission') for permissionnode in permissionlist: if pattern.match( permissionnode.getAttribute('android:name')): permissionnode.setAttribute( 'android:name', unicode(self.packageName.text()) + '.permission.C2D_MESSAGE') f = codecs.open(file_operate.getForManifestXmlPath(), 'w', 'utf-8') doc.writexml(f, encoding='utf-8') f.close() #渠道信息 config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #平台信息 platform = root.find("platform") platform.set("gameId", unicode(self.gameId.text())) platform.set("platformId", unicode(self.platformId.text())) platform.set("appVersion", unicode(self.appVersion.text())) platform.set("platformType", unicode(self.platformType.text())) platform.set("datacenter", unicode(self.datacenter.text())) app = root.find("app") app.set("packageName", unicode(self.packageName.text())) channel = root.find("channel") channel.set("appId", unicode(self.appId.text())) channel.set("appKey", unicode(self.appKey.text())) channel.set("funcellKey", unicode(self.funcellKey_2.text())) channel.set("facebook_app_id", unicode(self.facebook_app_id.text())) channel.set("googleGameAppId", unicode(self.googleGameAppId.text())) channel.set("base64PublicKey", unicode(self.base64PublicKey.text())) channel.set("igaworks_app_key", unicode(self.igaworks_app_key.text())) channel.set("igaworks_hash_key", unicode(self.igaworks_hash_key.text())) channel.set("resVersion", unicode(self.resVersion.text())) if self.molTestModeRadio.isChecked(): channel.set("molTestMode", "true") if self.molReleaseModeRadio.isChecked(): channel.set("molTestMode", "false") channel.set("molSecretKey", unicode(self.molSecretKeyEdit.text())) channel.set("molApplicationCode", unicode(self.molApplicationCodeEdit.text())) #valuepotion 数据统计SDK if self.isValuePotion.isChecked(): channel.set("isValuePotion", "true") else: channel.set("isValuePotion", "false") channel.set("valuePotionClientId", unicode(self.valuePotionClientId.text())) channel.set("valuePotionSecretKey", unicode(self.valuePotionSecretKey.text())) channel.set("gcmProjectNumber", unicode(self.gcmProjectNumber.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def onOkClicked(self): try: #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) doc = minidom.parse(file_operate.getForManifestXmlPath()) rootNode = doc.documentElement applicationList = rootNode.getElementsByTagName('applicationCfg') for applicationNode in applicationList: receiverList = applicationNode.getElementsByTagName('receiver') for receiverNode in receiverList: if receiverNode.getAttribute( 'android:name' ) == 'com.igaworks.liveops.pushservice.LiveOpsGCMBroadcastReceiver': intentfilterList = receiverNode.getElementsByTagName( 'intent-filter') for intentfilterNode in intentfilterList: categoryList = intentfilterNode.getElementsByTagName( 'category') for categoryNode in categoryList: categoryNode.setAttribute( 'android:name', unicode(self.packageName.text())) elif receiverNode.getAttribute( 'android:name' ) == 'com.igaworks.liveops.pushservice.LiveOpsReceiver': receiverNode.setAttribute( 'android:permission', unicode(self.packageName.text()) + '.permission.C2D_MESSAGE') permissionList = rootNode.getElementsByTagName('permissionCfg') for permissionNode in permissionList: pattern = re.compile(".+\.permission\.C2D_MESSAGE") uses_permissionList = permissionNode.getElementsByTagName( 'uses-permission') for uses_permissionNode in uses_permissionList: if pattern.match( uses_permissionNode.getAttribute('android:name')): uses_permissionNode.setAttribute( 'android:name', unicode(self.packageName.text()) + '.permission.C2D_MESSAGE') permissionlist = permissionNode.getElementsByTagName( 'permission') for permissionnode in permissionlist: if pattern.match( permissionnode.getAttribute('android:name')): permissionnode.setAttribute( 'android:name', unicode(self.packageName.text()) + '.permission.C2D_MESSAGE') f = codecs.open(file_operate.getForManifestXmlPath(), 'w', 'utf-8') doc.writexml(f, encoding='utf-8') f.close() #渠道信息 config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #平台信息 platform = root.find("platform") platform.set("gameId", unicode(self.gameId.text())) platform.set("platformId", unicode(self.platformId.text())) platform.set("appVersion", unicode(self.appVersion.text())) platform.set("platformType", unicode(self.platformType.text())) platform.set("datacenter", unicode(self.datacenter.text())) app = root.find("app") app.set("packageName", unicode(self.packageName.text())) channel = root.find("channel") channel.set("appId", unicode(self.appId.text())) channel.set("appKey", unicode(self.appKey.text())) channel.set("funcellKey", unicode(self.funcellKey_2.text())) channel.set("facebook_app_id", unicode(self.facebook_app_id.text())) channel.set("tstore_appid", unicode(self.tstore_appid.text())) channel.set("igaworks_app_key", unicode(self.igaworks_app_key.text())) channel.set("igaworks_hash_key", unicode(self.igaworks_hash_key.text())) channel.set("isRelease", unicode(self.comboBox.currentText())) channel.set("resVersion", unicode(self.resVersion.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def onOkClicked(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") channel.set("twitter_consumer_key", unicode(self.twitter_consumer_key.text())) channel.set("twitter_consumer_secret", unicode(self.twitter_consumer_secret.text())) channel.set("facebook_app_id", unicode(self.facebook_app_id.text())) channel.set("appsflyer_dev_key", unicode(self.appsflyer_dev_key.text())) channel.set("gmo_apiKey", unicode(self.gmo_apiKey.text())) channel.set("gmo_clientId", unicode(self.gmo_clientId.text())) channel.set("crashlytics_ApiKey", unicode(self.crashlytics_ApiKey.text())) channel.set("FacebookAppLinkUrl", unicode(self.FacebookAppLinkUrl.text())) channel.set("resVersion", unicode(self.resVersion.text())) #平台信息 platform = root.find("platform") platform.set("gameId", unicode(self.gameId.text())) platform.set("platformId", unicode(self.platformId.text())) platform.set("appVersion", unicode(self.appVersion.text())) platform.set("platformType", unicode(self.platformType.text())) platform.set("datacenter", unicode(self.datacenter.text())) app = root.find("app") app.set("packageName", unicode(self.packageName.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "FacebookAppLinkUrl": child.set(value, unicode(self.FacebookAppLinkUrl.text())) elif child.attrib[key] == "com.gmo.appsflyerKey": child.set(value, unicode(self.appsflyer_dev_key.text())) configTree.write(file_operate.getForManifestXmlPath(), "utf-8") doc = minidom.parse(file_operate.getForManifestXmlPath()) rootNode = doc.documentElement applicationList = rootNode.getElementsByTagName('applicationCfg') for applicationNode in applicationList: receiverList = applicationNode.getElementsByTagName('receiver') for receiverNode in receiverList: if receiverNode.getAttribute( 'android:name' ) == 'com.gmo.gamesdk.v4.network.GCMBroadcastReceiver': intentfilterList = receiverNode.getElementsByTagName( 'intent-filter') for intentfilterNode in intentfilterList: categoryList = intentfilterNode.getElementsByTagName( 'category') for categoryNode in categoryList: categoryNode.setAttribute( 'android:name', unicode(self.packageName.text())) permissionList = rootNode.getElementsByTagName('permissionCfg') for permissionNode in permissionList: pattern = re.compile(".+\.permission\.C2D_MESSAGE") uses_permissionList = permissionNode.getElementsByTagName( 'uses-permission') for uses_permissionNode in uses_permissionList: if pattern.match( uses_permissionNode.getAttribute('android:name')): uses_permissionNode.setAttribute( 'android:name', unicode(self.packageName.text()) + '.permission.C2D_MESSAGE') permissionlist = permissionNode.getElementsByTagName( 'permission') for permissionnode in permissionlist: if pattern.match( permissionnode.getAttribute('android:name')): permissionnode.setAttribute( 'android:name', unicode(self.packageName.text()) + '.permission.C2D_MESSAGE') f = codecs.open(file_operate.getForManifestXmlPath(), 'w', 'utf-8') doc.writexml(f, encoding='utf-8') f.close() except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def onOkClicked(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") channel.set("appId", unicode(self.lineEdit.text())) channel.set("appKey", unicode(self.lineEdit_2.text())) channel.set("wxAppId", unicode(self.lineEdit_3.text())) channel.set("wxAppKey", unicode(self.lineEdit_4.text())) channel.set("isRelease", unicode(self.comboBox.currentText())) channel.set("resVersion", unicode(self.lineEdit_10.text())) channel.set("msdkKey", unicode(self.msdkKey.text())) channel.set("TA_APPKEY", unicode(self.TA_APPKEY.text())) channel.set("InstallChannel", unicode(self.InstallChannel.text())) #平台信息 platform = root.find("platform") platform.set("gameId", unicode(self.lineEdit_5.text())) platform.set("platformId", unicode(self.lineEdit_6.text())) platform.set("appVersion", unicode(self.lineEdit_7.text())) platform.set("platformType", unicode(self.lineEdit_8.text())) platform.set("datacenter", unicode(self.lineEdit_9.text())) app = root.find("app") app.set("packageName", unicode(self.lineEdit_11.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") #write appid wxappid to ForManifest doc = minidom.parse(file_operate.getForManifestXmlPath()) rootNode = doc.documentElement applicationList = rootNode.getElementsByTagName("applicationCfg") for applicationNode in applicationList: activityList = rootNode.getElementsByTagName('activity') for activityNode in activityList: if activityNode.getAttribute('android:name') == 'com.tencent.tauth.AuthActivity': dataList = activityNode.getElementsByTagName("data") for dataNode in dataList: dataNode.setAttribute('android:scheme', "tencent"+unicode(self.lineEdit.text())) metaConfigList = applicationNode.getElementsByTagName("meta-data") for child in metaConfigList: if child.getAttribute('android:name') == "TA_APPKEY": child.setAttribute('android:value', unicode(self.TA_APPKEY.text())) if child.getAttribute('android:name') == "InstallChannel": child.setAttribute('android:value', unicode(self.InstallChannel.text())) f = codecs.open(file_operate.getForManifestXmlPath(), 'w', 'utf-8') doc.writexml(f, encoding='utf-8') f.close() #modify assets msdkconfig.ini configiniPath = getFullPath(constant.sdkRelatePath + ConfigParse.shareInstance().getChannelName()+"/ForAssets/msdkconfig.ini") msdk = codecs.open(configiniPath, 'w') configInfo = 'AMS_CENTER_URL=http://apps.game.qq.com/ams/ame/gac.php?returntype=html\n' configInfo += 'MSDK_URL=' if self.comboBox.currentText() == "debug": msdkUrl = "http://msdktest.qq.com" else: msdkUrl = "http://msdk.qq.com" configInfo += msdkUrl configInfo += '\n' configInfo += 'BETA=false\n' #configInfo += 'needNotice=false\n' #configInfo += 'noticeTime=10\n' #configInfo += 'PUSH=true\n' #configInfo += 'SAVE_UPDATE=true\n' configInfo += 'localLog=3\n' configInfo += 'STAT_LOG=true\n' configInfo += 'WXTOKEN_REFRESH=true' msdk.write(configInfo) msdk.flush() msdk.close() except Exception,e: print e print "Error: cannot parse file: config.xml." return -1
def onOkClicked(self): try: #print os.path.abspath('.') config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") channel.set("gameName", unicode(self.lineEdit.text())) channel.set("isLandscape", unicode(self.comboBox.currentText())) channel.set("isTransparent", unicode(self.comboBox_2.currentText())) channel.set("exchangeRate", unicode(self.lineEdit_4.text())) channel.set("resVersion", unicode(self.lineEdit_15.text())) #平台信息 platform = root.find("platform") platform.set("gameId", unicode(self.lineEdit_9.text())) platform.set("platformId", unicode(self.lineEdit_10.text())) platform.set("appVersion", unicode(self.lineEdit_12.text())) platform.set("platformType", unicode(self.lineEdit_13.text())) platform.set("datacenter", unicode(self.lineEdit_14.text())) app = root.find("app") app.set("packageName", unicode(self.lineEdit_11.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "QHOPENSDK_APPID": child.set(value, unicode(self.lineEdit_5.text())) elif child.attrib[key] == "QHOPENSDK_APPKEY": child.set(value, unicode(self.lineEdit_6.text())) elif child.attrib[key] == "QHOPENSDK_PRIVATEKEY": tmp = self.lineEdit_7.text() + "#" + self.lineEdit_6.text() tmp = unicode(tmp.toUtf8()).lower() child.set(value, self.myMd5(tmp).lower()) elif child.attrib[key] == "QHOPENSDK_WEIXIN_APPID": child.set(value, unicode(self.lineEdit_8.text())) configTree.write(file_operate.getForManifestXmlPath(), "utf-8") #print os.path.abspath('.') config = ET.parse(file_operate.getUIConfigXmlPath()) root = config.getroot() #渠道信息 channel = root.find("channel") channel.set("appSecret", unicode(self.lineEdit_7.text())) config.write(file_operate.getUIConfigXmlPath(), "utf-8") except Exception, e: print e print "Error: cannot parse file: funcellconfig.xml." return -1
def onOkClicked(self): try: #write metadata to ForManifest ET.register_namespace('android', constant.androidNS) configTree = ET.parse(file_operate.getForManifestXmlPath()) configRoot = configTree.getroot() key = '{' + constant.androidNS + '}name' value = '{' + constant.androidNS + '}value' applicationCfg = configRoot.find("applicationCfg") if applicationCfg is None: return metaConfigList = applicationCfg.findall("meta-data") for child in metaConfigList: if child.attrib[key] == "6LOPENSDK_CHANNEL": child.set(value, unicode(self.platform.text())) configTree.write(file_operate.getForManifestXmlPath(), "utf-8") #渠道信息 config = ET.parse(file_operate.getConfigXmlPath()) root = config.getroot() #平台信息 platform = root.find("platform") platform.set("gameId", unicode(self.gameId.text())) platform.set("platformId", unicode(self.platformId.text())) platform.set("appVersion", unicode(self.appVersion.text())) platform.set("platformType", unicode(self.platformType.text())) platform.set("datacenter", unicode(self.datacenter.text())) app = root.find("app") app.set("packageName", unicode(self.packageName.text())) channel = root.find("channel") channel.set("appid", unicode(self.appid.text())) channel.set("appkey", unicode(self.appkey.text())) channel.set("privatekey", unicode(self.privatekey.text())) channel.set("platform", unicode(self.platform.text())) channel.set("qqAppId", unicode(self.qqAppId.text())) channel.set("qqAppKey", unicode(self.qqAppKey.text())) channel.set("wxAppId", unicode(self.wxAppId.text())) channel.set("msdkKey", unicode(self.msdkKey.text())) channel.set("offerId", unicode(self.offerId.text())) channel.set("paykey", unicode(self.paykey.text())) channel.set("resVersion", unicode(self.resVersion.text())) config.write(file_operate.getConfigXmlPath(), "utf-8") doc = minidom.parse(file_operate.getForManifestXmlPath()) rootNode = doc.documentElement applicationList = rootNode.getElementsByTagName('applicationCfg') for applicationNode in applicationList: activityList = applicationNode.getElementsByTagName('activity') pattern = re.compile(".+\.wxapi\.WXEntryActivity$") patternAuthActivity = re.compile("com.tencent.tauth.AuthActivity") for activityNode in activityList: if pattern.match(activityNode.getAttribute('android:name')): activityNode.setAttribute('android:name',unicode(self.packageName.text())+'.wxapi.WXEntryActivity') activityNode.setAttribute('android:taskAffinity',unicode(self.packageName.text()) + '.diff') intentfilterList = activityNode.getElementsByTagName('intent-filter') for intentfilterNode in intentfilterList: dataList = intentfilterNode.getElementsByTagName('data') for dataNode in dataList: dataNode.setAttribute('android:scheme', unicode(self.wxAppId.text())) elif patternAuthActivity.match(activityNode.getAttribute('android:name')): intentfilterList = activityNode.getElementsByTagName('intent-filter') for intentfilterNode in intentfilterList: dataList = intentfilterNode.getElementsByTagName('data') for dataNode in dataList: dataNode.setAttribute('android:scheme', 'tencent'+ unicode(self.qqAppId.text())) f = codecs.open(file_operate.getForManifestXmlPath(), 'w', 'utf-8') doc.writexml(f, encoding='utf-8') f.close() except Exception,e: print e print "Error: cannot parse file: funcellconfig.xml." return -1