DONGGUOLIANGNEW\edy 1 år sedan
förälder
incheckning
3122d0c629
2 ändrade filer med 35 tillägg och 0 borttagningar
  1. 33 0
      小小蚁国酷派/script.py
  2. 2 0
      放开那三国3酷派/script.py

+ 33 - 0
小小蚁国酷派/script.py

@@ -0,0 +1,33 @@
+# coding:utf8
+import os
+import logging
+
+ANDROID_NAMESPACE = 'http://schemas.android.com/apk/res/android'
+logger = logging.getLogger('script.py')
+
+def script_last(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, "app_icon_round")
+    handle_public_xml(public_xml, "icon_name")
+    handle_public_xml(public_xml, "icon_name_round")
+
+
+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
+
+
+if __name__ == '__main__':
+    script_last('', 'E:/script_test', {}, {}, {})

+ 2 - 0
放开那三国3酷派/script.py

@@ -1,6 +1,7 @@
 # coding:utf8
 import os
 import logging
+
 ANDROID_NAMESPACE = 'http://schemas.android.com/apk/res/android'
 logger = logging.getLogger('script.py')
 
@@ -9,6 +10,7 @@ def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_chann
     public_xml = os.path.join(extract_dir, "res/values/public.xml")
     handle_public_xml(public_xml, "app_icon_round")
 
+
 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)