Esempio n. 1
0
 def cleanResBtnClick(self):
     personinfo = ZFJPersoninfo()
     if personinfo.cleanResView == None:
         cleanResView = CleanResView()
         cleanResView.show()
         personinfo.cleanResView = cleanResView
     else:
         personinfo.cleanResView.show()
     self.close()
Esempio n. 2
0
def startObfuscatedObjName(path, prefix=''):
    initData()
    conLog.info('----------------------------------------')
    getObjectNames(path, prefix)
    personinfo = ZFJPersoninfo()
    personinfo.objectNamesMap = objectNamesMap
    conLog.info(objectNamesMap)
    replaceFilesObjNames(path)
    reviseFilesName(path)
Esempio n. 3
0
 def missPrefixBtnClick(self):
     personinfo = ZFJPersoninfo()
     if personinfo.missPrefixView == None:
         missPrefixView = PrefixView()
         missPrefixView.show()
         personinfo.missPrefixView = missPrefixView
     else:
         personinfo.missPrefixView.show()
     self.close()
Esempio n. 4
0
 def missWordBtnClick(self):
     personinfo = ZFJPersoninfo()
     if personinfo.lexiconView == None:
         lexiconView = DeveLexiconView()
         lexiconView.show()
         personinfo.lexiconView = lexiconView
     else:
         personinfo.lexiconView.show()
     self.close()
Esempio n. 5
0
 def reptileBtnClick(self):
     personinfo = ZFJPersoninfo()
     if personinfo.reptileView == None:
         reptileView = ReptileView()
         reptileView.show()
         personinfo.reptileView = reptileView
     else:
         personinfo.reptileView.show()
     self.close()
Esempio n. 6
0
 def imageScaleBtnClick(self):
     personinfo = ZFJPersoninfo()
     if personinfo.scaleView == None:
         scaleView = ImgScaleView()
         scaleView.show()
         personinfo.scaleView = scaleView
     else:
         personinfo.scaleView.show()
     self.close()
Esempio n. 7
0
 def missBtnClick(self):
     personinfo = ZFJPersoninfo()
     if personinfo.rootView != None:
         personinfo.rootView.show()
     else:
         root_View = rootView()
         root_View.show()
         personinfo.rootView = root_View
     self.close()
Esempio n. 8
0
def createRubbishOCFile(fileCount=1, amount=5, rubPrefix=''):
    global _createFileMap
    global _createFilePath
    if _createFilePath == None:
        return
    for index in range(0, fileCount):
        createOCFile(_createFilePath, amount, rubPrefix)

    personinfo = ZFJPersoninfo()
    personinfo.rubbishFileMap = _createFileMap
Esempio n. 9
0
 def defaultView(self):
     self.setWindowFlags(QtCore.Qt.WindowTitleHint
                         | QtCore.Qt.WindowCloseButtonHint)
     self.resize(logIn_wid, logIn_hei)
     self.setFixedSize(logIn_wid, logIn_hei)
     self.setStyleSheet('background-color:#fff')
     self.center()
     self.setWindowTitle(zfjTools.baseTitle)
     personinfo = ZFJPersoninfo()
     personinfo.prefixMap = zfjTools.readPrefixMap()
Esempio n. 10
0
 def showMapList(self):
     personinfo = ZFJPersoninfo()
     if personinfo.mapView == None:
         mapView = mapListView()
         mapView.reloadData()
         mapView.show()
         personinfo.mapView = mapView
     else:
         personinfo.mapView.reloadData()
         personinfo.mapView.show()
Esempio n. 11
0
def startConfusionFun(file_dir, funNamePrefix):
    initData()
    conLog.info('----------------------------------------')
    cycTra_for_methodListMap(file_dir, funNamePrefix)
    personinfo = ZFJPersoninfo()
    personinfo.method_list_map = method_list_map
    conLog.info(method_list_map)
    conLog.info('----------------------------------------')
    cycTra_for_propertyList(file_dir)
    conLog.info('----------------------------------------')
    cycTra_for_ConMFile(file_dir)
