Преглед изворни кода

修改1个游戏,新增3个游戏

DONGGUOLIANGNEW\edy пре 1 година
родитељ
комит
1eb9a0fb94

+ 1 - 1
一梦江湖酷派/script.py

@@ -80,7 +80,7 @@ def modify_manifest(decompileDir):
     if providers != None:
         for provider in providers:
             providerName = provider.attrib.get(name)
-            if 'com.netease.ntunisdk.CcMomentRecordingForegroundService' == providerName:
+            if 'com.wanmei.pwim.ScreenRecorder.ScreenRecorderService' == providerName:
                 # 使用try 主要是为了 防止此属性不在时,导致的错误,而程序终止
                 try:
                     del provider.attrib[authorities]

BIN
一梦江湖酷派/script.pyc


+ 33 - 0
仙剑奇侠传新的开始酷派酷云/script.py

@@ -0,0 +1,33 @@
+# coding:utf8
+
+__author__ = '极无双'
+
+import os
+from xml.etree import ElementTree as ET
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    fix_fake_recharge_screen_orientation_portrait(decompileDir)
+
+
+def fix_fake_recharge_screen_orientation_portrait(decompile_dir_path):
+    namespace = '{http://schemas.android.com/apk/res/android}'
+    ET._namespace_map['android'] = 'http://schemas.android.com/apk/res/android'
+
+    manifest_path = os.path.join(decompile_dir_path, 'AndroidManifest.xml')
+    xml_tree = ET.parse(manifest_path)
+    xml_root = xml_tree.getroot()
+    activity_nodes = xml_root.findall('.//activity')
+    print activity_nodes
+    for activity_node in activity_nodes:
+        print activity_node.attrib
+        activity_name = activity_node.get(namespace + 'name')
+        print activity_name
+        if 'com.cccolyun.sdkkit.gameplatform.paysdk.view.activity.CoolPaySDKActivity' == activity_name:
+            activity_node.set(namespace + 'screenOrientation', 'portrait')
+            xml_tree.write(manifest_path, encoding=u'utf-8', xml_declaration=True)
+            break
+
+
+if __name__ == '__main__':
+    ""

+ 39 - 0
完美世界诸神之战酷云/script.py

@@ -0,0 +1,39 @@
+# coding:utf8
+import os
+import xml.etree.ElementTree as ET
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    modify_manifest(extract_dir)
+
+
+def modify_manifest(decompileDir):
+    ET.register_namespace('android', ANDROID_NS)
+    xmlparse = os.path.join(decompileDir, 'AndroidManifest.xml')
+    root_node = ET.parse(xmlparse)
+    root = root_node.getroot()
+    name = '{' + ANDROID_NS + '}name'
+    authorities = '{' + ANDROID_NS + '}foregroundServiceType'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application/service')
+    if providers != None:
+        for provider in providers:
+            providerName = provider.attrib.get(name)
+            if 'com.wanmei.pwim.ScreenRecorder.ScreenRecorderService' == providerName:
+                # 使用try 主要是为了 防止此属性不在时,导致的错误,而程序终止
+                try:
+                    del provider.attrib[authorities]
+                except:
+                    ""
+
+    root_node.write(xmlparse, 'utf-8')
+
+
+if __name__ == '__main__':
+    # script("/tmp/ss", "/mnt/share/yanghuang/python_test/any_dir", {"id": "309"}, "", "")
+    xml_path = "E:/apk/youhua/jingmenfengyue_216122/res/values/public.xml"
+    # hideSplash("/mnt/share/yanghuang/python_test/cr")

+ 57 - 0
神宠大作战2百度/script.py

@@ -0,0 +1,57 @@
+# coding:utf8
+
+__author__ = 'dong'
+
+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
+from xml.etree import ElementTree as ET
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_second(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, "debugger")
+    handle_public_xml(public_xml, "mms_cfg")
+    handle_public_xml(public_xml, "ss_cfg")
+    handle_public_xml(public_xml, "ss_sgn")
+
+    raws_xml = os.path.join(extract_dir, "res/values/raws.xml")
+    os.remove(raws_xml)
+    return
+
+
+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 script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info("-----debug-----")
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+if __name__ == '__main__':
+    # replace_super_application("D:\work\wzdq")
+    ""