|
@@ -110,8 +110,7 @@ def pack(game, sdk, config):
|
|
#if ret:
|
|
#if ret:
|
|
# return ret
|
|
# return ret
|
|
# 打包lib依赖
|
|
# 打包lib依赖
|
|
- # packReativeJar(game, sdk, subChannel, config)
|
|
|
|
- # i = 1/0
|
|
|
|
|
|
+
|
|
ret = packJar(game, sdk, subChannel, config)
|
|
ret = packJar(game, sdk, subChannel, config)
|
|
if ret:
|
|
if ret:
|
|
return ret
|
|
return ret
|
|
@@ -127,6 +126,7 @@ def pack(game, sdk, config):
|
|
ret = doGamePostScript(game, sdk, config)
|
|
ret = doGamePostScript(game, sdk, config)
|
|
if ret:
|
|
if ret:
|
|
return ret
|
|
return ret
|
|
|
|
+
|
|
# log sdk
|
|
# log sdk
|
|
if 'logSdk' in config:
|
|
if 'logSdk' in config:
|
|
for log in config['logSdk']:
|
|
for log in config['logSdk']:
|
|
@@ -983,81 +983,6 @@ def packLogJar(game, sdk, subChannel, config, logSdk):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-def packReativeJar(game, sdk, subChannel, config):
|
|
|
|
- '''
|
|
|
|
- 打包Reative Jar
|
|
|
|
- '''
|
|
|
|
- splitDex = config['splitDex']
|
|
|
|
- decompliePath = file_utils.getDecompliePath(game, sdk, subChannel, config['cache'])
|
|
|
|
- outPath = file_utils.getFullPath(decompliePath, 'gen')
|
|
|
|
-
|
|
|
|
- dx = file_utils.getD8Path()
|
|
|
|
- androidPlatforms = file_utils.getAndroidCompileToolPath()
|
|
|
|
- dexCmd = '--lib "%s" --output "%s"' % (androidPlatforms, outPath)
|
|
|
|
-
|
|
|
|
- # 找到所有lib依赖
|
|
|
|
- sdkPath = file_utils.getFullSDKPath(sdk)
|
|
|
|
- libs = os.path.join(sdkPath, 'libs')
|
|
|
|
- libConfig = os.path.join(libs, 'config.json')
|
|
|
|
- print('jar ----> reactive-streams.jar');
|
|
|
|
- dexCmd += ' ' + os.path.join(libs, "reactive-streams.jar")
|
|
|
|
- # 存在配置文件
|
|
|
|
- # if os.path.exists(libConfig):
|
|
|
|
- # jsonText = file_utils.readFile(libConfig)
|
|
|
|
- # libConf = json.loads(jsonText)
|
|
|
|
- # if 'libConfig' in config and config['libConfig'] in libConf:
|
|
|
|
- # conf = config['libConfig']
|
|
|
|
- # libList = libConf[conf]
|
|
|
|
- # for jar in libList:
|
|
|
|
- # print('jar ----> reactive-streams.jar');
|
|
|
|
- # dexCmd += ' ' + os.path.join(libs, jar)
|
|
|
|
- # elif 'default' in libConf:
|
|
|
|
- # libList = libConf['default']
|
|
|
|
- # for jar in libList:
|
|
|
|
- # print('jar --> ' + jar);
|
|
|
|
- # dexCmd += ' ' + os.path.join(libs, jar)
|
|
|
|
- # else:
|
|
|
|
- # for jar in os.listdir(libs):
|
|
|
|
- # if not jar.endswith('.jar'):
|
|
|
|
- # continue
|
|
|
|
- # dexCmd += ' ' + os.path.join(libs, jar)
|
|
|
|
- # else:
|
|
|
|
- # for jar in os.listdir(libs):
|
|
|
|
- # if not jar.endswith('.jar'):
|
|
|
|
- # continue
|
|
|
|
- # dexCmd += ' ' + os.path.join(libs, jar)
|
|
|
|
-
|
|
|
|
- # multidex.jar
|
|
|
|
- # if splitDex:
|
|
|
|
- # dexCmd += ' ' + file_utils.getMultiDexPath()
|
|
|
|
-
|
|
|
|
- # sdk实现类
|
|
|
|
- print('packageing all jar ...')
|
|
|
|
- #dexCmd += ' ' + os.path.join(sdkPath, '%s.jar' % sdk)
|
|
|
|
- ret = file_utils.execJarCmd(dx, dexCmd)
|
|
|
|
- if ret:
|
|
|
|
- return ret
|
|
|
|
-
|
|
|
|
- # 反向dex生成smali
|
|
|
|
- # 存放在out目录
|
|
|
|
- print('baksmali classes.dex ...')
|
|
|
|
- outDex = os.path.join(outPath, 'classes.dex')
|
|
|
|
- baksmaliPath = file_utils.getBaksmaliPath()
|
|
|
|
- outPath = file_utils.getFullPath(decompliePath, 'out')
|
|
|
|
-
|
|
|
|
- ret = file_utils.execJarCmd(baksmaliPath, 'd "%s" -o "%s"' % (outDex, outPath))
|
|
|
|
- if ret:
|
|
|
|
- return ret
|
|
|
|
-
|
|
|
|
- # 将生成的文件拷贝到目标目录
|
|
|
|
- print('copy all smali ...')
|
|
|
|
- smaliPath = file_utils.getFullPath(decompliePath, 'smali')
|
|
|
|
- ret = file_utils.copyFileAllDir(outPath, smaliPath, False)
|
|
|
|
- if ret:
|
|
|
|
- return ret
|
|
|
|
-
|
|
|
|
- return 0
|
|
|
|
-
|
|
|
|
|
|
|
|
def splitDex(game, sdk, subChannel, config):
|
|
def splitDex(game, sdk, subChannel, config):
|
|
'''
|
|
'''
|