Просмотр исходного кода

新增第五人格酷派与阴阳师百度脚本

dongguoliang@kuaifazs.com лет назад: 4
Родитель
Сommit
8a067555b5

BIN
yiqibuyu360/39285EFA.dex


+ 0 - 252
yiqibuyu360/script.py

@@ -1,252 +0,0 @@
-# coding:utf8
-
-__author__ = 'yiqibuyu360'
-
-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
-import gw_file_system
-import gw_data_center
-
-from xml.etree import ElementTree as ET
-
-ANDROID_NS = 'http://schemas.android.com/apk/res/android'
-
-
-def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
-    gw_data_center.pack_small = False
-
-
-def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
-    logging.info("-----debug exec first func-----")
-    # game_apk = os.path.join(decompileDir, "game.apk")
-    game_apk = decompileDir + "/../game.apk"
-    if os.path.exists(game_apk):
-        gw_file_system.delete_apk_file_by_aapt(game_apk, "assets/39285EFA.dex")
-    logging.info("-----debug-----")
-
-
-def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
-    assets_dex = os.path.join(decompileDir, "../39285EFA.dex")
-    assets_dir = os.path.join(decompileDir, "assets/39285EFA.dex")
-    logging.info(assets_dex)
-    logging.info(assets_dir)
-    logging.info(SDK)
-    if os.path.exists(assets_dex):
-        gw_file_system.copy_file(assets_dex, assets_dir)
-
-
-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 = 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)
-
-
-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 + '}authorities'
-    package_name = root.attrib.get('package')
-    if package_name == None:
-        return
-    providers = root.findall('./application/provider')
-    if providers != None:
-        for provider in providers:
-            providerName = provider.attrib.get(name)
-
-            if 'com.game.sdk.provider.GameFileProvider' == providerName:
-                provider.set(authorities, package_name + ".sdkinsapk")
-
-            if 'android.support.v4.content.FileProvider' == providerName:
-                root.find('./application').remove(provider)
-
-    root_node.write(xmlparse, 'utf-8')
-
-
-def del_android(decompileDir):
-    android = os.path.join(decompileDir, 'smali/android/support/v4')
-    if os.path.exists(android):
-        shutil.rmtree(android)
-
-
-def add_checkSelfPermission(extract_dir):
-    goal_file = os.path.join(extract_dir, 'smali/android/support/haojieru/v4/content/ContextCompat.smali')
-    if os.path.isfile(goal_file):
-        with open(goal_file, 'r+') as f:
-            lines = f.readlines()
-            method = ['.method public static checkSelfPermission(Landroid/content/Context;Ljava/lang/String;)I\n',
-                      '    .locals 2\n',
-                      '    .param p0, "context"    # Landroid/content/Context;\n',
-                      '         .annotation build Landroid/support/annotation/NonNull;\n',
-                      '         .end annotation\n',
-                      '    .end param\n',
-                      '    .param p1, "permission"    # Ljava/lang/String;\n',
-                      '         .annotation build Landroid/support/annotation/NonNull;\n',
-                      '         .end annotation\n',
-                      '    .end param\n',
-                      '    if-eqz p1, :cond_0\n',
-                      '    invoke-static {}, Landroid/os/Process;->myPid()I\n',
-                      '    move-result v0\n',
-                      '    invoke-static {}, Landroid/os/Process;->myUid()I\n',
-                      '    move-result v1\n',
-                      '    invoke-virtual {p0, p1, v0, v1}, Landroid/content/Context;->checkPermission(Ljava/lang/String;II)I\n',
-                      '    move-result v0\n',
-                      '    return v0\n',
-                      '    :cond_0\n',
-                      '    new-instance v0, Ljava/lang/IllegalArgumentException;\n',
-                      '    const-string v1, "permission is null"\n',
-                      '    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V\n',
-                      '    throw v0\n',
-                      '.end method']
-            for i in method:
-                lines.append(i)
-        with open(goal_file, 'w') as fl:
-            fl.write(''.join(lines))
-
-
-def del_okhttp_okio(extract_dir):
-    okhttp3 = os.path.join(extract_dir, 'smali/okhttp3')
-    if os.path.exists(okhttp3):
-        shutil.rmtree(okhttp3)
-
-    okio = os.path.join(extract_dir, 'smali/okio')
-    if os.path.exists(okio):
-        shutil.rmtree(okio)
-
-
-def replace_emoj_textview(extract_dir):
-    goal_file = os.path.join(extract_dir, 'res/layout/recycler_mail_list_item.xml')
-    print(os.path.isfile(goal_file))
-    if os.path.isfile(goal_file):
-        logging.info('method_proceed: ' + 'goal_file')
-        print(goal_file)
-        with open(goal_file, 'r+') as f:
-            cont = f.read()
-            change_str = 'com.elex.chatservice.view.emoj.EmojTextView'
-            str = 'TextView'
-            cont = cont.replace(change_str, str)
-            logging.info('replace_str: ' + cont)
-        with open(goal_file, 'w+') as tf:
-            tf.write(cont)
-    goal_file_2 = os.path.join(extract_dir, 'res/layout/msgitem_message_receive.xml')
-    print(os.path.isfile(goal_file_2))
-    if os.path.isfile(goal_file_2):
-        logging.info('method_proceed: ' + 'goal_file')
-        print(goal_file_2)
-        with open(goal_file_2, 'r+') as f:
-            cont = f.read()
-            change_str = 'com.elex.chatservice.view.emoj.EmojTextView'
-            str = 'TextView'
-            cont = cont.replace(change_str, str)
-            logging.info('replace_str: ' + cont)
-        with open(goal_file_2, 'w+') as tf:
-            tf.write(cont)
-    goal_file_3 = os.path.join(extract_dir, 'res/layout/msgitem_message_send.xml')
-    print(os.path.isfile(goal_file_3))
-    if os.path.isfile(goal_file_3):
-        logging.info('method_proceed: ' + 'goal_file')
-        print(goal_file_3)
-        with open(goal_file_3, 'r+') as f:
-            cont = f.read()
-            change_str = 'com.elex.chatservice.view.emoj.EmojTextView'
-            str = 'TextView'
-            cont = cont.replace(change_str, str)
-            logging.info('replace_str: ' + cont)
-        with open(goal_file_3, 'w+') as tf:
-            tf.write(cont)
-
-
-def replace_weboshare(decompileDir):
-    src = os.path.join(decompileDir.replace('extract', ''), 'WeiBoShare.smali')
-    print(src)
-    logging.info('--------------src path:' + src)
-    dest = os.path.join(decompileDir, 'smali_classes4/com/clash/of/share/WeiBoShare.smali')
-    print(dest)
-    logging.info('--------------dest path:' + dest)
-    shutil.copyfile(src, dest)
-
-def comment_logout_method(decompileDir):
-    goal_file = os.path.join(decompileDir, 'smali/com/gameworks/sdk/standard/core/SDKKitCore.smali')
-    print(os.path.isfile(goal_file))
-    if os.path.isfile(goal_file):
-        logging.info('method_proceed: ' + 'goal_file')
-        print(goal_file)
-        with open(goal_file, 'r+') as f:
-            cont = f.read()
-            change_str = 'invoke-virtual {v0}, Lcom/game/sdk/HuosdkManager;->logout()V'
-            str = '#invoke-virtual {v0}, Lcom/game/sdk/HuosdkManager;->logout()V'
-            cont = cont.replace(change_str, str)
-            logging.info('replace_str: ' + cont)
-        with open(goal_file, 'w+') as tf:
-            tf.write(cont)
-
-
-def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
-    sdk_id = channelSdkInfo['id']
-    # 坚果渠道
-    if (sdk_id == "413"):
-        del_android(decompileDir)
-        replace_emoj_textview(decompileDir)
-    # 遥望渠道id
-    if (sdk_id == "412"):
-        add_checkSelfPermission(decompileDir)
-    # 小七手游id 389
-    if (sdk_id == "389"):
-        del_okhttp_okio(decompileDir)
-    # 游戏fan id 380
-    if (sdk_id == '380'):
-        replace_emoj_textview(decompileDir)
-        modify_manifest(decompileDir)
-    # 掌上科技
-    if channelSdkInfo['SDKName'] == 'zskj':
-        replace_weboshare(decompileDir)
-        comment_logout_method(decompileDir)
-
-
-def handle_public_xml(public_xml_path):
-    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("wrap_content") > -1:
-                continue
-            new_lines.append(line)
-        f.seek(0)
-        f.truncate()
-        f.writelines(new_lines)
-    return
-
-
-if __name__ == '__main__':
-    # script("", "E:\\apk\\youhua\\LYJY360_12412_360逆向_1.23.00", "", "", "")
-    handle_public_xml("public.xml")

