def main(mixParams, assetsInfo): mapping = None if mixParams.soundMapping : mapping = {} assetsInfo.soundMapping = mapping signName = MixFileUtils.getFileName(mixParams.assetsName) bitchMix(mixParams.assetsRes, signName, mapping)
def makeMixIndex(indexPath, fileDict, assetsInfo): indexInfo = ClassImplInfo() indexInfo.className = MixFileUtils.getFileName(indexPath) # include start indexInfo.includes.append(indexInfo.className + '.h') mixAmount = len(fileDict) if mixAmount > 0: abmanagerPos = random.randint(1, mixAmount - 1) for fpath in fileDict: # 随机位置插入 abmanagerPos -= 1 if 0 == abmanagerPos: indexInfo.includes.append('AssetsBinManager.h') # 导入混淆代码 indexInfo.includes.append(fpath) else: indexInfo.includes.append('AssetsBinManager.h') # include end # init method start initMethod = MethodInfo() initMethod.static = '+' initMethod.methodName = 'startGameApp' initMethod.returnType = 'void' if mixAmount > 0: initMethod.body = makeInitGameContent(assetsInfo, fileDict) else: initMethod.body = makeAssetsConfigs(assetsInfo) indexInfo.methods.append(initMethod) # init method end return buildClassImplement(indexInfo)