Explorar o código

添加4个游戏

DONGGUOLIANGNEW\edy hai 1 ano
pai
achega
919bcec54f

+ 32 - 0
万世镜酷派/script.py

@@ -0,0 +1,32 @@
+# 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")
+
+
+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', {}, {}, {})

+ 36 - 0
吟游战记酷派/script.py

@@ -0,0 +1,36 @@
+# 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 'com.yulong.android.paysdk.view.pay.CoolPaySDKActivity' == activity_name:
+        #     activity_node.set(namespace + 'screenOrientation', 'landscape')
+        #     xml_tree.write(manifest_path, encoding=u'utf-8', xml_declaration=True)
+
+
+if __name__ == '__main__':
+    ""

+ 40 - 0
百川铸魂录酷派/script.py

@@ -0,0 +1,40 @@
+# 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_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    handle_style(extract_dir)
+    return
+
+
+def handle_style(decompile_dir_path):
+    style_xml_path = os.path.join(decompile_dir_path, 'res', 'values', 'styles.xml')
+    xml_tree = ET.parse(style_xml_path)
+    xml_root = xml_tree.getroot()
+    style_roots = xml_root.findall('./style')
+    for style_root in style_roots:
+        if style_root.get('name') == 'AppTheme':
+            print(style_root.get('parent'))
+            style_root.set('parent', '@style/Theme.AppCompat.Light.NoActionBar')
+            xml_tree.write(style_xml_path, encoding='utf-8', xml_declaration=True)
+            break
+
+
+if __name__ == '__main__':
+    d="D:/work/guanyu"
+    handle_style(d)
+    # replace_super_application("D:\work\wzdq")
+    # modify_manifest("E:\\apk\\youhua\\youhua.zip.out", "requestLegacyExternalStorage")

+ 38 - 0
锦绣江湖酷派/script.py

@@ -15,6 +15,10 @@ def script(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_in
     remove_app_icon(app_icon)
 
 
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    fix_coolyun_application_getinstance_null_bug(decompileDir)
+
+
 def remove_app_icon(icon_path):
     if not os.path.exists(icon_path):
         logging.info('public_xml is null: ' + icon_path)
@@ -22,5 +26,39 @@ def remove_app_icon(icon_path):
     os.remove(icon_path)
 
 
+def fix_coolyun_application_getinstance_null_bug(decompile_dir):
+    insert_str_list = [
+        '\n\t.locals 1\n\n',
+        '\tsget-object v0, Lcom/coolyun/framework/CoolYunApplication;->application:Landroid/content/Context;\n\n',
+        '\tcheck-cast v0, Lcom/coolyun/framework/CoolYunApplication;\n\n',
+        '\treturn-object v0\n\n']
+    for dirpath, dirnames, filenames in os.walk(decompile_dir):
+        if r'com\coolyun\framework' in dirpath and 'CoolYunApplication.smali' in filenames:
+            smali_path = os.path.join(dirpath, 'CoolYunApplication.smali')
+            with open(smali_path, 'r') as f:
+                smali_str_arr = f.readlines()
+                index_str = '.method public static getInstance()Lcom/coolyun/framework/CoolYunApplication;'
+                end_method_str = '.end method'
+                insert_str = ''.join(insert_str_list)
+                on_create_index = 0
+                insert_index = 0
+                for line in smali_str_arr:
+                    if index_str in line:
+                        on_create_index = smali_str_arr.index(line)
+                        print('on_create_index', on_create_index, line)
+                        break
+                for index, value in enumerate(smali_str_arr):
+                    if index > on_create_index and end_method_str in value:
+                        insert_index = index
+                        print('insert_index', index)
+                        break
+                print(on_create_index, insert_index)
+                del smali_str_arr[on_create_index + 1:insert_index]
+                smali_str_arr.insert(on_create_index + 1, insert_str)
+            with open(smali_path, 'w') as f:
+                f.write(''.join(smali_str_arr))
+                break
+
+
 if __name__ == '__main__':
     script('', 'E:/script_test', {}, {}, {})