dongguoliang@kuaifazs.com 3 年 前
コミット
50b2706caa

+ 141 - 0
全明星激斗酷派/script.py

@@ -0,0 +1,141 @@
+# 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
+import gw_file_system
+
+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):
+    logging.info('script_second: ' + str(channel_sdk_info))
+    # 逆向渠道id
+
+    if  channel_sdk_info['id'] == '597':
+        public_xml = os.path.join(extract_dir, "res/values/public.xml")
+        handle_public_xml(public_xml, "attr-private")
+    # handle_public_xml(public_xml, "sobot_fileEndingExcel")
+    # handle_public_xml(public_xml, "sobot_fileEndingImage")
+    # handle_public_xml(public_xml, "sobot_fileEndingPPT")
+    # handle_public_xml(public_xml, "sobot_fileEndingPackage")
+    # handle_public_xml(public_xml, "sobot_fileEndingPdf")
+    # handle_public_xml(public_xml, "sobot_fileEndingText")
+    # handle_public_xml(public_xml, "sobot_fileEndingVideo")
+    # handle_public_xml(public_xml, "sobot_fileEndingWord")
+
+    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
+
+
+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 move_package_one(src, dst):
+    if os.path.exists(src):
+        distutils.dir_util.copy_tree(src, dst)
+        distutils.dir_util.remove_tree(src)
+
+
+change_map = {".super Landroid/app/Application;": ".super Lcom/kf/framework/KFApplication;",
+              "invoke-direct {p0}, Landroid/app/Application;-><init>()V": "invoke-direct {p0}, Lcom/kf/framework/KFApplication;-><init>()V",
+              "invoke-super {p0, p1}, Landroid/app/Application;->attachBaseContext(Landroid/content/Context;)V": "invoke-super {p0, p1}, Lcom/kf/framework/KFApplication;->attachBaseContext(Landroid/content/Context;)V",
+              "invoke-super {p0}, Landroid/app/Application;->onCreate()V": "invoke-super {p0}, Lcom/kf/framework/KFApplication;->onCreate()V", }
+
+
+def replace_super_application(decompileDir):
+    smali_files = glob.glob(
+        os.path.join(decompileDir, 'smali*/com/radical/huangshangjixiang/qh360/CoronaApplication.smali'))
+    if len(smali_files) == 1:
+        game_application_file = smali_files[0];
+        print game_application_file
+        if os.path.isfile(game_application_file):
+            with open(game_application_file, "r+") as f:
+                file_str = f.read()
+                for k, v in change_map.items():
+                    file_str = file_str.replace(k, v)
+            with open(game_application_file, "w+") as f:
+                f.write(file_str)
+
+
+def modify_manifest(decompileDir, removeKey):
+    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 + '}' + removeKey
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application')
+    if providers != None:
+        for provider in providers:
+            # providerName = provider.attrib.get(name)
+            # if 'com.netease.ntunisdk.CcMomentRecordingForegroundService' == providerName:
+            # 使用try 主要是为了 防止此属性不在时,导致的错误,而程序终止
+            try:
+                del provider.attrib[authorities]
+            except:
+                ""
+
+    root_node.write(xmlparse, 'utf-8')
+
+
+if __name__ == '__main__':
+    # replace_super_application("D:\work\wzdq")
+    modify_manifest("E:\\apk\\youhua\\youhua.zip.out", "requestLegacyExternalStorage")

+ 115 - 0
全民泡泡超人酷派/script.py

