|
|
@@ -1,6 +1,14 @@
|
|
|
# -*- coding:utf-8 -*-
|
|
|
import os
|
|
|
import logging
|
|
|
+
|
|
|
+def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
|
|
|
+ public_xml = os.path.join(extract_dir, "res/values/public.xml")
|
|
|
+ handle_public_xml(public_xml, "ratio")
|
|
|
+ handle_public_xml(public_xml, "graph")
|
|
|
+ handle_public_xml(public_xml, "graph_wrap")
|
|
|
+
|
|
|
+
|
|
|
def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
|
|
|
print "script last snow"
|
|
|
# 修复酷派新sdk 3.0接口方法名改变登录后闪退bug
|
|
|
@@ -9,6 +17,21 @@ def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_chann
|
|
|
if is_version_3_sdk:
|
|
|
fix_coolpad_version_3_login_fail_bug(extract_dir)
|
|
|
|
|
|
+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)
|
|
|
+ return
|
|
|
+ new_lines = []
|
|
|
+ with open(public_xml_path, 'r+') as f:
|
|
|
+ for line in f.readlines():
|
|
|
+ # l = line.strip()
|
|
|
+ if line.find(remove_node) > -1:
|
|
|
+ continue
|
|
|
+ new_lines.append(line)
|
|
|
+ f.seek(0)
|
|
|
+ f.truncate()
|
|
|
+ f.writelines(new_lines)
|
|
|
+ return
|
|
|
|
|
|
def fix_coolpad_version_3_method_name_change_bug(decompile_dir):
|
|
|
is_version_3_sdk = False
|