|
@@ -31,6 +31,10 @@ def pack(game, sdk, config):
|
|
|
subChannel = config['subChannel']
|
|
|
# 解包
|
|
|
ret = decomplie(game, sdk, subChannel, config)
|
|
|
+ if ret:
|
|
|
+ return ret
|
|
|
+ # 删除旧代码
|
|
|
+ ret = removeOldCode(game, sdk, subChannel, config)
|
|
|
if ret:
|
|
|
return ret
|
|
|
if 'deleteList' in config:
|
|
@@ -127,9 +131,9 @@ def pack(game, sdk, config):
|
|
|
if ret:
|
|
|
return ret
|
|
|
# 生成R文件
|
|
|
- ret = generateNewRFile(game, sdk, subChannel, config)
|
|
|
+ '''ret = generateNewRFile(game, sdk, subChannel, config)
|
|
|
if ret:
|
|
|
- return ret
|
|
|
+ return ret'''
|
|
|
# 添加MultiDex支持
|
|
|
if config['splitDex']:
|
|
|
ret = splitDex(game, sdk, subChannel, config)
|
|
@@ -192,7 +196,15 @@ def removeOldCode(game, sdk, subChannel, config):
|
|
|
'''
|
|
|
decompliePath = file_utils.getDecompliePath(game, sdk, subChannel, config['cache'])
|
|
|
codePath = os.path.join(decompliePath, 'smali', 'com', 'jmhy', 'lib', 'record')
|
|
|
- file_utils.deleteFolder(codePath)
|
|
|
+ #file_utils.deleteFolder(codePath)
|
|
|
+ allFiles = []
|
|
|
+ allFiles = file_utils.list_files(codePath, allFiles)
|
|
|
+ for f in allFiles:
|
|
|
+ fpath, fname = os.path.split(f) #分离文件名和路径
|
|
|
+ if fname == 'R.smali' or fname.startswith('R$'):
|
|
|
+ continue
|
|
|
+ os.remove(f)
|
|
|
+ print('remove %s' % f)
|
|
|
return 0
|
|
|
|
|
|
def copyRes(game, sdk, subChannel, config):
|
|
@@ -996,7 +1008,7 @@ def recomplie(game, sdk, subChannel, config):
|
|
|
if config['aapt2disable']:
|
|
|
useAppt2 = ''
|
|
|
|
|
|
- return file_utils.execJarCmd(apktoolPath, 'b -f "%s" -o "%s" %s' % (decompliePath, outApk, useAppt2))
|
|
|
+ return file_utils.execJarCmd(apktoolPath, 'b -f "%s" -o "%s"%s' % (decompliePath, outApk, useAppt2))
|
|
|
|
|
|
def alignApk(game, sdk, subChannel, config):
|
|
|
'''
|