|
|
@@ -4,10 +4,7 @@ __author__ = 'tianshuqitan'
|
|
|
|
|
|
import os
|
|
|
import logging
|
|
|
-import xml.dom.minidom
|
|
|
-import re
|
|
|
import shutil
|
|
|
-import glob
|
|
|
from xml.etree import ElementTree as ET
|
|
|
|
|
|
ANDROID_NS = 'http://schemas.android.com/apk/res/android'
|
|
|
@@ -19,16 +16,19 @@ def script_second(SDK, decompileDir, channelSdkInfo, new_game_channel_info, game
|
|
|
if os.path.exists(progress_png):
|
|
|
os.remove(progress_png)
|
|
|
return
|
|
|
+
|
|
|
+
|
|
|
def script_second(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
|
|
|
modify_manifest_common(decompileDir, "allowNativeHeapPointerTagging")
|
|
|
return
|
|
|
|
|
|
+
|
|
|
def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
|
|
|
logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
|
|
|
if channelSdkInfo['id'] == '549':
|
|
|
del_coolcloud(decompileDir)
|
|
|
- # replace_Theme(decompileDir)
|
|
|
modify_manifest_common(decompileDir, "allowNativeHeapPointerTagging")
|
|
|
+ app_theme(decompileDir)
|
|
|
|
|
|
|
|
|
def del_coolcloud(decompileDir):
|
|
|
@@ -53,6 +53,22 @@ def replace_Theme(extract_dir):
|
|
|
tf.write(cont)
|
|
|
|
|
|
|
|
|
+def app_theme(decompile_dir_path):
|
|
|
+ style_xml_path = os.path.join(decompile_dir_path, 'res', 'values', 'styles.xml')
|
|
|
+ xml_tree = ET.parse(style_xml_path)
|
|
|
+ xml_root = xml_tree.getroot()
|
|
|
+ style_roots = xml_root.findall('./style')
|
|
|
+ for style_root in style_roots:
|
|
|
+ if style_root.get('name') == 'AppTheme':
|
|
|
+ print style_root.get('parent')
|
|
|
+ style_root.set('parent', '@android:style/Theme.NoTitleBar.Fullscreen')
|
|
|
+ # 在 Python 2 中,需要手动处理编码
|
|
|
+ with open(style_xml_path, 'w') as f:
|
|
|
+ f.write('<?xml version="1.0" encoding="utf-8"?>\n')
|
|
|
+ f.write(ET.tostring(xml_root, encoding='utf-8'))
|
|
|
+ break
|
|
|
+
|
|
|
+
|
|
|
def handle_public_xml(public_xml_path, remove_node):
|
|
|
if not os.path.exists(public_xml_path):
|
|
|
logging.info('public_xml is null: ' + public_xml_path)
|
|
|
@@ -93,4 +109,5 @@ def modify_manifest_common(decompileDir, removeKey):
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- del_coolcloud("C:\\Users\\Administrator\\Desktop\\Shadow")
|
|
|
+ d="D://work//autopack3//tool//outputGame//admin@163.com//xinxiaaojianghukp//1.0.260//xinxiaaojianghukp_39"
|
|
|
+ app_theme(d)
|