Esempio n. 1
0
    def onOkClicked(self):
        try:
            #print os.path.abspath('.')
            config = ET.parse(file_operate.getConfigXmlPath())
            root = config.getroot()

            #渠道信息
            channel = root.find("channel")
            channel.set("resVersion", unicode(self.resVersion.text()))
            
            channel.set("gameKey", unicode(self.gameKey.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")
        except Exception,e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 2
0
    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("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
Esempio n. 3
0
    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("merchantId", unicode(self.lineEdit_3.text()))
            channel.set("serverSeqNum", unicode(self.lineEdit_4.text()))
            channel.set("iconLocation", unicode(self.comboBox.currentText()))
            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")

        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 4
0
    def onOkClicked(self):
        try:
            #print os.path.abspath('.')
            config = ET.parse(file_operate.getConfigXmlPath())
            root = config.getroot()

            #渠道信息
            channel = root.find("channel")
            channel.set("cpId", unicode(self.lineEdit.text()))
            channel.set("gameId", unicode(self.lineEdit_2.text()))
            channel.set("serverId", unicode(self.lineEdit_3.text()))
            channel.set("gameName", unicode(self.lineEdit_4.text()))
            channel.set("apiKey", unicode(self.lineEdit_5.text()))
            channel.set("resVersion", unicode(self.lineEdit_12.text()))
            channel.set("wdjAppKey", unicode(self.wdjAppKey.text()))

            #平台信息
            platform = root.find("platform")
            platform.set("gameId", unicode(self.lineEdit_6.text()))
            platform.set("platformId", unicode(self.lineEdit_7.text()))
            platform.set("appVersion", unicode(self.lineEdit_8.text()))
            platform.set("platformType", unicode(self.lineEdit_9.text()))
            platform.set("datacenter", unicode(self.lineEdit_10.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'
            scheme = '{' + constant.androidNS + '}scheme'
            applicationCfg = configRoot.find("applicationCfg")
            if applicationCfg is None:
                return
            activityList = applicationCfg.findall("activity")

            for activityNode in activityList:
                if activityNode.attrib[
                        key] == "com.wandoujia.oakenshield.activity.OakenshieldActivity":
                    intentFilterList = activityNode.findall("intent-filter")
                    for intentFilterNode in intentFilterList:
                        dataNode = intentFilterNode.find("data")
                        if not dataNode is None:
                            dataNode.set(
                                scheme, "Wandoujia-PaySdk-" +
                                unicode(self.wdjAppKey.text()))

            configTree.write(file_operate.getForManifestXmlPath(), "utf-8")

        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 5
0
    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.appId.text()))
            channel.set("appKey", unicode(self.appKey.text())) 
            channel.set("privateKey",unicode(self.privateKey.text()))
            channel.set("channel",unicode(self.channel.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.package_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] == "LVANSDK_APPID":
                    child.set(value, unicode(self.appId.text()))
                if child.attrib[key] == "LVANSDK_APPKEY":
                    child.set(value, unicode(self.appKey.text()))   
                if child.attrib[key] == "LVANSDK_PRIVATEKEY":
                    child.set(value, unicode(self.privateKey.text()))
                if child.attrib[key] == "LVANSDK_CHANNEL":
                    child.set(value, unicode(self.channel.text()))
                    
            configTree.write(file_operate.getForManifestXmlPath(), "utf-8")
                    
        
        except Exception,e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 6
0
    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] == "UMENG_APPKEY":
                    child.set(value, unicode(self.lineEdit.text()))
                elif child.attrib[key] == "UMENG_CHANNEL":
                    child.set(value, unicode(self.lineEdit_14.text()))
                elif child.attrib[key] == "PptvVasSdk_CID":
                    child.set(value, unicode(self.lineEdit_2.text()))
                elif child.attrib[key] == "PptvVasSdk_CCID":
                    child.set(value, unicode(self.lineEdit_15.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.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()))

            channel = root.find("channel")
            channel.set("gid", unicode(self.lineEdit_3.text()))
            channel.set("checkUpdate", unicode(self.lineEdit_4.text()))
            channel.set("UMENG_APPKEY", unicode(self.lineEdit.text()))
            channel.set("cid", unicode(self.lineEdit_2.text()))
            channel.set("useUMeng", unicode(self.lineEdit_12.text()))
            channel.set("app_secret", unicode(self.lineEdit_13.text()))
            channel.set("UMENG_CHANNEL", unicode(self.lineEdit_14.text()))
            channel.set("ccid", unicode(self.lineEdit_15.text()))
            channel.set("resVersion", unicode(self.lineEdit_10.text()))

            config.write(file_operate.getConfigXmlPath(), "utf-8")

        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 7
0
    def onOkClicked(self):
        try:
            #print os.path.abspath('.')
            config = ET.parse(file_operate.getConfigXmlPath())
            root = config.getroot()

            #渠道信息
            channel = root.find("channel")
            channel.set("gameId", unicode(self.lineEdit.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] == "BaiduMobAd_CHANNEL":
                    child.set(value, unicode(self.lineEdit_3.text()))
                elif child.attrib[key] == "BaiduMobAd_STAT_ID":
                    child.set(value, unicode(self.lineEdit_4.text()))

            configTree.write(file_operate.getForManifestXmlPath(), "utf-8")

            #write pid from res/raw/manifest.txt
            fileName = file_operate.getFullPath(
                constant.sdkRelatePath +
                ConfigParse.shareInstance().getChannelName() +
                "/ForRes/raw/manifest.txt")
            f = open(fileName, "w")
            data = "{\"pid\":\"%s\"}" % unicode(self.lineEdit_2.text())
            f.write(data)

        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 8
0
    def onOkClicked(self):
        try:
            #write metadata to ForManifest
            ET.register_namespace('android', constant.androidNS)

            configTree = ET.parse(file_operate.getForManifestXmlPath())
            configRoot = configTree.getroot()
            keyname = '{' + constant.androidNS + '}name'
            protectionLevel = '{' + constant.androidNS + '}protectionLevel'
            permissionCfg = configRoot.find("permissionCfg")
            if permissionCfg is None:
                return
            if permissionCfg is not None:
                permissionNode = SubElement(permissionCfg, 'permission')
                permissionNode.set(
                    keyname,
                    unicode(self.packageName.text()) +
                    '.permission.C2D_MESSAGE')
                permissionNode.set(protectionLevel, 'signature')
                usespermissionNode = SubElement(permissionCfg,
                                                'uses-permission')
                usespermissionNode.set(
                    keyname,
                    unicode(self.packageName.text()) +
                    '.permission.C2D_MESSAGE')

            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("facebook_app_id",
                        unicode(self.facebook_app_id.text()))
            channel.set("nextmv_api_key", unicode(self.nextmv_api_key.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
Esempio n. 9
0
    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("appSecret", unicode(self.lineEdit_2.text()))
            channel.set("gameName", unicode(self.lineEdit_3.text()))

            channel.set("resVersion", unicode(self.lineEdit_7.text()))

            #平台信息
            platform = root.find("platform")
            platform.set("gameId", unicode(self.lineEdit_4.text()))
            platform.set("platformId", unicode(self.lineEdit_8.text()))
            platform.set("appVersion", unicode(self.lineEdit_5.text()))
            platform.set("platformType", unicode(self.lineEdit_9.text()))
            platform.set("datacenter", unicode(self.lineEdit_6.text()))

            app = root.find("app")
            app.set("packageName", unicode(self.lineEdit_10.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
            activityList = applicationCfg.findall("activity")

            for activity in activityList:
                #                 print child.attrib[key]
                if activity.attrib[
                        key] == "com.unionpay.upomp.bypay.activity.SplashActivity":
                    intentFilterList = activity.findall("intent-filter")
                    for intentFilter in intentFilterList:
                        actionList = intentFilter.findall("action")
                        for action in actionList:
                            action.attrib[key] = unicode(self.lineEdit_10.text(
                            )) + "_juzi_303310048990001_2_0"

            configTree.write(file_operate.getForManifestXmlPath(), "utf-8")

        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 10
0
    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("orientation", unicode(self.comboBox.currentText()))
            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] == "BAIDUSDK_CHANNEL":
                    child.set(value, unicode(self.lineEdit_3.text()))
                elif child.attrib[key] == "BDGameVersion":
                    child.set(value, unicode(self.lineEdit_4.text()))
                elif child.attrib[key] == "BDPlatformType":
                    child.set(value,
                              unicode("%d" % self.comboBox_2.currentIndex()))

            configTree.write(file_operate.getForManifestXmlPath(), "utf-8")

        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 11
0
    def initDialog(self):
        try:
            #print os.path.abspath('.')
            config = ET.parse(file_operate.getConfigXmlPath())
            root = config.getroot()

            #渠道信息
            channel = root.find("channel")
            self.appId.setText(channel.get("appId"))
            self.appKey.setText(channel.get("appKey"))

            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"))

        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 12
0
    def initDialog(self):
        try:
            config = ET.parse(file_operate.getConfigXmlPath())
            root = config.getroot()

            #渠道信息
            channel = root.find("channel")

            if channel.get("resVersion") != None:
                self.lineEdit_10.setText(channel.get("resVersion"))
            else:
                self.lineEdit_10.setText("")

            self.lineEdit.setText(channel.get("gameName"))

            #平台信息
            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"))

        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 13
0
    def initDialog(self):
        try:
            #read form ForManifest.xml
            ET.register_namespace('android', constant.androidNS)

            #渠道信息
            config = ET.parse(file_operate.getConfigXmlPath())
            root = config.getroot()

            #平台信息
            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"))

            channel = root.find("channel")
            if channel.get("resVersion") != None:
                self.resVersion.setText(channel.get("resVersion"))
            else:
                self.resVersion.setText("")
        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 14
0
    def initDialog(self):
        config = ET.parse(file_operate.getConfigXmlPath())
        root = config.getroot()

        #渠道信息
        channel = root.find("channel")
        self.lineEdit.setText(channel.get("appId"))
        self.lineEdit_2.setText(channel.get("appKey"))
        self.lineEdit_3.setText(channel.get("merchantId"))
        self.lineEdit_4.setText(channel.get("serverSeqNum"))
        orienIndex = self.comboBox.findText(channel.get("iconLocation"))
        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"))
Esempio n. 15
0
    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
Esempio n. 16
0
    def initDialog(self):
        config = ET.parse(file_operate.getConfigXmlPath())
        root = config.getroot()

        #渠道信息
        channel = root.find("channel")

        self.lineEdit.setText(channel.get("appId"))
        self.lineEdit_2.setText(channel.get("payId"))
        self.lineEdit_3.setText(channel.get("privateKey"))
        self.lineEdit_4.setText(channel.get("payPrivateRSA"))
        self.lineEdit_5.setText(channel.get("payPublicRSA"))
        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"))
Esempio n. 17
0
    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("base64PublicKey", unicode(self.lineEdit_2.text()))
            
            config.write(file_operate.getConfigXmlPath(), "utf-8")
            
            
            valuesFolder = constant.sdkRelatePath + ConfigParse.shareInstance().getChannelName()+"/ForRes/values/"
            #write ForRes/values/strings.xml
            stringsXml = valuesFolder + "strings.xml"
            configTree = ET.parse(file_operate.getFullPath(stringsXml))
            configRoot = configTree.getroot()
            stringList = configRoot.findall("string")
            finedapiKey = False
            finedgcmKey = False
            findedKakaoKey = False
            finedKakaoScheme = False
            for stringItem in stringList:
                if (stringItem.attrib["name"] == "nextmv_api_key"):
                    stringItem.text = unicode(self.lineEdit_3.text())
                    finedapiKey = True
                elif (stringItem.attrib["name"] == "gcm_key"):
                    stringItem.text = unicode(self.lineEdit_4.text())
                    finedgcmKey = True
                elif (stringItem.attrib["name"] == "kakao_app_key"):
                    stringItem.text = unicode(self.lineEdit_5.text())
                    findedKakaoKey = True
                elif (stringItem.attrib["name"] == "kakao_scheme"):
                    stringItem.text = unicode(self.lineEdit_6.text())
                    finedKakaoScheme = True
                
                if finedapiKey and finedgcmKey and findedKakaoKey and finedKakaoScheme:
                    break
            configTree.write(stringsXml, "utf-8")
                    
        
        except Exception,e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 18
0
    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
Esempio n. 19
0
    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
Esempio n. 20
0
    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
Esempio n. 21
0
    def initDialog(self):
        config = ET.parse(file_operate.getConfigXmlPath())
        root = config.getroot()

        #渠道信息
        channel = root.find("channel")
        self.lineEdit.setText(channel.get("appId"))
        self.lineEdit_2.setText(channel.get("appKey"))
        self.lineEdit_3.setText(channel.get("iconName"))
        self.lineEdit_4.setText(channel.get("userCenterUrl"))
Esempio n. 22
0
    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("iconName", unicode(self.lineEdit_3.text()))
            channel.set("userCenterUrl", unicode(self.lineEdit_4.text()))

            config.write(file_operate.getConfigXmlPath(), "utf-8")

        except Exception, e:
            print e
            print "Error: cannot parse file: config.xml."
            return -1
Esempio n. 23
0
    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
Esempio n. 24
0
    def onOkClicked(self):
        try:
            #write metadata to ForManifest
            ET.register_namespace('android', constant.androidNS)
            
#             doc = minidom.parse(file_operate.getForManifestXmlPath())
            
            #渠道信息
            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("kochavaAppGuid", unicode(self.kochavaAppGuid.text()))
            channel.set("facebookId", unicode(self.facebookId.text()))
            channel.set("screenOrientation", unicode(self.screenOrientation.text()))
            channel.set("gpPayPublicKey", unicode(self.gpPayPublicKey.text()))
            channel.set("language", unicode(self.language.text()))
            channel.set("payGrade", unicode(self.payGrade.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   
Esempio n. 25
0
    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
Esempio n. 26
0
    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
Esempio n. 27
0
    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("privateKey"))
            self.lineEdit_2.setText(channel.get("funcellKey"))

            valuesFolder = constant.sdkRelatePath + ConfigParse.shareInstance(
            ).getChannelName() + "/ForRes/values/"
            #read ForRes/values/strings.xml
            stringsXml = valuesFolder + "strings.xml"
            configTree = ET.parse(file_operate.getFullPath(stringsXml))
            configRoot = configTree.getroot()
            stringList = configRoot.findall("string")
            finedapiKey = False
            finedgcmKey = False
            findedKakaoKey = False
            finedKakaoScheme = False
            for stringItem in stringList:
                if (stringItem.attrib["name"] == "nextmv_api_key"):
                    print stringItem.text
                    self.lineEdit_3.setText(stringItem.text)
                    finedapiKey = True
                elif (stringItem.attrib["name"] == "gcm_key"):
                    print stringItem.text
                    self.lineEdit_4.setText(stringItem.text)
                    finedgcmKey = True
                elif (stringItem.attrib["name"] == "kakao_app_key"):
                    self.lineEdit_5.setText(stringItem.text)
                    findedKakaoKey = True
                elif (stringItem.attrib["name"] == "kakao_scheme"):
                    self.lineEdit_6.setText(stringItem.text)
                    finedKakaoScheme = True

                if finedapiKey and finedgcmKey and findedKakaoKey and finedKakaoScheme:
                    break

        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 28
0
    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
Esempio n. 29
0
    def initDialog(self):
        try:
            #read form ForManifest.xml
            ET.register_namespace('android', constant.androidNS)

            #渠道信息
            config = ET.parse(file_operate.getConfigXmlPath())
            root = config.getroot()

            #平台信息
            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"))

            channel = root.find("channel")
            self.facebook_app_id.setText(channel.get("facebook_app_id"))
            self.nextmv_api_key.setText(channel.get("nextmv_api_key"))
            self.igaworks_app_key.setText(channel.get("igaworks_app_key"))
            self.igaworks_hash_key.setText(channel.get("igaworks_hash_key"))
            self.funcellKey.setText(channel.get("funcellKey"))
            self.appId.setText(channel.get("appcode"))
            self.naver_client_id.setText(channel.get("naver_client_id"))
            self.naver_client_secret.setText(
                channel.get("naver_client_secret"))
            orienIndex = self.comboBox.findText(channel.get("mode"))
            if orienIndex == -1:
                self.comboBox.setCurrentIndex(0)
            else:
                self.comboBox.setCurrentIndex(orienIndex)
            if channel.get("resVersion") != None:
                self.resVersion.setText(channel.get("resVersion"))
            else:
                self.resVersion.setText("")
        except Exception, e:
            print e
            print "Error: cannot parse file: funcellconfig.xml."
            return -1
Esempio n. 30
0
    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("appId"))
            self.lineEdit_2.setText(channel.get("appKey"))
            self.lineEdit_3.setText(channel.get("wxAppId"))
            self.lineEdit_4.setText(channel.get("wxAppKey"))
            self.msdkKey.setText(channel.get("msdkKey"))
            self.TA_APPKEY.setText(channel.get("TA_APPKEY"))
            self.InstallChannel.setText(channel.get("InstallChannel"))
            
            orienIndex = self.comboBox.findText(channel.get("isRelease"))
            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"))
            
        except Exception,e:
            print e
            print "Error: cannot parse file: config.xml."
            return -1