Esempio n. 12
0
def startConfusionPro(file_dir, propertyPrefix):
    initData()
    conLog.info('----------------------------------------')
    cycTraPropertyListMap(file_dir, propertyPrefix)
    personinfo = ZFJPersoninfo()
    personinfo.propertyMisMap = propertyMisMap
    conLog.info(propertyMisMap)
    conLog.info('----------------------------------------')
    cycTraMyPropertyList(file_dir)
    conLog.info('----------------------------------------')
    cycTraMissPropertyAtMFile(file_dir)
Esempio n. 13
0
def startSourceName(file_dir, imgPreFix):
    initData()
    conLog.info('----------------------------------------')
    searchXcassets(file_dir, imgPreFix)
    personinfo = ZFJPersoninfo()
    personinfo.sourceMap = sourceMap
    personinfo.xcassetsMap = xcassetsMap
    conLog.info(sourceMap)
    conLog.info(xcassetsMap)
    conLog.info('----------------------------------------')
    upDateContentsJson()
    startReplaceSouName(file_dir)
Esempio n. 14
0
def startMissFolder(file_dir, folderPreFix):
    global _folderPreFix
    initData()
    _folderPreFix = folderPreFix
    conLog.info('----------------------------------------')
    getProjectPbxprojPath(file_dir)
    personinfo = ZFJPersoninfo()
    personinfo.method_list_map = PBXGroupMap
    conLog.info(PBXGroupMap)
    getPathChildMap(file_dir)
    setPathForPBXGroupMap()
    findFolderAndMiss(file_dir)
    getNewProjectPbxprojPath(file_dir)
Esempio n. 15
0
def realizeRubbishFunCode(file_dir, amount, rubPrefix):
    global allObjRubCodeMap
    personinfo = ZFJPersoninfo()
    rubbishFileMap = personinfo.rubbishFileMap
    fs = os.listdir(file_dir)
    for dir in fs:
        tmp_path = os.path.join(file_dir, dir)
        if not os.path.isdir(tmp_path):
            object_name = tmp_path.split('/')[-1].split('.')[0]
            if object_name not in rubbishFileMap.keys():
                rubCodeTuple = None
                if object_name not in allObjRubCodeMap.keys():
                    rubCodeTuple = addRandomCode.addRandomClass(
                        amount, rubPrefix)
                    allObjRubCodeMap[object_name] = rubCodeTuple
                else:
                    rubCodeTuple = allObjRubCodeMap[object_name]
                if tmp_path.endswith('.h'):
                    if not notUpdateFile(tmp_path):
                        addCodeAtHFile(tmp_path, rubCodeTuple)
                        conLog.info('[AddCode OK] ' + tmp_path)
                if tmp_path.endswith('.m') or tmp_path.endswith('.mm'):
                    if not notUpdateFile(tmp_path):
                        addCodeAtMFile(tmp_path, rubCodeTuple)
                        conLog.info('[AddCode OK] ' + tmp_path)
            continue
            realizeRubbishFunCode(tmp_path, amount, rubPrefix)
Esempio n. 16
0
 def backMainViewBtnClick(self):
     personinfo = ZFJPersoninfo()
     if personinfo.mainRootView != None:
         personinfo.mainRootView.show()
         self.close()
     else:
         print('mainRootView')
Esempio n. 17
0
 def reloadData(self):
     textEditText = '\n'
     personinfo = ZFJPersoninfo()
     if personinfo.propertyMisMap != None:
         space_line = '----------------------------------------\n'
         textEditText += space_line
         textEditText += str(personinfo.propertyMisMap) + '\n\n'
     if personinfo.method_list_map != None:
         space_line = '----------------------------------------\n'
         textEditText += space_line
         textEditText += str(personinfo.method_list_map) + '\n\n'
     if personinfo.objectNamesMap != None:
         space_line = '----------------------------------------\n'
         textEditText += space_line
         textEditText += str(personinfo.objectNamesMap) + '\n\n'
     if personinfo.sourceMap != None:
         space_line = '----------------------------------------\n'
         textEditText += space_line
         textEditText += str(personinfo.sourceMap) + '\n\n'
         if personinfo.xcassetsMap != None:
             textEditText += str(personinfo.xcassetsMap) + '\n\n'
     if personinfo.PBXGroupMap != None:
         space_line = '----------------------------------------\n'
         textEditText += space_line
         textEditText += str(personinfo.PBXGroupMap) + '\n\n'
     self.textEdit.setPlainText(textEditText)
