DONGGUOLIANGNEW\edy 1 год назад
Родитель
Сommit
81a286f9d4

BIN
一拳超人酷派/Xrz1uL.zip


Разница между файлами не показана из-за своего большого размера
+ 21 - 41
一拳超人酷派/script.py


BIN
一拳超人酷派/script.pyc


BIN
一拳超人酷派/一拳超人酷派.zip


+ 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', 'landscape')
+            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__':
+    ""

+ 53 - 0
塔防召唤师/script.py

@@ -0,0 +1,53 @@
+# coding:utf8
+
+__author__ = '灌篮高手酷派'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+
+import distutils.dir_util
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    fix_coolyun_application_getinstance_null_bug(decompileDir)
+
+
+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__':
+    ""

+ 45 - 0
山海镜花酷派/script.py

@@ -0,0 +1,45 @@
+# 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):
+    for dirpath, dirnames, filenames in os.walk(decompile_dir_path):
+        if r'com\youzu\gamexy' in dirpath and 'Game.smali' in filenames:
+            smali_path = os.path.join(dirpath, 'Game.smali')
+            print(smali_path)
+            f = open(smali_path, 'r')
+            smali_str_arr = f.readlines()
+            f.close()
+            for line in smali_str_arr:
+                if 'invoke-static {p0}, Lcom/youzu/gamexy/Game;->Init(Landroid/content/Context;)V' in line:
+                    smali_str_arr[smali_str_arr.index(
+                        line)] = '\t#invoke-static {p0}, Lcom/youzu/gamexy/Game;->Init(Landroid/content/Context;)V\n'
+            f = open(smali_path, 'w')
+            f.write(''.join(smali_str_arr))
+            f.close()
+
+    developer_path = os.path.join(decompile_dir_path, 'assets', 'developer.properties')
+    print(developer_path)
+    f = open(developer_path, 'r')
+    smali_str_arr = f.readlines()
+    f.close()
+
+    for line in smali_str_arr:
+        if 'isRealname' in line:
+            smali_str_arr[smali_str_arr.index(line)] = line.replace('1', '0')
+            break
+
+    f = open(developer_path, 'w')
+    f.write(''.join(smali_str_arr))
+    f.close()
+
+if __name__ == '__main__':
+    ""

+ 36 - 196
杜拉拉升职记酷派/script.py

@@ -12,202 +12,42 @@ import glob
 import distutils.dir_util
 
 
-def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
-    return
-
 def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
-    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
-
-    if channelSdkInfo['id'] == '549' or channelSdkInfo['id'] == '591':
-        s1 = os.path.join(decompileDir, "smali_classes19","com","haowanyou")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com","haowanyou")
-            list_package = ["router","sdkaes","sdkpermission","session","tool","tracepath","xmltojson"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-    if channelSdkInfo['id'] == '597':
-        s1 = os.path.join(decompileDir, "smali")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new)
-            list_package = ["androidx"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes2","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["samsung","sdk","splash","tencent","twobigears","unionpay","unity","unity3d","wysd","ycsdk","yulong","yysg","zndroid","zui"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes2","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["google","haowanyou","huawei","hwy","ipaynow","jaredrummler","luoshihai","mob","netease","onevcat","push"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes2","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["luoshihai","mob","netease","onevcat","push"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes2","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["hwy","ipaynow","jaredrummler"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes2","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["haowanyou"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes4")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new)
-            list_package = ["com"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes5","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["faceunity","friendtime","friendtimes"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes7","androidx")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
-            list_package = ["appcompat","asynclayoutinflater","coordinatorlayout","cursoradapter","documentfile","fragment","arch","collection","core","customview","drawerlayout","interpolator"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes9","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["google","haowanyou","huawei","hwy","ipaynow","jaredrummler"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes9","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["google","huawei"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes9","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["hwy","ipaynow","jaredrummler"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes9","com","haowanyou")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com","haowanyou")
-            list_package = ["application","channel","common","core","event","multibundle","react"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes9","com","haowanyou")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com","haowanyou")
-            list_package = ["react_native","reactnative","router","sdkaes","sdkpermission","session","tool","tracepath","xmltojson"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes9","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["mob"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes16","com")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com")
-            list_package = ["haowanyou"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-        s1 = os.path.join(decompileDir, "smali_classes20","com/haowanyou")
-        if os.path.exists(s1):
-            smali_classes_new = create_mutil_smali(decompileDir)
-            s3 = os.path.join(decompileDir, smali_classes_new,"com/haowanyou")
-            list_package = ["application","channel","common","core","event","multibundle","react","react_native","reactnative"]
-            if not os.path.exists(s3):
-                distutils.dir_util.mkpath(s3)
-            move_package(s1, s3, list_package)
-
-
-def create_mutil_smali(decompileDir):
-    f_idx = 2
-    while True:
-        # tmp = gw_file_system.get_full_path(os.path.join(decompileDir, 'smali_classes%d' % f_idx))
-        tmp = os.path.join(decompileDir, 'smali_classes%d' % f_idx)
-        tmp = tmp.replace('\\', '/')
-        tmp = re.sub('/+', '/', tmp)
-        if os.path.exists(tmp):
-            f_idx += 1
-        else:
-            smali_classes2_dir = tmp
-            break
-    # endwhile
-    os.mkdir(smali_classes2_dir)
-    return smali_classes2_dir
-
-
-def move_package(s1, s3, list_package):
-    for d in list_package:
-        src = os.path.join(s1, d)
-        if os.path.exists(src):
-            dst = os.path.join(s3, d)
-            distutils.dir_util.copy_tree(src, dst)
-            distutils.dir_util.remove_tree(src)
-
+    fix_coolyun_application_getinstance_null_bug(decompileDir)
+
+
+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__':
-    replace_life_method("D:\\work\\xmy")
+    ""