ソースを参照

天天帝国百度脚本
删除app_icon_round

DONGGUOLIANGNEW\edy 1 年間 前
コミット
ec4efd1c62
共有2 個のファイルを変更した37 個の追加1 個の削除を含む
  1. 36 0
      天天帝国百度/script.py
  2. 1 1
      魔法学院百度/script.py

+ 36 - 0
天天帝国百度/script.py

@@ -0,0 +1,36 @@
+# coding:utf8
+import os
+import xml.etree.ElementTree as ET
+import logging
+import re
+import codecs
+import distutils.dir_util
+import gw_file_system
+
+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")
+
+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', {}, {}, {})

+ 1 - 1
魔法学院百度/script.py

@@ -22,7 +22,7 @@ def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameIn
         intent_filters = activity.getElementsByTagName('intent-filter')
         for intent_filter in intent_filters:
             actions = intent_filter.getElementsByTagName('action')
-            if len(actions) == 1 and actions[0].getAttribute('name') == '':
+            if len(actions) == 1 and actions[0].getAttribute('android:name') == '':
                 activity.removeChild(intent_filter)
     with open(file_path, 'w') as f:
         f.write(dom.toxml())