Esempio n. 18
0
    def addWordBtnClick(self):
        personinfo = ZFJPersoninfo()
        fail_list = []
        scu_list = []
        addText = self.addTextEdit.toPlainText()
        addText = ''.join(addText.split())
        addText.replace(',', ',')
        new_lexicon_list = addText.split(',')
        for word in new_lexicon_list:
            if len(word) > 0:
                if word not in personinfo.lexicon_list:
                    personinfo.lexicon_list.append(word)
                    scu_list.append(word)
                else:
                    fail_list.append(word)
            else:
                conLog.info('AddLexicon Fail ')

        if len(fail_list) > 0:
            self.megBoxInfor('添加成功:' + ','.join(fail_list))
            conLog.info('AddLexicon Fail ' + ','.join(fail_list))
        if len(scu_list) > 0:
            file_data = ','.join(personinfo.lexicon_list)
            Wopen = open('lexicon.txt', 'w')
            Wopen.write(file_data)
            Wopen.close()
            conLog.info('AddLexicon OK ' + ','.join(scu_list))
            self.lexiconEdit.setPlainText(','.join(personinfo.lexicon_list))
Esempio n. 19
0
    def saveBtnClick(self):
        for index in range(0, len(self.prefixEditList)):
            prefixEdit = self.prefixEditList[index]
            if zfjTools.is_number(prefixEdit.text()) == True:
                self.megBoxInfor(self.preFixList[index] + '')
                return
            if zfjTools.is_contain_chinese(prefixEdit.text()) == True:
                self.megBoxInfor(self.preFixList[index] + '')
                return
            value = ''.join(prefixEdit.text().split())
            key = list(_prefixMap.keys())[index]
            _prefixMap[key] = value

        zfjTools.savePrefixMap(_prefixMap)
        personinfo = ZFJPersoninfo()
        personinfo.prefixMap = _prefixMap
        self.megBoxInfor('保存成功')
Esempio n. 20
0
def addTextEdit(log_str):
    personinfo = ZFJPersoninfo()
    scaleView = personinfo.scaleView
    if scaleView != None:
        str_text = scaleView.textEdit.toPlainText()
        str_text += log_str + '\n'
        scaleView.textEdit.setPlainText(str_text)
        scaleView.textEdit.moveCursor(QTextCursor.End)
        QApplication.processEvents()
Esempio n. 21
0
 def backMainViewBtnClick(self):
     personinfo = ZFJPersoninfo()
     if personinfo.isMissing == True:
         self.megBoxInfor('正在混淆中')
         return
     if personinfo.mainRootView != None:
         personinfo.mainRootView.show()
         self.close()
     else:
         print('mainRootView')
Esempio n. 22
0
def resetData():
    global _createFileMap
    global _createFilePath
    global _createFolderChildrenCode
    global _createFolderName
    global _createFolderUDID
    global _createFolderchildrenList
    global _projectPbxprojPath
    _createFilePath = None
    _projectPbxprojPath = None
    _createFileMap = {}
    _createFolderName = None
    _createFolderUDID = None
    _createFolderCode = None
    _createFolderChildrenCode = None
    _createFolderchildrenList = []
    _PBXFileReferenceCodeList = []
    _PBXSourcesBuildPhaseList = []
    _PBXBuildFileList = []
    personinfo = ZFJPersoninfo()
    personinfo.rubbishFileMap = {}
Esempio n. 23
0
def getMyProjectName(file_dir):
    global _projectNameTup
    fs = os.listdir(file_dir)
    for dir in fs:
        tmp_path = os.path.join(file_dir, dir)
        if os.path.isdir(tmp_path):
            if not igFil.isIgnoreFiles(tmp_path):
                if tmp_path.endswith('.xcodeproj'):
                    _projectName = tmp_path.split('/')[-1].split('.')[0]
                    personinfo = ZFJPersoninfo()
                    projectNamePreFix = personinfo.prefixMap['projectNamePreFix']
                    if len(projectNamePreFix) == 0:
                        projectNamePreFix = zfjTools.getWordFromLexicon().capitalize() + zfjTools.getWordFromLexicon().capitalize()
                _projectNameTup = (_projectName, projectNamePreFix)
                    break
                else:
                    getMyProjectName(tmp_path)