@@ -27,9 +27,124 @@ def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
 
 
 def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "597":
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["activity","annotation","appcompat","arch","asynclayoutinflater","browser"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["tracing","transition","vectordrawable","versionedparcelable","viewpager","viewpager2","webkit","work"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["cardview","collection","concurrent","constraintlayout","coordinatorlayout","core","cursoradapter","customview","documentfile","drawerlayout","dynamicanimation"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["emoji2","fragment","inspection","interpolator"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["print","recyclerview","resourceinspection","room","savedstate","security","slidingpanelayout","sqlite","startup","swiperefreshlayout"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["media","multidex","navigation"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["legacy","lifecycle","loader","localbroadcastmanager"])
+
+        # smali andriodx 完毕
+
+        s1 = os.path.join(decompileDir, "smali_classes2", "com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "com")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["onevcat","seasun","sharry","sina","snail"])
+
+        s1 = os.path.join(decompileDir, "smali_classes2", "com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "com")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["netease"])
+
+        s1 = os.path.join(decompileDir, "smali_classes2", "com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "com")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["lzy"])
+
+        s1 = os.path.join(decompileDir, "smali_classes2", "com/kingsoft/shiyou/omnisdk")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "com/kingsoft/shiyou/omnisdk")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["plugin","project"])
+
+        s1 = os.path.join(decompileDir, "smali_classes2", "com/kingsoft/shiyou/omnisdk")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "com/kingsoft/shiyou/omnisdk")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["api","basic","channel","core"])
+        # smali_classes2结束
+
+        s1 = os.path.join(decompileDir, "smali_classes3", "com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "com")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["snyu","tencent","unionpay","unity3d","vmadalin","yulong"])
+
     return
 
 
+def move_package_one(src, dst):
+    if os.path.exists(src):
+        distutils.dir_util.copy_tree(src, dst)
+        distutils.dir_util.remove_tree(src)
+
+
 def move_package(s1, s3, list_package):
     for d in list_package:
         src = os.path.join(s1, d)

+ 122 - 0
大唐无双酷派/script.py

@@ -0,0 +1,122 @@
+# -*- coding:utf-8 -*-
+__author__ = 'ALIXie'
+
+import logging
+import shutil
+import os
+import re
+import distutils.dir_util
+import gw_file_system
+import gw_data_center
+
+
+def script_init(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    gw_data_center.pack_small = False
+
+
+def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+def script(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+def script_last(workspace_sdk_dir, decompileDir, channel_sdk_info, new_game_channel_info, game_info):
+    if channel_sdk_info['id'] == "512":
+        s1 = os.path.join(decompileDir, "smali_classes5")
+        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_classes6","com","netease")
+        smali_classes_new = create_mutil_smali(decompileDir)
+        s3 = os.path.join(decompileDir, smali_classes_new,"com","netease")
+        list_package = ["dtws0mobilecfs","ntunisdk","pharos"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+    if channel_sdk_info['id'] == "549":
+        s1 = os.path.join(decompileDir, "smali_classes3")
+        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)
+    return
+
+
+def add_checkSelfPermission(extract_dir):
+    goal_file = os.path.join(extract_dir, 'smali/android/support/v4/content/ContextCompat.smali')
+    add_method(goal_file)
+
+
+def add_hjr_checkSelfPermission(extract_dir):
+    goal_file = os.path.join(extract_dir, 'smali/android/support/haojieru/v4/content/ContextCompat.smali')
+    add_method(goal_file)
+
+
+def add_method(goal_file):
+    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 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 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
+
+
+if __name__ == "__main__":
+    add_hjr_checkSelfPermission("C:\\Users\\Administrator\\Desktop\\dtws")

+ 9 - 0
完美世界诸神之战/script.py

@@ -41,6 +41,15 @@ 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)
 
+    if sdk_id == "549" or sdk_id == "597":
+        s1 = os.path.join(extract_dir, "smali_classes3")
+        smali_classes2_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_classes2_dir)
+        list_package = ["androidx"]
+        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


+ 143 - 1
我的世界酷派/script.py

@@ -34,7 +34,7 @@ def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_chann
     # smali_classes2
 
     sdk_id = channel_sdk_info['id']
-    if sdk_id == "512":
+    if sdk_id == "512" or sdk_id=="597":
         split(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info)
     if sdk_id == "549":
         # smali_classes6
@@ -56,6 +56,15 @@ def split(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_inf
         distutils.dir_util.mkpath(s3)
     move_package(s1, s3, list_package)
 
+    # smali_classes3
+    s1 = os.path.join(extract_dir, "smali_classes3")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir)
+    list_package = ["androidx"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
     # smali_classes4
     s1 = os.path.join(extract_dir, "smali_classes4", "com")
     smali_classes2_dir = create_mutil_smali(extract_dir)
@@ -65,6 +74,47 @@ def split(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_inf
         distutils.dir_util.mkpath(s3)
     move_package(s1, s3, list_package)
 
+    s1 = os.path.join(extract_dir, "smali_classes4")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir)
+    list_package = ["androidx"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    s1 = os.path.join(extract_dir, "smali_classes4", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["netease" ]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes5
+    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 = ["dataeye", "dylanvann", "example", "facebook", "github", "hw", "itrabbit", "lmy"]
+    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" ]
+    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")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir)
+    list_package = ["androidx"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
     # smali_classes6
     s1 = os.path.join(extract_dir, "smali_classes6", "com")
     smali_classes2_dir = create_mutil_smali(extract_dir)
@@ -244,6 +294,98 @@ def split(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_inf
         distutils.dir_util.mkpath(s3)
     move_package(s1, s3, list_package)
 
+    # smali_classes4
+    s1 = os.path.join(extract_dir, "smali_classes4", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["scwang", "sensors", "shahenlibrary", "sina", "swmansion", "tencent", "yalantis", "yqritc",
+                    "yulong", "zmxv"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes17
+    s1 = os.path.join(extract_dir, "smali_classes17", "androidx")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "androidx")
+    list_package = ["drawerlayout", "loader", "multidex", "slidingpanelayout", "swiperefreshlayout", "versionedparcelable", "viewpager2"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+     # smali_classes18
+    s1 = os.path.join(extract_dir, "smali_classes18", "com","facebook")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com","facebook")
+    list_package = ["imageformat","imagepipeline","imagepipelinebase","imageutils","infer","jni","nativefilters","nativeimagetranscoder",
+                    "perftest","proguard","react","soloader","systrace","webpsupport","widget"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes5
+    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 = ["masteratul","mp4parser","noah","oblador","reactnativecommunity"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes5
+    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 = ["scwang", "sensors", "shahenlibrary", "sina", "swmansion", "tencent", "yalantis", "yqritc",
+                    "yulong", "zmxv"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes6
+    s1 = os.path.join(extract_dir, "smali_classes6", "androidx")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "androidx")
+    list_package = ["activity","annotation","appcompat","arch","asynclayoutinflater","autofill","core","cursoradapter","customview","documentfile"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes6
+    s1 = os.path.join(extract_dir, "smali_classes6", "androidx")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "androidx")
+    list_package = ["interpolator","legacy","lifecycle","loader","localbroadcastmanager","media","print"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes6
+    s1 = os.path.join(extract_dir, "smali_classes6", "androidx")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "androidx")
+    list_package = ["savedstate","tracing","vectordrawable","viewpager2"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes7
+    s1 = os.path.join(extract_dir, "smali_classes7", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["facebook"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes8
+    s1 = os.path.join(extract_dir, "smali_classes8", "com","netease","ntunisdk")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com","netease","ntunisdk")
+    list_package = ["application","base","coolpad_sdk","external","langutil","ngpush","ngshare"]
+    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


+ 0 - 85
我的世界酷派/ynP4qL/script.py

@@ -1,85 +0,0 @@
-# coding:utf8
-import os
-import logging
-import shutil
-from xml.etree import ElementTree as ET
-import traceback
-import distutils.dir_util
-import re
-import gw_report_tool
-import gw_data_center
-import gw_file_system
-import gw_apk_tool
-
-ANDROID_NS = 'http://schemas.android.com/apk/res/android'
-
-
-def script(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
-    # smali_classes2
-    s1 = os.path.join(extract_dir, "smali_classes2")
-    smali_classes2_dir = create_mutil_smali(extract_dir)
-
-    s3 = smali_classes2_dir
-    list_package = ["androidx"]
-    if not os.path.exists(s3):
-        distutils.dir_util.mkpath(s3)
-    move_package(s1, s3, list_package)
-
-    # smali_classes4
-    s1 = os.path.join(extract_dir, "smali_classes4", "com")
-    smali_classes2_dir = create_mutil_smali(extract_dir)
-    s3 = os.path.join(smali_classes2_dir, "com")
-    list_package = ["dataeye", "dylanvann", "example", "facebook", "github", "hw", "itrabbit", "lmy"]
-    if not os.path.exists(s3):
-        distutils.dir_util.mkpath(s3)
-    move_package(s1, s3, list_package)
-
-    # smali_classes6
-    s1 = os.path.join(extract_dir, "smali_classes6", "com")
-    smali_classes2_dir = create_mutil_smali(extract_dir)
-    s3 = os.path.join(smali_classes2_dir, "com")
-    list_package = ["dylanvann", "example", "facebook", "github", "hw", "itrabbit", "lmy"]
-    if not os.path.exists(s3):
-        distutils.dir_util.mkpath(s3)
-    move_package(s1, s3, list_package)
-
-
-def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
-    # handle_same_package(extract_dir, channel_sdk_info)
-    return
-
-
-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 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):
-            files = os.listdir(tmp)
-            if len(files) == 0:
-                smali_classes2_dir = tmp
-                break
-            f_idx += 1
-        else:
-            smali_classes2_dir = tmp
-            break
-    # endwhile
-    os.mkdir(smali_classes2_dir)
-    return smali_classes2_dir
-
-
-if __name__ == '__main__':
-    extract_dir = 'C:/Users/Administrator/Desktop/apk/qmqjbd_8226_bb_2.3.0'
-    channel_sdk_info = {'packNameSuffix': "new.package.name"}
-    handle_same_package(extract_dir, channel_sdk_info)

BIN
我的世界酷派/ynP4qL/script.pyc


BIN
我的世界酷派/我的世界酷派.zip


+ 423 - 0
时之幻想曲酷派/script.py

@@ -0,0 +1,423 @@
+# coding:utf8
+import os
+import logging
+import shutil
+from xml.etree import ElementTree as ET
+import traceback
+import distutils.dir_util
+import re
+import gw_report_tool
+import gw_data_center
+import gw_file_system
+import gw_apk_tool
+
+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):
+    # split(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info)
+    return
+
+
+def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    # handle_same_package(extract_dir, channel_sdk_info)
+    return
+
+
+def script(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    # smali_classes2
+    # split(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info)
+    return
+
+
+def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    # smali_classes2
+
+    sdk_id = channel_sdk_info['id']
+    if sdk_id == "512" or sdk_id=="597":
+         # smali_classes6
+        s1 = os.path.join(extract_dir, "smali_classes2", "androidx")
+        smali_classes2_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        list_package = ["annotation","appcompat","arch","asynclayoutinflater","cardview","collection","core","constraintlayout","customview","cursoradapter","coordinatorlayout","databinding"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+
+
+def split(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    s1 = os.path.join(extract_dir, "smali_classes2")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = smali_classes2_dir
+    list_package = ["androidx"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes3
+    s1 = os.path.join(extract_dir, "smali_classes3")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir)
+    list_package = ["androidx"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes4
+    s1 = os.path.join(extract_dir, "smali_classes4", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["dataeye", "dylanvann", "example", "facebook", "github", "hw", "itrabbit", "lmy"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    s1 = os.path.join(extract_dir, "smali_classes4")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir)
+    list_package = ["androidx"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    s1 = os.path.join(extract_dir, "smali_classes4", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["netease" ]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes5
+    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 = ["dataeye", "dylanvann", "example", "facebook", "github", "hw", "itrabbit", "lmy"]
+    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" ]
+    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")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir)
+    list_package = ["androidx"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes6
+    s1 = os.path.join(extract_dir, "smali_classes6", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["dylanvann", "example", "facebook", "github", "hw", "itrabbit", "lmy"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes2
+    s1 = os.path.join(extract_dir, "smali_classes2", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["airbnb", "coremedia", "google", "JavaWebsocket", "netease", "reactnativecommunity",
+                    "shahenlibrary", "tencent", "yulong", "baidu", "facebook", " googlecode", "mp4parser",
+                    "reactnative", "scwang"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes3-11
+    s1 = os.path.join(extract_dir, "smali_classes3", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["airbnb", "android", "bumptech", "CCMsgSdk", "coremedia"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes3-12
+    s1 = os.path.join(extract_dir, "smali_classes3", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["mojang", "mp4parser", "netease", "random", "reactnativecommunity", "RNFetchBlob"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes3-13
+    s1 = os.path.join(extract_dir, "smali_classes3", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["example", "facebook"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes3-14
+    s1 = os.path.join(extract_dir, "smali_classes3", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["hw", "itrabbit", "JavaWebsocket", "lmy"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes3-15
+    s1 = os.path.join(extract_dir, "smali_classes3", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["github", "google", "googlecode"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes3-16
+    s1 = os.path.join(extract_dir, "smali_classes3", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["scwang", "sensors", "shahenlibrary", "sina", "swmansion", "tencent", "yalantis", "yqritc",
+                    "yulong", "zmxv"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes3-17
+    s1 = os.path.join(extract_dir, "smali_classes3")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = smali_classes2_dir
+    list_package = ["android", "androidx/legacy", "androidx/lifecycle", "androidx/loader",
+                    "androidx/localbroadcastmanager", "androidx/media", "androidx/print", "androidx/savedstate",
+                    "androidx/slidingpanelayout",
+                    "androidx/swiperefreshlayout", "androidx/vectordrawable", "androidx/versionedparcelable"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes3-18
+    s1 = os.path.join(extract_dir, "smali_classes3")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = smali_classes2_dir
+    list_package = ["androidx/activity", "androidx/annotation", "androidx/appcompat", "androidx/arch",
+                    "androidx/asynclayoutinflater", "androidx/core", "androidx/cursoradapter",
+                    "androidx/customview", "androidx/documentfile", "androidx/drawerlayout", "androidx/interpolator"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes5-19
+    s1 = os.path.join(extract_dir, "smali_classes5", "androidx")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "androidx")
+    list_package = ["fragment", "media", "transition", "vectordrawable", "viewpager"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes8-20
+    s1 = os.path.join(extract_dir, "smali_classes8", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["dataeye", "dylanvann", "facebook", "horcrux"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes9-21
+    s1 = os.path.join(extract_dir, "smali_classes9", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["mojang", "netease"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes20-22
+    s1 = os.path.join(extract_dir, "smali_classes20", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["dataeye", "dylanvann", "facebook", "horcrux"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes21-23
+    s1 = os.path.join(extract_dir, "smali_classes21", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["mojang", "netease"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes22-24
+    s1 = os.path.join(extract_dir, "smali_classes22", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["dataeye", "dylanvann", "facebook", "horcrux"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes23-24
+    s1 = os.path.join(extract_dir, "smali_classes23", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["hw", "masteratul"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes24-26
+    s1 = os.path.join(extract_dir, "smali_classes24", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["airbnb", "bumptech", "coolcloud", "dataeye"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes25-27
+    s1 = os.path.join(extract_dir, "smali_classes25", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["mojang", "netease"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes4
+    s1 = os.path.join(extract_dir, "smali_classes4", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["scwang", "sensors", "shahenlibrary", "sina", "swmansion", "tencent", "yalantis", "yqritc",
+                    "yulong", "zmxv"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes17
+    s1 = os.path.join(extract_dir, "smali_classes17", "androidx")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "androidx")
+    list_package = ["drawerlayout", "loader", "multidex", "slidingpanelayout", "swiperefreshlayout", "versionedparcelable", "viewpager2"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+     # smali_classes18
+    s1 = os.path.join(extract_dir, "smali_classes18", "com","facebook")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com","facebook")
+    list_package = ["imageformat","imagepipeline","imagepipelinebase","imageutils","infer","jni","nativefilters","nativeimagetranscoder",
+                    "perftest","proguard","react","soloader","systrace","webpsupport","widget"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes5
+    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 = ["masteratul","mp4parser","noah","oblador","reactnativecommunity"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes5
+    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 = ["scwang", "sensors", "shahenlibrary", "sina", "swmansion", "tencent", "yalantis", "yqritc",
+                    "yulong", "zmxv"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes6
+    s1 = os.path.join(extract_dir, "smali_classes6", "androidx")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "androidx")
+    list_package = ["activity","annotation","appcompat","arch","asynclayoutinflater","autofill","core","cursoradapter","customview","documentfile"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes6
+    s1 = os.path.join(extract_dir, "smali_classes6", "androidx")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "androidx")
+    list_package = ["interpolator","legacy","lifecycle","loader","localbroadcastmanager","media","print"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes6
+    s1 = os.path.join(extract_dir, "smali_classes6", "androidx")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "androidx")
+    list_package = ["savedstate","tracing","vectordrawable","viewpager2"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes7
+    s1 = os.path.join(extract_dir, "smali_classes7", "com")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["facebook"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    # smali_classes8
+    s1 = os.path.join(extract_dir, "smali_classes8", "com","netease","ntunisdk")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com","netease","ntunisdk")
+    list_package = ["application","base","coolpad_sdk","external","langutil","ngpush","ngshare"]
+    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:
+        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 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):
+            files = os.listdir(tmp)
+            if len(files) == 0:
+                smali_classes2_dir = tmp
+                break
+            f_idx += 1
+        else:
+            smali_classes2_dir = tmp
+            break
+    # endwhile
+    if not os.path.exists(smali_classes2_dir):
+        os.mkdir(smali_classes2_dir)
+    return smali_classes2_dir
+
+
+if __name__ == '__main__':
+    extract_dir = 'C:/Users/Administrator/Desktop/apk/qmqjbd_8226_bb_2.3.0'
+    channel_sdk_info = {'packNameSuffix': "new.package.name"}
+    handle_same_package(extract_dir, channel_sdk_info)

+ 134 - 0
极无双2/script.py

@@ -0,0 +1,134 @@
+# 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
+import gw_file_system
+import gw_data_center
+import gw_apk_tool
+
+
+def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "549" or sdk_id == "591":
+        s1 = os.path.join(decompileDir, "smali_classes2")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = smali_classes2_dir
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, ["androidx"])
+
+    return
+
+
+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 is_reverse_qihoo(file):
+    with open(file, 'r+') as f:
+        file_str = f.read()
+        if 'KFSDK' in file_str:
+            return True
+        else:
+            return False
+
+
+def replace_init_code(decompileDir):
+    smali_files = glob.glob(os.path.join(decompileDir, 'smali*/com/qihoo/'))
+    if len(smali_files) >= 1:
+        iter_smali = iter(smali_files)
+        while True:
+            try:
+                qihoo_file_path = iter_smali.next()
+                file = os.path.join(qihoo_file_path, 'gamecenter/sdk/matrix/Matrix.smali')
+                if os.path.exists(file):
+                    logging.info('Matrix exits in %s' % qihoo_file_path)
+                    if is_reverse_qihoo(file):
+                        with open(file, 'r+') as f:
+                            cont = f.read()
+                            change_str = '0x82c'
+                            str = '0x82b'
+                            cont = cont.replace(change_str, str)
+                            logging.info('replace_str: ' + cont)
+                        with open(file, 'w+') as tf:
+                            tf.write(cont)
+
+            except StopIteration:
+                break
+
+
+def replace_application(extract_dir):
+    goal_file = os.path.join(extract_dir, 'smali_classes3/com/lilithgame/sgame/wxapi/QihooApplication.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 = 'Landroid/support/multidex/MultiDexApplication'
+            str = 'Lcom/kf/framework/KFApplication'
+            cont = cont.replace(change_str, str)
+            logging.info('replace_str: ' + cont)
+        with open(goal_file, 'w+') as tf:
+            tf.write(cont)
+
+
+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 move_package_one(src, dst):
+    if os.path.exists(src):
+        distutils.dir_util.copy_tree(src, dst)
+        distutils.dir_util.remove_tree(src)
+
+
+if __name__ == '__main__':
+    replace_init_code("D:\work\lyjymb")

+ 59 - 12
极无双酷派/script.py

@@ -8,6 +8,7 @@ import xml.dom.minidom
 import re
 import shutil
 import glob
+import distutils.dir_util
 
 
 def script_second(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
@@ -16,28 +17,49 @@ def script_second(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_cha
     public_xml = os.path.join(extract_dir, "res/values/drawables.xml")
     handle_public_xml(public_xml, "APKTOOL")
 
+    public_xml = os.path.join(extract_dir, "res/values/public.xml")
+    handle_public_xml(public_xml, "APKTOOL")
+
     return
 
 
 def script(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['SDKName'] == 'reverseforkupai':
         del_coolcloud(decompileDir)
     if channelSdkInfo['id'] == '549':
         replace_life_method(decompileDir)
 
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "597":
+        # s1 = os.path.join(decompileDir, "smali_classes2")
+        # if os.path.exists(s1):
+        #     smali_classes2_dir = create_mutil_smali(decompileDir)
+        #     s3 = smali_classes2_dir
+        #     if not os.path.exists(s3):
+        #         distutils.dir_util.mkpath(s3)
+        #     move_package(s1, s3, ["androidx"])
+
+        extract_dir = decompileDir
+        s1 = os.path.join(extract_dir, "smali_classes2", "androidx")
+        smali_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_dir, "androidx")
+        list_package = ["legacy", "lifecycle", "loader", "localbroadcastmanager", "media", "print", "slidingpanelayout",
+                        "swiperefreshlayout", "vectordrawable", "versionedparcelable", "viewpager"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+        s1 = os.path.join(extract_dir, "smali_classes2", "androidx")
+        smali_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_dir, "androidx")
+        list_package = ["annotation", "appcompat", "arch", "asynclayoutinflater", "browser", "collection", "concurrent",
+                        "coordinatorlayout", "core", "cursoradapter", "customview", "documentfile", "drawerlayout",
+                        "fragment", "interpolator"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
 
 def replace_life_method(extract_dir):
     goal_file = glob.glob(os.path.join(extract_dir, 'smali*/com/taiyouxi/a3k/MainActivity.smali'))[0]
@@ -135,5 +157,30 @@ def handle_public_xml(public_xml_path, remove_node):
     return
 
 
+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 create_mutil_smali(decompileDir):
+    f_idx = 2
+    while True:
+        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
+
+
 if __name__ == '__main__':
     replace_life_method("D:\\work\\jws")

+ 121 - 0
梦幻西游酷派/script.py

@@ -0,0 +1,121 @@
+# 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
+import gw_file_system
+import gw_data_center
+import gw_apk_tool
+
+
+def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "597":
+            f_idx = 4
+            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):
+                new_dex_dir = create_mutil_smali(decompileDir)
+                move_package(tmp, new_dex_dir, ["androidx"])
+
+        # endwhile
+    return
+
+
+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 is_reverse_qihoo(file):
+    with open(file, 'r+') as f:
+        file_str = f.read()
+        if 'KFSDK' in file_str:
+            return True
+        else:
+            return False
+
+
+def replace_init_code(decompileDir):
+    smali_files = glob.glob(os.path.join(decompileDir, 'smali*/com/qihoo/'))
+    if len(smali_files) >= 1:
+        iter_smali = iter(smali_files)
+        while True:
+            try:
+                qihoo_file_path = iter_smali.next()
+                file = os.path.join(qihoo_file_path, 'gamecenter/sdk/matrix/Matrix.smali')
+                if os.path.exists(file):
+                    logging.info('Matrix exits in %s' % qihoo_file_path)
+                    if is_reverse_qihoo(file):
+                        with open(file, 'r+') as f:
+                            cont = f.read()
+                            change_str = '0x82c'
+                            str = '0x82b'
+                            cont = cont.replace(change_str, str)
+                            logging.info('replace_str: ' + cont)
+                        with open(file, 'w+') as tf:
+                            tf.write(cont)
+
+            except StopIteration:
+                break
+
+
+def replace_application(extract_dir):
+    goal_file = os.path.join(extract_dir, 'smali_classes3/com/lilithgame/sgame/wxapi/QihooApplication.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 = 'Landroid/support/multidex/MultiDexApplication'
+            str = 'Lcom/kf/framework/KFApplication'
+            cont = cont.replace(change_str, str)
+            logging.info('replace_str: ' + cont)
+        with open(goal_file, 'w+') as tf:
+            tf.write(cont)
+
+
+if __name__ == '__main__':
+    replace_init_code("D:\work\lyjymb")

+ 168 - 52
武林闲侠酷派/script.py

@@ -10,9 +10,6 @@ import shutil
 import glob
 import distutils.dir_util
 import os
-import gw_apk_tool
-import gw_file_system
-
 
 def script_second(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
     logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
@@ -32,55 +29,110 @@ def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameIn
     logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
     if channelSdkInfo['id'] == "549" or channelSdkInfo['id'] == "597":
         s1 = os.path.join(decompileDir, "smali_classes11/com/bytedance")
-        smali_classes_new = create_mutil_smali(decompileDir)
-        s3 = os.path.join(decompileDir, smali_classes_new)
-        list_package = ["module"]
-        if not os.path.exists(s3):
-            distutils.dir_util.mkpath(s3)
-        move_package(s1, s3, list_package)
+        if os.path.exists(s1):
+            smali_classes_new = create_mutil_smali(decompileDir)
+            s3 = os.path.join(decompileDir, smali_classes_new)
+            list_package = ["module"]
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        move_11_bytedance(decompileDir, "smali_classes11")
+        move_11_bytedance(decompileDir, "smali_classes12")
 
-        move_11_bytedance(decompileDir)
+        s1 = os.path.join(decompileDir, "smali_classes10")
+        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_classes11/com")
-        smali_classes_new = create_mutil_smali(decompileDir)
-        s3 = os.path.join(decompileDir, smali_classes_new)
-        list_package = ["bytedance"]
-        if not os.path.exists(s3):
-            distutils.dir_util.mkpath(s3)
-        move_package(s1, s3, list_package)
+        if os.path.exists(s1):
+            smali_classes_new = create_mutil_smali(decompileDir)
+            s3 = os.path.join(decompileDir, smali_classes_new)
+            list_package = ["bytedance"]
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
 
-        
         s1 = os.path.join(decompileDir, "smali_classes11/com/huawei")
-        smali_classes_new = create_mutil_smali(decompileDir)
-        s3 = os.path.join(decompileDir, smali_classes_new)
-        list_package = ["hms"]
-        if not os.path.exists(s3):
-            distutils.dir_util.mkpath(s3)
-        move_package(s1, s3, list_package)
+        if os.path.exists(s1):
+            smali_classes_new = create_mutil_smali(decompileDir)
+            s3 = os.path.join(decompileDir, smali_classes_new)
+            list_package = ["hms"]
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
 
         s1 = os.path.join(decompileDir, "smali_classes11/com")
-        smali_classes_new = create_mutil_smali(decompileDir)
-        s3 = os.path.join(decompileDir, smali_classes_new)
-        list_package = ["huawei","hermes","google"]
-        if not os.path.exists(s3):
-            distutils.dir_util.mkpath(s3)
-        move_package(s1, s3, list_package)
+        if os.path.exists(s1):
+            smali_classes_new = create_mutil_smali(decompileDir)
+            s3 = os.path.join(decompileDir, smali_classes_new)
+            list_package = ["huawei", "hermes", "google"]
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
 
         s1 = os.path.join(decompileDir, "smali_classes17/com/bytedance/ttgame/module")
-        smali_classes_new = create_mutil_smali(decompileDir)
-        s3 = os.path.join(decompileDir, smali_classes_new)
-        list_package = ["usercenter", "voice", "vtranslate", "webview"]
-        if not os.path.exists(s3):
-            distutils.dir_util.mkpath(s3)
-        move_package(s1, s3, list_package)
+        if os.path.exists(s1):
+            smali_classes_new = create_mutil_smali(decompileDir)
+            s3 = os.path.join(decompileDir, smali_classes_new)
+            list_package = ["usercenter", "voice", "vtranslate", "webview"]
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
 
         s1 = os.path.join(decompileDir, "smali_classes40/com/bytedance/ttgame")
-        smali_classes_new = create_mutil_smali(decompileDir)
-        s3 = os.path.join(decompileDir, smali_classes_new)
-        list_package = ["core"]
-        if not os.path.exists(s3):
-            distutils.dir_util.mkpath(s3)
-        move_package(s1, s3, list_package)
+        if os.path.exists(s1):
+            smali_classes_new = create_mutil_smali(decompileDir)
+            s3 = os.path.join(decompileDir, smali_classes_new)
+            list_package = ["core"]
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+        move_all(decompileDir)
+
+    if channelSdkInfo['id'] =="591":
+       move_package_under_all(decompileDir, "smali_classes13","com", "lzy")
+
+def move_all(decompileDir):
+    move_package_under_all(decompileDir, "smali_classes12", "com", "bytedance")
+    move_package_under_all(decompileDir, "smali_classes12", "com/bytedance", "ttgame")
+
+    move_package_under_all(decompileDir, "smali_classes12", "com/bytedance/ttgame", "module")
+    move_package_under_all(decompileDir, "smali_classes12", "com/bytedance/ttgame/module", "share")
+
+    move_package_under_all(decompileDir, "smali_classes14", "com", "ss")
+    move_package_under_all(decompileDir, "smali_classes14", "com/ss", "android")
+    move_package_under_all(decompileDir, "smali_classes14", "com/ss/android", "bytedcert")
+
+    move_package_under_all(decompileDir, "smali_classes23", "com/huawei", "agconnect")
+    move_package_under_all(decompileDir, "smali_classes6", "", "androidx")
+    move_package_under_all(decompileDir, "smali_classes106", "com", "a")
+    move_package_under_all(decompileDir, "smali_classes117", "com/bytedance", "android")
+    move_package_under_all(decompileDir, "smali_classes120", "com/bytedance/apm6", "commonevent")
+    move_package_under_all(decompileDir, "smali_classes6", "androidx", "activity")
+    move_package_under_all(decompileDir, "smali_classes7", "com/bytedance", "common")
+    move_package_under_all(decompileDir, "smali_classes179", "com/bytedance/frameworks", "apm")
+    move_package_under_all(decompileDir, "smali_classes210", "com/bytedance/sdk", "account")
+    move_package_under_all(decompileDir, "smali_classes210", "com/bytedance/sdk/account", "api")
+    move_package_under_all(decompileDir, "smali_classes220", "com/bytedance/ttgame", "account")
+    move_package_under_all(decompileDir, "smali_classes8", "com/bytedance/ttgame/module", "abtest")
+    move_package_under_all(decompileDir, "smali_classes274", "com/bytedance/ttgame/module/compliance", "api")
+    move_package_under_all(decompileDir, "smali_classes97", "com/huawei/hms", "aaid")
+
+    move_package_under_all(decompileDir, "smali_classes105","com", "bytedance")
+    move_package_under_all(decompileDir, "smali_classes105","com/bytedance", "ttgame")
+    move_package_under_all(decompileDir, "smali_classes146","com/bytedance/frameworks", "apm")
+    move_package_under_all(decompileDir, "smali_classes177","com/bytedance/sdk", "account")
+    move_package_under_all(decompileDir, "smali_classes177","com/bytedance/sdk/account", "api")
+    move_package_under_all(decompileDir, "smali_classes187","com/bytedance/ttgame", "account")
+    move_package_under_all(decompileDir, "smali_classes198","com/bytedance/ttgame/module/compliance", "api")
+    move_package_under_all(decompileDir, "smali_classes235","com/bytedance/apm6", "commonevent")
+    move_package_under_all(decompileDir, "smali_classes96","com/huawei/hms", "aaid")
 
 
 def move_package(s1, s3, list_package):
@@ -91,35 +143,59 @@ def move_package(s1, s3, list_package):
             distutils.dir_util.copy_tree(src, dst)
             distutils.dir_util.remove_tree(src)
 
-def move_11_bytedance(decompileDir):
-        s1 = os.path.join(decompileDir, "smali_classes11/com/bytedance")
+
+# 移动包下面所有包
+def move_package_under_all(decompileDir, smali_classes, move_dir, except_dir):
+    s1 = os.path.join(decompileDir, smali_classes, move_dir)
+    if not os.path.exists(s1):
+        return
+    for name in os.listdir(s1):
+        if name == except_dir:
+            continue
+        if "." in name:  # 是文件
+            continue
+        smali_classes_new = create_mutil_smali(decompileDir)
+        s3 = os.path.join(decompileDir, smali_classes_new, move_dir)
+        list_package = [name]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+
+def move_11_bytedance(decompileDir, smali_classes):
+    s1 = os.path.join(decompileDir, smali_classes, "/com/bytedance")
+    if os.path.exists(s1):
         smali_classes_new = create_mutil_smali(decompileDir)
         s3 = os.path.join(decompileDir, smali_classes_new)
-        list_package = ["rocketapi","wrapper_account","wrapper_alog","wrapper_appcloud","wrapper_applog"]
+        list_package = ["rocketapi", "wrapper_account", "wrapper_alog", "wrapper_appcloud", "wrapper_applog"]
         if not os.path.exists(s3):
             distutils.dir_util.mkpath(s3)
         move_package(s1, s3, list_package)
 
-        s1 = os.path.join(decompileDir, "smali_classes11/com/bytedance")
+    s1 = os.path.join(decompileDir, smali_classes, "/com/bytedance")
+    if os.path.exists(s1):
         smali_classes_new = create_mutil_smali(decompileDir)
         s3 = os.path.join(decompileDir, smali_classes_new)
-        list_package = ["wrapper_download","wrapper_encrypt","wrapper_jsbridge","wrapper_librarian","wrapper_net"]
+        list_package = ["wrapper_download", "wrapper_encrypt", "wrapper_jsbridge", "wrapper_librarian", "wrapper_net"]
         if not os.path.exists(s3):
             distutils.dir_util.mkpath(s3)
         move_package(s1, s3, list_package)
 
-        s1 = os.path.join(decompileDir, "smali_classes11/com/bytedance")
+    s1 = os.path.join(decompileDir, smali_classes, "/com/bytedance")
+    if os.path.exists(s1):
         smali_classes_new = create_mutil_smali(decompileDir)
         s3 = os.path.join(decompileDir, smali_classes_new)
-        list_package = ["wrapper_pangolinsdk","wrapper_push","wrapper_sdk_monitor","wrapper_service_manager","wrapper_setting_manager"]
+        list_package = ["wrapper_pangolinsdk", "wrapper_push", "wrapper_sdk_monitor", "wrapper_service_manager",
+                        "wrapper_setting_manager"]
         if not os.path.exists(s3):
             distutils.dir_util.mkpath(s3)
         move_package(s1, s3, list_package)
 
-        s1 = os.path.join(decompileDir, "smali_classes11/com/bytedance")
+    s1 = os.path.join(decompileDir, smali_classes, "/com/bytedance")
+    if os.path.exists(s1):
         smali_classes_new = create_mutil_smali(decompileDir)
         s3 = os.path.join(decompileDir, smali_classes_new)
-        list_package = ["wrapper_share","wrapper_smartrouter","wrapper_utility"]
+        list_package = ["wrapper_share", "wrapper_smartrouter", "wrapper_utility"]
         if not os.path.exists(s3):
             distutils.dir_util.mkpath(s3)
         move_package(s1, s3, list_package)
@@ -128,7 +204,8 @@ def move_11_bytedance(decompileDir):
 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 = 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):
@@ -152,4 +229,43 @@ def remove_navigate(decompileDir):
 
 if __name__ == '__main__':
     # del_qihoo("C:\\Users\\Administrator\\Desktop\\zt")
-    remove_navigate("G:\\autopack2.0_kuaifa\\tool\\workspace\\lrs360\\13651\\extract")
+    # remove_navigate("G:\\autopack2.0_kuaifa\\tool\\workspace\\lrs360\\13651\\extract")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes12", "com","bytedance")
+    #  move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes12", "com/bytedance","ttgame")
+    # 这个可能可以不要
+    #  move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes12", "com/bytedance/ttgame","module")
+    #  move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes12", "com/bytedance/ttgame/module","share")
+    # 14 smali 开始
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes14", "com","ss")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes14", "com/ss","android")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes14", "com/ss/android","bytedcert")
+
+    # 23
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes23", "com/huawei","agconnect")
+    # 6
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes6", "","androidx")
+    # 106
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes106", "com","a")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes117", "com/bytedance","android")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes120", "com/bytedance/apm6","commonevent")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes6", "androidx","activity")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes7", "com/bytedance","common")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes179", "com/bytedance/frameworks","apm")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes210", "com/bytedance/sdk","account")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes210", "com/bytedance/sdk/account","api")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes220", "com/bytedance/ttgame","account")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes8", "com/bytedance/ttgame/module","abtest")
+    # move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes274", "com/bytedance/ttgame/module/compliance","api")
+    #move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes97","com/huawei/hms", "aaid")
+
+    #move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes105","com", "bytedance")
+    #move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes105","com/bytedance", "ttgame")
+    #move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes146","com/bytedance/frameworks", "apm")
+    #move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes177","com/bytedance/sdk", "account")
+    #move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes177","com/bytedance/sdk/account", "api")
+    #move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes187","com/bytedance/ttgame", "account")
+    #move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes198","com/bytedance/ttgame/module/compliance", "api")
+    #move_package_under_all("G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract", "smali_classes235","com/bytedance/apm6", "commonevent")
+
+    decompileDir="G:\\autopack2.0_kuaifa\\tool\\workspace\\wlxxkp\\16075\\extract"
+    move_package_under_all(decompileDir, "smali_classes96","com/huawei/hms", "aaid")

BIN
武林闲侠酷派/script.pyc


+ 90 - 0
武林闲侠酷派/script_old.py

@@ -0,0 +1,90 @@
+# coding:utf8
+
+__author__ = 'dong'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+import distutils.dir_util
+import os
+import gw_apk_tool
+import gw_file_system
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['id'] == '597':
+        logging.info("remove_navigate")
+        remove_navigate(decompileDir)
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['id'] == "549" or channelSdkInfo['id'] == "597":
+        s1 = os.path.join(decompileDir, "smali_classes11/com")
+        if os.path.exists(s1):
+            smali_classes_new = create_mutil_smali(decompileDir)
+            s3 = os.path.join(decompileDir, smali_classes_new)
+            list_package = ["bytedance"]
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes17/com/bytedance/ttgame/module")
+        if os.path.exists(s1):
+            smali_classes_new = create_mutil_smali(decompileDir)
+            s3 = os.path.join(decompileDir, smali_classes_new)
+            list_package = ["usercenter","voice","vtranslate","webview"]
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes40/com/bytedance/ttgame")
+        if os.path.exists(s1):
+            smali_classes_new = create_mutil_smali(decompileDir)
+            s3 = os.path.join(decompileDir, smali_classes_new)
+            list_package = ["core"]
+            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:
+        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 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 remove_navigate(decompileDir):
+    tmp_res = os.path.join(decompileDir, "res", "navigation")
+    tmp_public_xml = os.path.join(decompileDir, "res", "values", "public.xml")
+    if os.path.exists(tmp_res):
+        distutils.dir_util.remove_tree(tmp_res)
+    if os.path.exists(tmp_public_xml):
+        os.remove(tmp_public_xml)
+
+
+if __name__ == '__main__':
+    # del_qihoo("C:\\Users\\Administrator\\Desktop\\zt")
+    remove_navigate("G:\\autopack2.0_kuaifa\\tool\\workspace\\lrs360\\13651\\extract")

BIN
武林闲侠酷派/武林闲侠酷派.zip


+ 227 - 0
流浪方舟酷派/script.py

@@ -0,0 +1,227 @@
+# coding:utf8
+import os
+import logging
+import re
+import glob
+import shutil
+import distutils.dir_util
+import gw_file_system
+import xml.etree.ElementTree as ET
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+
+def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+
+def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    logging.info('game_pack_info: ' + str(channel_sdk_info))
+    if channel_sdk_info['id'] == "597":
+        s1 = os.path.join(extract_dir, "smali_classes2", "androidx")
+        smali_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_dir, "androidx")
+        list_package = ["legacy","lifecycle","loader","localbroadcastmanager","media","print","slidingpanelayout","swiperefreshlayout","vectordrawable","versionedparcelable","viewpager"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+        s1 = os.path.join(extract_dir, "smali_classes2", "androidx")
+        smali_dir = create_mutil_smali(extract_dir)
+        s3 = os.path.join(smali_dir, "androidx")
+        list_package = ["annotation","appcompat","arch","asynclayoutinflater","browser","collection","concurrent","coordinatorlayout","core","cursoradapter","customview","documentfile","drawerlayout","fragment","interpolator"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+    return
+
+
+def fix_android_manifest(decompile_dir):
+    manifest_file = decompile_dir + '/AndroidManifest.xml'
+    ET.register_namespace('android', ANDROID_NS)
+    key_android_name = '{' + ANDROID_NS + '}authorities'
+    target_tree = ET.parse(manifest_file)
+    target_root = target_tree.getroot()
+    manifest_node = target_root.get("package")
+    application_node = target_root.find('application')
+    if application_node is None:
+        return
+    if application_node is not None:
+        activity_list_node = application_node.findall('provider')
+    if activity_list_node is None:
+        return
+    for activityNode in activity_list_node:
+        node_name_str = activityNode.attrib[key_android_name]
+        if node_name_str == 'com.netease.onmyoji.coolpad111':
+            activityNode.set(key_android_name, manifest_node + '111')
+    target_tree.write(manifest_file)
+
+
+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 move_package_one(src, dst):
+    if os.path.exists(src):
+        distutils.dir_util.copy_tree(src, dst)
+        distutils.dir_util.remove_tree(src)
+
+
+def rm_alipay(extract_dir):
+    delet_file = os.path.join(extract_dir, 'smali/org/json')
+    print delet_file
+    logging.info('delet_file: ' + delet_file)
+    shutil.rmtree(delet_file)
+
+
+def rm_wechatpay(extract_dir):
+    delet = os.path.join(extract_dir, 'smali_classes2/com/ipaynow')
+    print delet
+    logging.info(delet)
+    shutil.rmtree(delet)
+
+
+def change_smali(fooDir):
+    for smali_flie in glob.glob(fooDir + "/" + "smali*/com/kunlun/platform/android/KunlunApplication.smali"):
+        print smali_flie
+        if os.path.isfile(smali_flie):
+            with open(smali_flie, 'r+') as f:
+                cont = f.read()
+                change_str = 'invoke-virtual {p0}, Lcom/kf/framework/KFApplication;->onCreate()V'
+                str = 'invoke-virtual {p0}, Landroid/app/Application;->onCreate()V'
+                print len(change_str)
+                print len(str)
+                change_str2 = 'invoke-virtual {v0, p1}, Lcom/kf/framework/KFApplication;->onConfigurationChanged(Landroid/content/res/Configuration;)V'
+                str2 = 'invoke-virtual {v0, p1}, Landroid/app/Application;->onConfigurationChanged(Landroid/content/res/Configuration;)V'
+                cont = cont.replace(change_str, str)
+                cont = cont.replace(change_str2, str2)
+            with open(smali_flie, 'w') as tf:
+                tf.write(cont)
+
+
+def intoFirstLine(target, repl, cont):
+    # srcStr = "onBackPressed"
+    # regexp = '.method (?:public|protected) +?'+target+"\([^.]+?\.locals +[0-9]{1,2}"
+    regexp = '.method (?:public|protected) +?' + target + "\([^.]+?\.locals +([0-9]{1,2})"
+    # print(regexp)
+    reObj = re.compile(regexp)
+    matchO = reObj.search(cont)
+    if matchO:
+        # print(matchO.group(0))
+        methodHead = matchO.group(0)
+        if matchO.group(1) == "0":
+            methodHead = re.sub("locals +0", "locals 1", methodHead)
+
+        repl = methodHead + r'\n\n    ' + repl + r'\n\n'
+        cont = reObj.sub(repl, cont)
+    else:
+        # todo call .super method
+        cont += r'.method protected ' + target + r'()V\n\n    .locals 0\n\n    ' + repl + r'\n\n    .end method\n'
+
+    return cont
+
+
+def fixLifecycleMethod(preDir):
+    for tfile in glob.glob(preDir + "/" + "smali*/com/supercell/titan/kunlun/GameAppKunlun.smali"):
+        if os.path.isfile(tfile):
+            with open(tfile, 'r+') as f:
+                cont = f.read()
+                changes = {
+                    "onPause": "invoke-static {}, Lcom/qihoo/gamecenter/sdk/matrix/Matrix;->onPause()V",
+                    "onResume": "invoke-static {}, Lcom/qihoo/gamecenter/sdk/matrix/Matrix;->onResume()V",
+                    "onDestroy": "invoke-static {p0}, Lcom/qihoo/gamecenter/sdk/matrix/Matrix;->destroy(Landroid/content/Context;)V",
+                    "onStop": "invoke-static {}, Lcom/qihoo/gamecenter/sdk/matrix/Matrix;->onStop()V"
+                }
+                for k, v in changes.iteritems():
+                    cont = intoFirstLine(k, v, cont)
+
+                f.seek(0)
+                f.write(cont)
+                f.close()
+
+
+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("x7_bg_female_pink_7") > -1:
+                continue
+
+            if line.find("x7_icon_female_pink") > -1:
+                continue
+
+            if line.find("x7_bg_female_pink_right_7") > -1:
+                continue
+            new_lines.append(line)
+        f.seek(0)
+        f.truncate()
+        f.writelines(new_lines)
+    return
+
+
+def move_package_for_small_sheep(extract_dir):
+    s1 = os.path.join(extract_dir, "smali_classes4", "com/netease")
+    smali_classes2_dir = create_mutil_smali(extract_dir)
+    s3 = os.path.join(smali_classes2_dir, "com/netease")
+    list_package = ["mpay", "neox", "ngpush", "ntunisdk", "onmyoji", "pharos", "tryautotext2", "unisdk", "xyqa"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+
+lines = [
+    'invoke-virtual {p3}, Lcom/kf/framework/KFApplication;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;',
+    'invoke-virtual {v0}, Lcom/kf/framework/KFApplication;->onCreate()V']
+
+
+def replace_kf_application(extract_dir):
+    goal_file = glob.glob(os.path.join(extract_dir,
+                                       'smali*/com/netease/ntunisdk/unifix_hotfix_library/proxyApplication/UFProxyApplication.smali'))[
+        0]
+    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()
+            for line in lines:
+                change_line = line.replace('Lcom/kf/framework/KFApplication',
+                                           'Landroid/app/Application')
+                cont = cont.replace(line, change_line)
+            logging.info('replace_str: ' + cont)
+        with open(goal_file, 'w+') as tf:
+            tf.write(cont)
+
+
+if __name__ == '__main__':
+    replace_kf_application("D:\\work\\yys")

+ 78 - 25
率土之滨酷派/script.py

@@ -30,38 +30,27 @@ def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameI
 
 
 def script(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)
-
     return
 
 
 def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
     sdk_id = channelSdkInfo['id']
     if sdk_id == "597":
-        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)
-            androidx = tmp + '/androidx'
-
-            if os.path.exists(androidx):
-                new_dex_dir = create_mutil_smali(decompileDir)
-                move_package(tmp, new_dex_dir, ["androidx"])
-            if not os.path.exists(tmp):
-                break
+        # f_idx = 3
+        # tmp = gw_file_system.get_full_path(os.path.join(decompileDir, 'smali_classes%d' % f_idx))
+        # tmp = tmp.replace('\\', '/')
+        # tmp = re.sub('/+', '/', tmp)
+        # androidx = tmp + '/androidx'
+        #
+        # if os.path.exists(androidx):
+        #     new_dex_dir = create_mutil_smali(decompileDir)
+        #     move_package(tmp, new_dex_dir, ["androidx"])
+        #
+        move_androidx(decompileDir,"smali_classes3")
+        move_androidx(decompileDir,"smali_classes4")
 
-            f_idx += 1
-        # endwhile
-    if sdk_id == "549":
+    # endwhile
+    if sdk_id == "549" or sdk_id == "591":
         f_idx = 5
         # while True:
         tmp = gw_file_system.get_full_path(os.path.join(decompileDir, 'smali_classes%d' % f_idx))
@@ -155,5 +144,69 @@ def replace_application(extract_dir):
             tf.write(cont)
 
 
+# 移动androidx
+def move_androidx(decompileDir, smali_dir):
+    s1 = os.path.join(decompileDir, smali_dir, "androidx")
+    if os.path.exists(s1):
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, ["activity", "annotation", "appcompat", "arch", "asynclayoutinflater", "browser"])
+
+    s1 = os.path.join(decompileDir, smali_dir, "androidx")
+    if os.path.exists(s1):
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3,
+                     ["tracing", "transition", "vectordrawable", "versionedparcelable", "viewpager", "viewpager2",
+                      "webkit", "work"])
+
+    s1 = os.path.join(decompileDir, smali_dir, "androidx")
+    if os.path.exists(s1):
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, ["cardview", "collection", "concurrent", "constraintlayout", "coordinatorlayout", "core",
+                              "cursoradapter", "customview", "documentfile", "drawerlayout", "dynamicanimation"])
+
+    s1 = os.path.join(decompileDir, smali_dir, "androidx")
+    if os.path.exists(s1):
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, ["emoji2", "fragment", "inspection", "interpolator"])
+
+    s1 = os.path.join(decompileDir, smali_dir, "androidx")
+    if os.path.exists(s1):
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, ["print", "recyclerview", "resourceinspection", "room", "savedstate", "security",
+                              "slidingpanelayout", "sqlite", "startup", "swiperefreshlayout"])
+
+    s1 = os.path.join(decompileDir, smali_dir, "androidx")
+    if os.path.exists(s1):
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, ["media", "multidex", "navigation"])
+
+    s1 = os.path.join(decompileDir, smali_dir, "androidx")
+    if os.path.exists(s1):
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, ["legacy", "lifecycle", "loader", "localbroadcastmanager"])
+    # androidx 移动完毕
+
+
 if __name__ == '__main__':
     replace_init_code("D:\work\lyjymb")

BIN
率土之滨酷派/script.pyc


BIN
率土之滨酷派/率土之滨酷派.zip


+ 88 - 0
王牌战争酷派/script.py

@@ -0,0 +1,88 @@
+# coding:utf8
+
+__author__ = '灌篮高手酷派'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+
+import distutils.dir_util
+
+
+def replace_life_method(extract_dir):
+    goal_files = glob.glob(os.path.join(extract_dir, 'smali*/com/yingxiong/hero/UnityPlayerActivity.smali'))
+    if len(goal_files) == 0:
+        return
+    goal_file = goal_files[0]
+    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 = '.method protected onResume()V'
+            str = '.method public onResume()V\n' \
+                  'invoke-static {}, Lcom/kf/framework/SDKPluginWrapper;->onResume()V'
+            cont = cont.replace(change_str, str)
+
+            change_str_1 = '.method protected onPause()V'
+            str_1 = '.method public onPause()V\n' \
+                    'invoke-static {}, Lcom/kf/framework/SDKPluginWrapper;->onPause()V'
+            cont = cont.replace(change_str_1, str_1)
+            logging.info('replace_str: ' + cont)
+        with open(goal_file, 'w+') as tf:
+            tf.write(cont)
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+
+    if channelSdkInfo['id'] == '549':
+        replace_life_method(decompileDir)
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+
+    if channelSdkInfo['id'] == '591' or channelSdkInfo['id'] == '549':
+        s1 = os.path.join(decompileDir, "smali_classes2")
+        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)
+
+
+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)
+
+
+if __name__ == '__main__':
+    replace_life_method("D:\\work\\xmy")

+ 18 - 2
蛋仔派对酷派/script.py

@@ -56,8 +56,16 @@ def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameIn
                 distutils.dir_util.mkpath(s3)
             move_package_one(s1, s3)
 
-    if sdk_id == "549":
-        s1 = os.path.join(decompileDir, "smali_classes8", "com")
+        s1 = os.path.join(decompileDir, "smali_classes5","com","netease")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com","netease")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, ["mpay", "ngpush", "ntunisdk", "party", "unisdk"])
+
+    if sdk_id == "549" or sdk_id=="591":
+        s1 = os.path.join(decompileDir, "smali_classes7", "com")
         if os.path.exists(s1):
             smali_classes2_dir = create_mutil_smali(decompileDir)
             s3 = os.path.join(smali_classes2_dir, "com")
@@ -65,6 +73,14 @@ def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameIn
                 distutils.dir_util.mkpath(s3)
             move_package(s1, s3, ["netease"])
 
+        # s1 = os.path.join(decompileDir, "smali_classes8", "com")
+        # if os.path.exists(s1):
+        #     smali_classes2_dir = create_mutil_smali(decompileDir)
+        #     s3 = os.path.join(smali_classes2_dir, "com")
+        #     if not os.path.exists(s3):
+        #         distutils.dir_util.mkpath(s3)
+        #     move_package(s1, s3, ["netease"])
+
     return
 
 

BIN
阴阳师酷派/qDebrD.zip


+ 31 - 3
阴阳师酷派/script.py

@@ -35,6 +35,7 @@ def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channe
     return
 
 
+
 def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
     logging.info('game_pack_info: ' + str(channel_sdk_info))
     fix_android_manifest(extract_dir)
@@ -42,11 +43,11 @@ def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_chann
         s1 = os.path.join(extract_dir, "smali_classes4", "com/netease")
         smali_dir = create_mutil_smali(extract_dir)
         s3 = os.path.join(smali_dir, "com/netease")
-        list_package = ["androidcrashhandler", "autotext", "environment", "godlikeshare", "htprotect", "neox", "ngpush",
-                        "ntunisdk"]
+        list_package = ["androidcrashhandler","autotext","environment","godlikeshare","htprotect","neox","ngpush","ntunisdk"]
         if not os.path.exists(s3):
             distutils.dir_util.mkpath(s3)
         move_package(s1, s3, list_package)
+        replace_kf_application(extract_dir)
 
     if channel_sdk_info['id'] == "323":
         change_smali(extract_dir)
@@ -105,6 +106,15 @@ def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_chann
         if not os.path.exists(s3):
             distutils.dir_util.mkpath(s3)
         move_package(s1, s3, list_package)
+
+    if channel_sdk_info['id'] == "549" or channel_sdk_info['id'] == "591":
+        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"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
     return
 
 
@@ -265,6 +275,24 @@ def move_package_for_small_sheep(extract_dir):
         distutils.dir_util.mkpath(s3)
     move_package(s1, s3, list_package)
 
+lines = ['invoke-virtual {p3}, Lcom/kf/framework/KFApplication;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;',
+         'invoke-virtual {v0}, Lcom/kf/framework/KFApplication;->onCreate()V']
+def replace_kf_application(extract_dir):
+    goal_file = glob.glob(os.path.join(extract_dir, 'smali*/com/netease/ntunisdk/unifix_hotfix_library/proxyApplication/UFProxyApplication.smali'))[0]
+    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()
+            for line in lines:
+                change_line = line.replace('Lcom/kf/framework/KFApplication',
+                                           'Landroid/app/Application')
+                cont = cont.replace(line, change_line)
+            logging.info('replace_str: ' + cont)
+        with open(goal_file, 'w+') as tf:
+            tf.write(cont)
+
 
 if __name__ == '__main__':
-    fix_android_manifest("D:\\work\\yys")
+    replace_kf_application("D:\\work\\yys")

BIN
阴阳师酷派/script.pyc


BIN
阴阳师酷派/阴阳师酷派.zip


+ 185 - 0
风暴魔域2酷派/script.py

@@ -0,0 +1,185 @@
+# coding:utf8
+
+__author__ = 'dong'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+import distutils.dir_util
+import os
+import gw_apk_tool
+import gw_file_system
+
+
+def script_second(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['id'] == '597':
+        logging.info("remove_navigate")
+        remove_navigate(decompileDir)
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "597":
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["activity","annotation","appcompat","arch","asynclayoutinflater","browser"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["tracing","transition","vectordrawable","versionedparcelable","viewpager","viewpager2","webkit","work"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["cardview","collection","concurrent","constraintlayout","coordinatorlayout","core","cursoradapter","customview","documentfile","drawerlayout","dynamicanimation"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["emoji2","fragment","inspection","interpolator"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["print","recyclerview","resourceinspection","room","savedstate","security","slidingpanelayout","sqlite","startup","swiperefreshlayout"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["media","multidex","navigation"])
+
+        s1 = os.path.join(decompileDir, "smali", "androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["legacy","lifecycle","loader","localbroadcastmanager"])
+        # androidx 移动完毕
+
+        s1 = os.path.join(decompileDir, "smali_classes2", "com/kingsoft/shiyou/omnisdk")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "com/kingsoft/shiyou/omnisdk")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["plugin","project"])
+
+        s1 = os.path.join(decompileDir, "smali_classes2", "com/kingsoft/shiyou/omnisdk")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "com/kingsoft/shiyou/omnisdk")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["api","basic","channel","core"])
+        # smali_classes2结束
+
+        s1 = os.path.join(decompileDir, "smali_classes3", "com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "com")
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3,["snyu","tencent","unionpay","unity3d","vmadalin","yulong"])
+    return
+
+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 move_11_bytedance(decompileDir):
+    s1 = os.path.join(decompileDir, "smali_classes11/com/bytedance")
+    smali_classes_new = create_mutil_smali(decompileDir)
+    s3 = os.path.join(decompileDir, smali_classes_new)
+    list_package = ["rocketapi", "wrapper_account", "wrapper_alog", "wrapper_appcloud", "wrapper_applog"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    s1 = os.path.join(decompileDir, "smali_classes11/com/bytedance")
+    smali_classes_new = create_mutil_smali(decompileDir)
+    s3 = os.path.join(decompileDir, smali_classes_new)
+    list_package = ["wrapper_download", "wrapper_encrypt", "wrapper_jsbridge", "wrapper_librarian", "wrapper_net"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    s1 = os.path.join(decompileDir, "smali_classes11/com/bytedance")
+    smali_classes_new = create_mutil_smali(decompileDir)
+    s3 = os.path.join(decompileDir, smali_classes_new)
+    list_package = ["wrapper_pangolinsdk", "wrapper_push", "wrapper_sdk_monitor", "wrapper_service_manager",
+                    "wrapper_setting_manager"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    s1 = os.path.join(decompileDir, "smali_classes11/com/bytedance")
+    smali_classes_new = create_mutil_smali(decompileDir)
+    s3 = os.path.join(decompileDir, smali_classes_new)
+    list_package = ["wrapper_share", "wrapper_smartrouter", "wrapper_utility"]
+    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 = 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 remove_navigate(decompileDir):
+    tmp_res = os.path.join(decompileDir, "res", "navigation")
+    tmp_public_xml = os.path.join(decompileDir, "res", "values", "public.xml")
+    if os.path.exists(tmp_res):
+        distutils.dir_util.remove_tree(tmp_res)
+    if os.path.exists(tmp_public_xml):
+        os.remove(tmp_public_xml)
+
+
+if __name__ == '__main__':
+    # del_qihoo("C:\\Users\\Administrator\\Desktop\\zt")
+    remove_navigate("G:\\autopack2.0_kuaifa\\tool\\workspace\\lrs360\\13651\\extract")