BIN
yiqibuyu360/script.pyc


BIN
yiqibuyu360/yiqibuyu360.zip


+ 46 - 0
捕鱼大世界酷派/script.py

@@ -0,0 +1,46 @@
+# coding:utf8
+
+__author__ = 'Snow'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+import distutils.dir_util
+import gw_file_system
+import gw_data_center
+import gw_apk_tool
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+from xml.etree import ElementTree as ET
+
+
+def script_init(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script_pre(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':
+        s1 = os.path.join(decompileDir, "smali")
+        smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+        s3 = smali_classes2_dir
+        list_package = ["androidx"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        gw_apk_tool.move_package(s1, s3, list_package)
+
+
+if __name__ == '__main__':
+    del_hjr("C:\\Users\\Administrator\\Desktop\\Shadow")

+ 44 - 0
灵文对决酷派/script.py

@@ -0,0 +1,44 @@
+# coding:utf8
+
+__author__ = 'Snow'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+import distutils.dir_util
+import gw_file_system
+import gw_data_center
+import gw_apk_tool
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+from xml.etree import ElementTree as ET
+
+
+def script_init(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script_pre(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))
+    s1 = os.path.join(decompileDir, "smali_classes4/com")
+    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+    s3 = smali_classes2_dir
+    list_package = ["heytap","huawei","iflytek","jg","kptech","leniu"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    gw_apk_tool.move_package(s1, s3, list_package)
+
+
+if __name__ == '__main__':
+    del_hjr("C:\\Users\\Administrator\\Desktop\\Shadow")

+ 104 - 13
第五人格酷派/script.py

@@ -11,6 +11,7 @@ import glob
 import distutils.dir_util
 import gw_file_system
 import gw_data_center
+import gw_apk_tool
 
 
 def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
@@ -46,7 +47,6 @@ def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
     if not os.path.exists(s3):
         distutils.dir_util.mkpath(s3)
     move_package(s1, s3, list_package)
-
     logging.info("-----debug-----")
 
 
@@ -60,23 +60,114 @@ def move_package(s1, s3, list_package):
 
 
 def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
-    # logging.info('------------SDK:'+SDK)
-    # logging.info('------------decompileDir:'+decompileDir)
-    # logging.info('------------channelSdkInfo:'+str(channelSdkInfo))
-    # logging.info('------------new_game_channel_info:'+str(new_game_channel_info))
-    # logging.info('------------gameInfo:'+str(gameInfo))
-    # logging.info("------rm baidu smali------")
-    # restdir = decompileDir+"/"+"smali_classes2/com/baidu/gamesdk"
-    # if os.path.exists(restdir):
-    # shutil.rmtree(restdir)
-
-    # s3 = decompileDir + "/smali_classes3"
-
     logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
     if channelSdkInfo['id'] == '549' or channelSdkInfo['id'] == '413' or channelSdkInfo['SDKName'] == 'ludashi':
         del_hjr(decompileDir)
         add_do_not_compress(decompileDir)
 
+    s1 = os.path.join(decompileDir, "smali_classes5")
+    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+    s3 = smali_classes2_dir
+    list_package = ["com"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    gw_apk_tool.move_package(s1, s3, list_package)
+    logging.info("script move smali_classe5")
+    logging.info(smali_classes2_dir)
+
+    s1 = os.path.join(decompileDir, "smali_classes6", "com")
+    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["netease", "nineoldandroids", "noah", "nostra13", "orhanobut", "rxjava", "squareup", "ta",
+                    "tencent", "webank", "weibo", "yulong"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    gw_apk_tool.move_package(s1, s3, list_package)
+    logging.info("script move smali_classe6")
+    logging.info(list_package)
+    logging.info(smali_classes2_dir)
+
+    s1 = os.path.join(decompileDir, "smali_classes6", "com")
+    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["huya", "huyaudb", "huyaudbunify", "hy"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    gw_apk_tool.move_package(s1, s3, list_package)
+    logging.info("script move smali_classe6")
+    logging.info(list_package)
+    logging.info(smali_classes2_dir)
+
+    s1 = os.path.join(decompileDir, "smali_classes7", "com")
+    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["alibaba", "douyu", "facebook", "huyaudb", "JavaWebsocket", "noah", "sina", "tencent", "aspsine",
+                    "duowan", "geetest", "huyaudbunify", "mcxiaoke", "nostra13", "squareup", "ut", "bumptech", "dy",
+                    "getkeepsafe", "ishumei", "netease", "random", "sun", "webank", "coolcloud", "example", "google",
+                    "j256", "nineoldandroids", "samsung", "ta", "yulong"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    gw_apk_tool.move_package(s1, s3, list_package)
+    logging.info("script move smali_classe7")
+    logging.info(list_package)
+    logging.info(smali_classes2_dir)
+
+    s1 = os.path.join(decompileDir, "smali_classes7", "com/huya")
+    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+    s3 = os.path.join(smali_classes2_dir, "com/huya")
+    list_package = ["android", "ciku", "data", "hyhttpdns", "hysignal", "live", "statistics", "berry", "component",
+                    "force", "hyquic", "hyssl", "livestatistics"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    gw_apk_tool.move_package(s1, s3, list_package)
+    logging.info("script move smali_classe7")
+    logging.info(list_package)
+    logging.info(smali_classes2_dir)
+
+    s1 = os.path.join(decompileDir, "smali_classes7", "com/huya")
+    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+    s3 = os.path.join(smali_classes2_dir, "com/huya")
+    list_package = ["mtp"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    gw_apk_tool.move_package(s1, s3, list_package)
+    logging.info("script move smali_classe7")
+    logging.info(list_package)
+    logging.info(smali_classes2_dir)
+
+    s1 = os.path.join(decompileDir, "smali_classes8", "com/netease")
+    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+    s3 = os.path.join(smali_classes2_dir, "com/netease")
+    list_package = ["ntunisdk"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    gw_apk_tool.move_package(s1, s3, list_package)
+    logging.info("script move smali_classe8")
+    logging.info(list_package)
+    logging.info(smali_classes2_dir)
+
+    s1 = os.path.join(decompileDir, "smali_classes6", "com")
+    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["douyu", "duowan", "example", "huya"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    gw_apk_tool.move_package(s1, s3, list_package)
+    logging.info("script move smali_classe6")
+    logging.info(list_package)
+    logging.info(smali_classes2_dir)
+
+    s1 = os.path.join(decompileDir, "smali_classes10", "com/huya/berry")
+    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
+    s3 = os.path.join(smali_classes2_dir, "com/huya/berry")
+    list_package = ["client", "endlive", "forcelive", "gamesdk", "login", "modifynickname", "modifytitle"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    gw_apk_tool.move_package(s1, s3, list_package)
+    logging.info("script move smali_classe10")
+    logging.info(list_package)
+    logging.info(smali_classes2_dir)
+
 
 def add_do_not_compress(extract_dir):
     goal_file = os.path.join(extract_dir, 'apktool.yml')

BIN
第五人格酷派/script.pyc


BIN
第五人格酷派/第五人格酷派.zip


+ 40 - 0
阴阳师百度/script.py

@@ -63,6 +63,46 @@ def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_chann
             distutils.dir_util.mkpath(s3)
             move_package(s1, s3, list_package)
 
+        s1 = os.path.join(extract_dir, "smali_classes5", "com/netease")
+        smali_classes2_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_classes2_dir, "com", "netease")
+        list_package = ["a","amap","autonavi","bun","duoku","github","googlecode","huawei"," mcs","mp4parser","alipayx","asus","baidu","coremedia","example","google","heytap","JavaWebsocket","meizu"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(extract_dir, "smali_classes5", "com")
+        smali_classes2_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_classes2_dir, "com")
+        list_package = ["a","amap","autonavi","bun","duoku","github","googlecode","huawei"," mcs","mp4parser","alipayx","asus","baidu","coremedia","example","google","heytap","JavaWebsocket","meizu"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(extract_dir, "smali_classes5", "com")
+        smali_classes2_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_classes2_dir, "com")
+        list_package = ["netease","noah","random","samsung","sina","tax","tencent","utx","vivo","xiaomi","zui"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(extract_dir, "smali_classes6", "com/netease")
+        smali_classes2_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_classes2_dir, "com", "netease")
+        list_package = ["ntunisdk"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(extract_dir, "smali_classes6", "com/netease")
+        smali_classes2_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_classes2_dir, "com", "netease")
+        list_package = ["onmyoji","unisdk"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
 
 def move_package(s1, s3, list_package):
     for d in list_package:

BIN
阴阳师百度/script.pyc


BIN
阴阳师百度/阴阳师百度.zip