Esempio n. 24
0
def getImportCode():
    global _choseMap
    personinfo = ZFJPersoninfo()
    _createFileMap = personinfo.rubbishFileMap
    if len(_createFileMap.keys()) > 3:
        random.seed(len(_createFileMap.keys()))
        keyList = random.sample(list(_createFileMap.keys()), 3)
        for key in keyList:
            _choseMap[key] = _createFileMap[key]

    else:
        _choseMap = _createFileMap
    importCode = ''
    for objClassName in _choseMap:
        importCode += '#import "' + objClassName + '.h"\n'

    return importCode
Esempio n. 25
0
    def startMissBtnClick(self):
        personinfo = ZFJPersoninfo()
        if personinfo.isMissing == True:
            self.megBoxInfor('正在混淆中...')
            return
        file_dir = self.pathEdit.text()
        if len(file_dir) == 0:
            self.megBoxInfor('路径不能为空')
            return
        if os.path.exists(file_dir) == False:
            self.megBoxInfor('文件不存在')
            return
        ignoreFilesStr = self.ignoreEdit.text()
        ignoreFilesStr.replace(',', ',').replace('/', '')
        if len(ignoreFilesStr) > 0:
            for ignoreFile in ignoreFilesStr.split(','):
                ignoreFile_new = '/' + ignoreFile + '/'
                if '.' in ignoreFile:
                    ignoreFile_new = '/' + ignoreFile
                if ignoreFile_new not in ignoreFiles.ignore_Files:
                    ignoreFiles.ignore_Files.append(ignoreFile_new)

        isHaveFun = 0
        for item in _funMap:
            if _funMap[item] != '0':
                isHaveFun += 1

        if isHaveFun == 0:
            self.megBoxInfor('没有开启任何功能.....')
            return
        rubbishCode = int(_funMap['rubbishCode'])
        if rubbishCode > 0:
            rubbishLine = self.amountEdit.text()
            if zfjTools.is_number(rubbishLine) == False:
                self.megBoxInfor('添加次数值不对')
                return
            if int(rubbishLine) <= 0:
                self.megBoxInfor('添加次数值为负数')
                return
            _funMap['rubbishLine'] = str(rubbishLine)
            rubObjCount = self.rubClsEdit.text()
            if zfjTools.is_number(rubObjCount) == False:
                self.megBoxInfor('垃圾类数值不对')
                return
            if int(rubObjCount) < 0:
                self.megBoxInfor('垃圾类数值为负数')
                return
            _funMap['rubObjCount'] = str(rubObjCount)
        misProjectName = int(_funMap['misProjectName'])
        setProjectName = int(_funMap['setProjectName'])
        if misProjectName > 0:
            if setProjectName > 0:
                projectNamePreFix = self.projectNameEdit.text()
                if len(projectNamePreFix) <= 0:
                    self.megBoxInfor('自定义项目名为空')
                    return
                prefixMap = personinfo.prefixMap
                prefixMap['projectNamePreFix'] = projectNamePreFix
                personinfo.prefixMap = prefixMap
                zfjTools.savePrefixMap(prefixMap)
        codeObf.start_fun(file_dir, _funMap)
Esempio n. 26
0
            if setProjectName > 0:
                projectNamePreFix = self.projectNameEdit.text()
                if len(projectNamePreFix) <= 0:
                    self.megBoxInfor('自定义项目名为空')
                    return
                prefixMap = personinfo.prefixMap
                prefixMap['projectNamePreFix'] = projectNamePreFix
                personinfo.prefixMap = prefixMap
                zfjTools.savePrefixMap(prefixMap)
        codeObf.start_fun(file_dir, _funMap)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    rootView = rootView()
    rootView.show()
    personinfo = ZFJPersoninfo()
    personinfo.rootView = rootView
    sys.exit(app.exec_())


