DONGGUOLIANGNEW\edy 1 год назад
Родитель
Сommit
1af33c98f1
1 измененных файлов с 32 добавлено и 0 удалено
  1. 32 0
      魔法学院百度/script.py

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

@@ -0,0 +1,32 @@
+# coding:utf8
+
+__author__ = 'dong'
+
+from xml.dom.minidom import parse
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+from xml.etree.ElementTree import ElementTree, Element
+import distutils.dir_util
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    file_path = os.path.join(decompileDir, "AndroidManifest.xml")
+    dom = parse(file_path)
+    # root = dom.documentElement
+    activities = dom.getElementsByTagName('activity')
+    for activity in activities:
+        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') == '':
+                activity.removeChild(intent_filter)
+    with open(file_path, 'w') as f:
+        f.write(dom.toxml())
+
+
+if __name__ == '__main__':
+    script_last("",u'',"","","")