dongguoliang@kuaifazs.com лет назад: 3
Родитель
Сommit
0b9f137fd3

+ 150 - 0
一起来修仙酷派/script.py

@@ -0,0 +1,150 @@
+# coding:utf8
+import os
+import logging
+import re
+import glob
+import shutil
+import xml.etree.ElementTree as ET
+import distutils.dir_util
+
+import gw_file_system
+
+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_second(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    logging.info('script_second: ' + str(channel_sdk_info))
+    return
+
+
+def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+
+    s1 = os.path.join(decompileDir, "smali/androidx")
+    if channelSdkInfo['id']=="597" and os.path.exists(s1):
+
+        s1 = os.path.join(decompileDir, "smali/androidx")
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        list_package = ["documentfile","drawerlayout","fragment","interpolator","legacy","lifecycle","loader","localbroadcastmanager","multidex"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        list_package = ["preference", "print", "recyclerview", "room", "savedstate", "slidingpanelayout", "sqlite",
+                        "swiperefreshlayout", "vectordrawable", "versionedparcelable", "viewpager", "work"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali/androidx")
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        list_package = ["activity", "appcompat", "asynclayoutinflater", "constraintlayout", "core", "customview",
+                        "drawerlayout", "fragment", "interpolator", "lifecycle", "localbroadcastmanager", "multidex",
+                        "annotation", "arch", "collection", "coordinatorlayout", "cursoradapter", "documentfile",
+                        "exifinterface", "inspection", "legacy", "loader", " media"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+    if channelSdkInfo['id']=="549" or channelSdkInfo['id']=="591":
+        s1 = os.path.join(decompileDir, "smali_classes4/com")
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "com")
+        list_package = ["uc","umeng","unity3d","yasirkula","yulong","zy"]
+        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
+
+
+def handle_public_xml_param(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 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("offline_banners") > -1 or line.find("outfit7") > -1 or line.find(
+                    "countries") > -1 or line.find(
+                "county_codes") > -1 or line.find("felis_error_reporting_files") > -1:
+                continue
+            new_lines.append(line)
+        f.seek(0)
+        f.truncate()
+        f.writelines(new_lines)
+    return
+
+
+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__':
+    script_last("/tmp/ss", "G:/autopack2.0_kuaifa/tool/workspace/wdajl/15957/extract/", {"id": "309"}, "", "")
+    # xml_path = "E:/apk/youhua/jingmenfengyue_216122/res/values/public.xml"
+    # handle_public_xml(xml_path)
+    # hideSplash("/mnt/share/yanghuang/python_test/cr")

+ 140 - 0
弹弹堂大冒险酷派/script.py

@@ -0,0 +1,140 @@
+# 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):
+    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-----")
+    return
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "597" :#深圳 成都都是用这个id
+        s1 = os.path.join(decompileDir, "smali_classes2","androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            list_package = ["fragment", "interpolator", "legacy", "lifecycle", "loader", "localbroadcastmanager"]
+            list_package.extend(
+                ["multidex", "print", "recyclerview", "slidingpanelayout", "swiperefreshlayout", "vectordrawable",
+                 "versionedparcelable", "viewpager"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+    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")

+ 52 - 0
我的安吉拉2酷派/script.py

@@ -22,6 +22,23 @@ def script_second(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_cha
     if channel_sdk_info['id'] == "512":
         public_xml = os.path.join(extract_dir, "res/values/public.xml")
         handle_public_xml(public_xml)
+
+    if channel_sdk_info['id'] == "597":
+        remove_navigate(extract_dir)
+
+        public_xml = os.path.join(extract_dir, "res/values/arrays.xml")
+        # handle_public_xml_param(public_xml, "com.jinke.mao.css.api")
+        # handle_public_xml_param(public_xml, "outfit7")
+        # handle_public_xml_param(public_xml, "kotlin")
+        # handle_public_xml_param(public_xml, "acra")
+
+        if os.path.exists(public_xml):
+            os.remove(public_xml)
+
+        public_xml = os.path.join(extract_dir, "res/layout/felis_navigation_container.xml")
+        if os.path.exists(public_xml):
+            os.remove(public_xml)
+
     return
 
 
@@ -78,6 +95,15 @@ def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameIn
         # distutils.dir_util.copy(png, asserts)
         shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + "/agereminder_title.9.png", asserts)
 
+    if channelSdkInfo["id"] == "597":
+        s1 = os.path.join(decompileDir, "smali_classes2", "com")
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "com")
+        list_package = ["jkjoy", "meizu", "outfit7"]
+        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:
@@ -110,6 +136,23 @@ def create_mutil_smali(decompileDir):
     return smali_classes2_dir
 
 
+def handle_public_xml_param(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 handle_public_xml(public_xml_path):
     if not os.path.exists(public_xml_path):
         logging.info('public_xml is null: ' + public_xml_path)
@@ -129,6 +172,15 @@ def handle_public_xml(public_xml_path):
     return
 
 
+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__':
     script_last("/tmp/ss", "G:/autopack2.0_kuaifa/tool/workspace/wdajl/15957/extract/", {"id": "309"}, "", "")
     # xml_path = "E:/apk/youhua/jingmenfengyue_216122/res/values/public.xml"

BIN
我的安吉拉2酷派/script.pyc


BIN
我的安吉拉2酷派/我的安吉拉2酷派.zip


+ 133 - 0
我的门派酷派/script.py

@@ -0,0 +1,133 @@
+# coding:utf8
+import os
+import logging
+import re
+import glob
+import shutil
+import xml.etree.ElementTree as ET
+import distutils.dir_util
+
+import gw_file_system
+
+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_second(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    logging.info('script_second: ' + str(channel_sdk_info))
+    return
+
+
+def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+
+    s1 = os.path.join(decompileDir, "smali/androidx")
+    if channelSdkInfo['id']=="597" and os.path.exists(s1):
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        list_package = ["preference", "print", "recyclerview", "room", "savedstate", "slidingpanelayout", "sqlite",
+                        "swiperefreshlayout", "vectordrawable", "versionedparcelable", "viewpager", "work"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali/androidx")
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        list_package = ["activity", "appcompat", "asynclayoutinflater", "constraintlayout", "core", "customview",
+                        "drawerlayout", "fragment", "interpolator", "lifecycle", "localbroadcastmanager", "multidex",
+                        "annotation", "arch", "collection", "coordinatorlayout", "cursoradapter", "documentfile",
+                        "exifinterface", "inspection", "legacy", "loader", " media"]
+        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
+
+
+def handle_public_xml_param(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 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("offline_banners") > -1 or line.find("outfit7") > -1 or line.find(
+                    "countries") > -1 or line.find(
+                "county_codes") > -1 or line.find("felis_error_reporting_files") > -1:
+                continue
+            new_lines.append(line)
+        f.seek(0)
+        f.truncate()
+        f.writelines(new_lines)
+    return
+
+
+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__':
+    script_last("/tmp/ss", "G:/autopack2.0_kuaifa/tool/workspace/wdajl/15957/extract/", {"id": "309"}, "", "")
+    # xml_path = "E:/apk/youhua/jingmenfengyue_216122/res/values/public.xml"
+    # handle_public_xml(xml_path)
+    # hideSplash("/mnt/share/yanghuang/python_test/cr")

+ 152 - 0
烈火封神酷派/script.py

@@ -0,0 +1,152 @@
+# 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/dimens.xml")
+        handle_public_xml(public_xml, "dp_2_5")
+        handle_public_xml(public_xml, "dp_4_5")
+
+        public_xml = os.path.join(extract_dir, "res/values/public.xml")
+        handle_public_xml(public_xml, "dp_2_5")
+        handle_public_xml(public_xml, "dp_4_5")
+
+    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-----")
+    return
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "591" or sdk_id == "549":
+        s1 = os.path.join(decompileDir, "smali_classes3","androidx")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir, "androidx")
+            list_package = ["fragment", "interpolator", "legacy", "lifecycle", "loader", "localbroadcastmanager"]
+            list_package.extend(
+                ["multidex", "print", "recyclerview", "slidingpanelayout", "swiperefreshlayout", "vectordrawable",
+                 "versionedparcelable", "viewpager"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+    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")

+ 141 - 0
烈焰天下酷派/script.py

@@ -0,0 +1,141 @@
+# coding:utf8
+import os
+import logging
+import re
+import glob
+import shutil
+import xml.etree.ElementTree as ET
+import distutils.dir_util
+
+import gw_file_system
+
+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_second(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    logging.info('script_second: ' + str(channel_sdk_info))
+    return
+
+
+def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+
+    s1 = os.path.join(decompileDir, "smali_classes3/androidx")
+    if channelSdkInfo['id']=="597" and os.path.exists(s1):
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        list_package = ["preference", "print", "recyclerview", "room", "savedstate", "slidingpanelayout", "sqlite",
+                        "swiperefreshlayout", "vectordrawable", "versionedparcelable", "viewpager", "work"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes3/androidx")
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        list_package = ["activity", "appcompat", "asynclayoutinflater", "constraintlayout", "core", "customview",
+                        "drawerlayout", "fragment", "interpolator", "lifecycle", "localbroadcastmanager", "multidex",
+                        "annotation", "arch", "collection", "coordinatorlayout", "cursoradapter", "documentfile",
+                        "exifinterface", "inspection", "legacy", "loader", " media"]
+        if not os.path.exists(s3):
+            distutils.dir_util.mkpath(s3)
+        move_package(s1, s3, list_package)
+
+    if channelSdkInfo['id']=="549" or channelSdkInfo['id']=="591":
+        s1 = os.path.join(decompileDir, "smali_classes5/androidx")
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        list_package = ["documentfile","drawerlayout","fragment","interpolator","legacy","lifecycle","loader","localbroadcastmanager","multidex"]
+        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
+
+
+def handle_public_xml_param(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 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("offline_banners") > -1 or line.find("outfit7") > -1 or line.find(
+                    "countries") > -1 or line.find(
+                "county_codes") > -1 or line.find("felis_error_reporting_files") > -1:
+                continue
+            new_lines.append(line)
+        f.seek(0)
+        f.truncate()
+        f.writelines(new_lines)
+    return
+
+
+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__':
+    script_last("/tmp/ss", "G:/autopack2.0_kuaifa/tool/workspace/wdajl/15957/extract/", {"id": "309"}, "", "")
+    # xml_path = "E:/apk/youhua/jingmenfengyue_216122/res/values/public.xml"
+    # handle_public_xml(xml_path)
+    # hideSplash("/mnt/share/yanghuang/python_test/cr")

+ 172 - 0
铁杆三国酷派/script.py

@@ -0,0 +1,172 @@
+# 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
+    sdk_id =  channel_sdk_info['id']
+    if sdk_id == "597" :#深圳 成都都是用这个id
+        public_xml = os.path.join(extract_dir, "res/values/public.xml")
+        handle_public_xml(public_xml, "attr-private")
+
+        public_xml = os.path.join(extract_dir, "res/layout/design_bottom_sheet_dialog.xml")
+        handle_public_xml(public_xml, "attr-private")
+
+        public_xml = os.path.join(extract_dir, "res/layout/mtrl_layout_snackbar.xml")
+        # handle_public_xml(public_xml, "attr-private")
+        os.remove(public_xml)
+
+        public_xml = os.path.join(extract_dir, "res/layout-sw600dp/mtrl_layout_snackbar.xml")
+        # handle_public_xml(public_xml, "attr-private")
+        os.remove(public_xml)
+
+        public_xml = os.path.join(extract_dir, "res/values/public.xml")
+        handle_public_xml(public_xml, "mtrl_layout_snackbar")
+
+        public_xml = os.path.join(extract_dir, "res/layout/mtrl_layout_snackbar_include.xml")
+        handle_public_xml(public_xml, "attr-private")
+
+        public_xml = os.path.join(extract_dir, "res/drawable-v21/abc_dialog_material_background.xml")
+        handle_public_xml(public_xml, "attr-private")
+
+        public_xml = os.path.join(extract_dir, "res/values/styles.xml")
+        handle_public_xml(public_xml, "attr-private")
+
+        public_xml = os.path.join(extract_dir, "res/values-v21/styles.xml")
+        handle_public_xml(public_xml, "attr-private")
+
+    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):
+    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")
+            list_package = ["fragment", "interpolator", "legacy", "lifecycle", "loader", "localbroadcastmanager"]
+            list_package.extend(
+                ["multidex", "print", "recyclerview", "slidingpanelayout", "swiperefreshlayout", "vectordrawable",
+                 "versionedparcelable", "viewpager"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+    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")

+ 547 - 0
镇魂街:天生为王酷派/script.py

@@ -0,0 +1,547 @@
+# 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
+    sdk_id =  channel_sdk_info['id']
+    if sdk_id == "597" :#深圳 成都都是用这个id
+        public_xml = os.path.join(extract_dir, "res/values/public.xml")
+        handle_public_xml(public_xml, "attr-private")
+
+        # public_xml = os.path.join(extract_dir, "res/layout/design_bottom_sheet_dialog.xml")
+        # handle_public_xml(public_xml, "attr-private")
+        #
+        # public_xml = os.path.join(extract_dir, "res/layout/mtrl_layout_snackbar.xml")
+        # # handle_public_xml(public_xml, "attr-private")
+        # os.remove(public_xml)
+        #
+        # public_xml = os.path.join(extract_dir, "res/layout-sw600dp/mtrl_layout_snackbar.xml")
+        # # handle_public_xml(public_xml, "attr-private")
+        # os.remove(public_xml)
+        #
+        # public_xml = os.path.join(extract_dir, "res/values/public.xml")
+        # handle_public_xml(public_xml, "mtrl_layout_snackbar")
+        #
+        # public_xml = os.path.join(extract_dir, "res/layout/mtrl_layout_snackbar_include.xml")
+        # handle_public_xml(public_xml, "attr-private")
+        #
+        # public_xml = os.path.join(extract_dir, "res/drawable-v21/abc_dialog_material_background.xml")
+        # handle_public_xml(public_xml, "attr-private")
+        #
+        # public_xml = os.path.join(extract_dir, "res/values/styles.xml")
+        # handle_public_xml(public_xml, "attr-private")
+        #
+        # public_xml = os.path.join(extract_dir, "res/values-v21/styles.xml")
+        # handle_public_xml(public_xml, "attr-private")
+
+    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):
+    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 = 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(decompileDir, "smali_classes2","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["albaba","alipay","android","asus","bumptech","bun","ccsingle","cmge","facebook"]
+            list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        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")
+            list_package = ["albaba","alipay"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        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")
+            list_package = ["android","asus"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        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")
+            list_package = ["bumptech","bun"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        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")
+            list_package = ["ccsingle","cmge"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        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")
+            list_package = ["facebook"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        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")
+            list_package = []
+            list_package.extend(["google","heytap"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+
+        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")
+            list_package = []
+            list_package.extend(["hihonor","huawei"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        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")
+            list_package = []
+            list_package.extend(["ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        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")
+            list_package = []
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            list_package.extend(["lzy","mcs"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        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")
+            list_package = []
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            list_package.extend(["meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes3")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,)
+            list_package = []
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            list_package.extend(["androidx"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes4","com")
+        if os.path.exists(s1):
+
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["albaba","alipay"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes4","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["android","asus"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes4","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["bumptech","bun"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes4","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["ccsingle","cmge"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes4","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["facebook"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes4","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = []
+            list_package.extend(["google","heytap"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+
+        s1 = os.path.join(decompileDir, "smali_classes4","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = []
+            list_package.extend(["hihonor","huawei"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes4","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = []
+            list_package.extend(["ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes4","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = []
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            list_package.extend(["lzy","mcs"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes4","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = []
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            list_package.extend(["meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes4")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,)
+            list_package = []
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            list_package.extend(["androidx"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes5","com")
+        if os.path.exists(s1):
+
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["albaba","alipay"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes5","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["android","asus"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes5","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["bumptech","bun"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes5","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["ccsingle","cmge"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes5","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = ["facebook"]
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes5","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = []
+            list_package.extend(["google","heytap"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+
+        s1 = os.path.join(decompileDir, "smali_classes5","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = []
+            list_package.extend(["hihonor","huawei"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes5","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = []
+            list_package.extend(["ipaynow","jtly","koushikdutta"])
+            # list_package.extend(["lzy","mcs","meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes5","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = []
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            list_package.extend(["lzy","mcs"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes5","com")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,"com")
+            list_package = []
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            list_package.extend(["meizu","onevcat","renderheads"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+
+        s1 = os.path.join(decompileDir, "smali_classes5")
+        if os.path.exists(s1):
+            smali_classes2_dir = create_mutil_smali(decompileDir)
+            s3 = os.path.join(smali_classes2_dir,)
+            list_package = []
+            # list_package.extend(["google","heytap","hihonor","huawei","ipaynow","jtly","koushikdutta"])
+            list_package.extend(["androidx"])
+            if not os.path.exists(s3):
+                distutils.dir_util.mkpath(s3)
+            move_package(s1, s3, list_package)
+    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")

+ 16 - 1
阴阳师酷派/script.py

@@ -115,6 +115,16 @@ 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'] == "591" or channel_sdk_info['id'] == "549" :
+        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)
+
     return
 
 
@@ -278,7 +288,12 @@ def move_package_for_small_sheep(extract_dir):
 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]
+    # goal_file = glob.glob(os.path.join(extract_dir, 'smali*/com/netease/ntunisdk/unifix_hotfix_library/proxyApplication/UFProxyApplication.smali'))[0]
+    goal_file_list = glob.glob(os.path.join(extract_dir, 'smali*/com/netease/ntunisdk/unifix_hotfix_library/proxyApplication/UFProxyApplication.smali'))
+    if len(goal_file_list)==0:
+        logging.info("没有UFPROXYAPPlication")
+        return
+    goal_file=goal_file_list[0]
     print(os.path.isfile(goal_file))
     if os.path.isfile(goal_file):
         logging.info('method_proceed: ' + 'goal_file')

BIN
阴阳师酷派/script.pyc


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