def addTextEdit(log_str):
    personinfo = ZFJPersoninfo()
    rootView = personinfo.rootView
    if rootView != None:
        str_text = rootView.textEdit.toPlainText()
        str_text += log_str + '\n'
        rootView.textEdit.setPlainText(str_text)
        rootView.textEdit.moveCursor(QTextCursor.End)
        QApplication.processEvents()
Esempio n. 27
0
        self.accountLab.setText(':' + str(personinfo.account))
        self.timeLab.setText(':' + personinfo.expireDate.replace('"', ''))

    def center(self):
        qr = self.frameGeometry()
        cp = QDesktopWidget().availableGeometry().center()
        qr.moveCenter(cp)
        self.move(qr.topLeft())

    def megBoxInfor(self, infor):
        QMessageBox.information(self, '', infor, QMessageBox.Yes)


def addTextEdit(log_str):
    personinfo = ZFJPersoninfo()
    scaleView = personinfo.scaleView
    if scaleView != None:
        str_text = scaleView.textEdit.toPlainText()
        str_text += log_str + '\n'
        scaleView.textEdit.setPlainText(str_text)
        scaleView.textEdit.moveCursor(QTextCursor.End)
        QApplication.processEvents()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    scaleView = ImgScaleView()
    personinfo = ZFJPersoninfo()
    personinfo.scaleView = scaleView
    scaleView.show()
    sys.exit(app.exec_())
Esempio n. 28
0
                self.reptileType = 1
                for checkBox in self.checkBoxList:
                    checkBox.setCheckState(Qt.Unchecked)

    def checkBoxClick(self):
        if self.sysBtn.isChecked() != True:
            for checkBox in self.checkBoxList:
                checkBox.setCheckState(Qt.Unchecked)

    def reloadUI(self):
        personinfo = ZFJPersoninfo()
        self.accountLab.setText(':' + str(personinfo.account))
        self.timeLab.setText(':' + personinfo.expireDate.replace('"', ''))

    def center(self):
        qr = self.frameGeometry()
        cp = QDesktopWidget().availableGeometry().center()
        qr.moveCenter(cp)
        self.move(qr.topLeft())

    def megBoxInfor(self, infor):
        QMessageBox.information(self, '', infor, QMessageBox.Yes)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    reptileView = ReptileView()
    personinfo = ZFJPersoninfo()
    personinfo.reptileView = reptileView
    reptileView.show()
    sys.exit(app.exec_())
Esempio n. 29
0
 def reloadUI(self):
     personinfo = ZFJPersoninfo()
     self.accountLab.setText(':' + str(personinfo.account))
     self.timeLab.setText(':' + personinfo.expireDate.replace('"', ''))
Esempio n. 30
0
        webbrowser.open_new_tab(url)

    def errorBtnClick(self):
        meg = '1.方法名相同,被多次混淆覆盖;\n'
        meg += '2.忽略的文件夹中包含了已被混淆的类或者方法;\n'
        meg += '3.图片如果不显示,可能原因是代码中图片名采用的是拼接的,手动替换一下就可以了;\n'
        meg += '4.如果出现项目路径修改了,但是本地实体路径没有修改,自己手动把本地路径修改一下;\n'
        meg += '5.utf-8编码错误和[Errno 13] Permission denied权限错误不用管;\n'
        self.megBoxInfor(meg)

    def gitBtnClick(self):
        url = 'https://gitee.com/zfj1128/ZFJObsLib_dmg'
        webbrowser.open_new_tab(url)

    def megBoxInfor(self, infor):
        QMessageBox.information(self, '', infor, QMessageBox.Yes)

    def center(self):
        qr = self.frameGeometry()
        cp = QDesktopWidget().availableGeometry().center()
        qr.moveCenter(cp)
        self.move(qr.topLeft())


if __name__ == '__main__':
    app = QApplication(sys.argv)
    mainRootView = MainRootView()
    mainRootView.show()
    personinfo = ZFJPersoninfo()
    personinfo.mainRootView = mainRootView
    sys.exit(app.exec_())