Kaynağa Gözat

目前全部脚本

dongguoliang@kuaifazs.com 4 yıl önce
işleme
9f13f00e8d
100 değiştirilmiş dosya ile 2851 ekleme ve 0 silme
  1. 1 0
      .gitignore
  2. BIN
      yiqibuyu360/39285EFA.dex
  3. 252 0
      yiqibuyu360/script.py
  4. BIN
      yiqibuyu360/script.pyc
  5. BIN
      yiqibuyu360/yiqibuyu360.zip
  6. BIN
      一拳超人酷派/Xrz1uL.zip
  7. 91 0
      一拳超人酷派/script.py
  8. BIN
      一拳超人酷派/script.pyc
  9. BIN
      一拳超人酷派/一拳超人酷派.zip
  10. 94 0
      一梦江湖酷派/script.py
  11. BIN
      一梦江湖酷派/script.pyc
  12. BIN
      三国志2017-光荣正版360/9eP8mT.zip
  13. BIN
      三国志2017-光荣正版360/FFFFFF-0.png
  14. 119 0
      三国志2017-光荣正版360/script.py
  15. BIN
      三国志2017-光荣正版360/script.pyc
  16. BIN
      三国志2017-光荣正版360/三国志2017-光荣正版360.zip
  17. 120 0
      三国志威力无双酷派/script.py
  18. BIN
      三国志威力无双酷派/script.pyc
  19. BIN
      三国志威力无双酷派/三国志威力无双酷派.zip
  20. BIN
      三国志战略版/DyL0aH.zip
  21. BIN
      三国志战略版/bDWD04.zip
  22. 75 0
      三国志战略版/script.py
  23. BIN
      三国志战略版/script.pyc
  24. BIN
      三国志战略版/三国志战略版.zip
  25. BIN
      三国杀名将传酷派/39285EFA.dex
  26. 40 0
      三国杀名将传酷派/script.py
  27. BIN
      三国杀名将传酷派/script.pyc
  28. BIN
      三国杀名将传酷派/三国杀名将传酷派.zip
  29. BIN
      九州天空城/1m1K04.zip
  30. BIN
      九州天空城/39285EFA.dex
  31. 18 0
      九州天空城/script.py
  32. BIN
      九州天空城/script.pyc
  33. BIN
      九州天空城/九州天空城.zip
  34. BIN
      九州天空城/龙珠觉醒360.zip
  35. BIN
      乱斗大联盟/39285EFA.dex
  36. BIN
      乱斗大联盟/bdxadsdk.jar
  37. 100 0
      乱斗大联盟/script.py
  38. BIN
      乱斗大联盟/script.pyc
  39. BIN
      乱斗大联盟/乱斗大联盟.zip
  40. 135 0
      仙凡幻想360/script.py
  41. BIN
      仙凡幻想360/script.pyc
  42. BIN
      仙凡幻想360/仙凡幻想360.zip
  43. 98 0
      仙剑奇侠传3D回合360/script.py
  44. BIN
      仙剑奇侠传3D回合360/script.pyc
  45. BIN
      仙剑奇侠传3D回合360/仙剑奇侠传3D回合360.zip
  46. BIN
      仙剑奇侠传移动版酷派/kupai.zip
  47. 60 0
      仙剑奇侠传移动版酷派/script.py
  48. BIN
      仙剑奇侠传移动版酷派/script.pyc
  49. 18 0
      余烬风暴酷派/script.py
  50. BIN
      余烬风暴酷派/script.pyc
  51. BIN
      余烬风暴酷派/余烬风暴酷派.zip
  52. 113 0
      傲世龙城酷派/script.py
  53. BIN
      傲世龙城酷派/script.pyc
  54. BIN
      傲世龙城酷派/傲世龙城酷派.zip
  55. 61 0
      冰火创世纪酷派/script.py
  56. BIN
      冰火创世纪酷派/script.pyc
  57. BIN
      冰火创世纪酷派/冰火创世纪酷派.zip
  58. BIN
      剑与家园360/T0er9C.zip
  59. 132 0
      剑与家园360/script.py
  60. BIN
      剑与家园360/script.pyc
  61. BIN
      剑与家园360/剑与家园360.zip
  62. 122 0
      呆萌骑士酷派/script.py
  63. BIN
      呆萌骑士酷派/script.pyc
  64. BIN
      呆萌骑士酷派/呆萌骑士酷派.zip
  65. BIN
      哥哥捕鱼/1SaDmL.zip
  66. 93 0
      哥哥捕鱼/1SaDmL/script.py
  67. BIN
      哥哥捕鱼/1SaDmL/script.pyc
  68. 26 0
      哥哥捕鱼/script.py
  69. BIN
      哥哥捕鱼/script.pyc
  70. BIN
      哥哥捕鱼/哥哥捕鱼.zip
  71. BIN
      哥哥捕鱼酷派/1SaDmL.zip
  72. 84 0
      哥哥捕鱼酷派/script.py
  73. BIN
      哥哥捕鱼酷派/script.pyc
  74. BIN
      哥哥捕鱼酷派/哥哥捕鱼酷派.zip
  75. BIN
      圣斗士星矢重生360/39285EFA.dex
  76. BIN
      圣斗士星矢重生360/FFFFFF-0.png
  77. 254 0
      圣斗士星矢重生360/script.py
  78. BIN
      圣斗士星矢重生360/script.pyc
  79. BIN
      圣斗士星矢重生360/圣斗士星矢重生360.zip
  80. BIN
      坦克前线360/39285EFA.dex
  81. 100 0
      坦克前线360/script.py
  82. BIN
      坦克前线360/script.pyc
  83. BIN
      坦克前线360/坦克前线360.zip
  84. 114 0
      大唐无双/script.py
  85. BIN
      大唐无双/script.pyc
  86. BIN
      大唐无双/大唐无双.zip
  87. 139 0
      大唐无双其它CP/script.py
  88. BIN
      大唐无双其它CP/script.pyc
  89. BIN
      大唐无双其它CP/大唐无双其它CP.zip
  90. BIN
      天下360/39285EFA.dex
  91. 147 0
      天下360/script.py
  92. BIN
      天下360/script.pyc
  93. BIN
      天下360/天下360.zip
  94. 111 0
      天下酷派/script.py
  95. BIN
      天下酷派/script.pyc
  96. BIN
      天下酷派/天下酷派.zip
  97. 134 0
      天谕手游其它cp/script.py
  98. BIN
      天谕手游其它cp/script.pyc
  99. BIN
      天谕手游其它cp/天谕手游其它cp.zip
  100. 0 0
      天龙八部3D麟游/XX5mnD.zip

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+venv/

BIN
yiqibuyu360/39285EFA.dex


+ 252 - 0
yiqibuyu360/script.py

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

BIN
yiqibuyu360/script.pyc


BIN
yiqibuyu360/yiqibuyu360.zip


BIN
一拳超人酷派/Xrz1uL.zip


+ 91 - 0
一拳超人酷派/script.py

@@ -0,0 +1,91 @@
+# 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
+
+change_map = {
+    "invoke-virtual {v0}, Lcom/kf/framework/KFApplication;->onCreate()V": "invoke-virtual {v0}, Landroid/app/Application;->onCreate()V",
+    "invoke-virtual {v0}, Lcom/kf/framework/KFApplication;->onLowMemory()V": "invoke-virtual {v0}, Landroid/app/Application;->onLowMemory()V",
+    "invoke-virtual {v0}, Lcom/kf/framework/KFApplication;->onTerminate()V": "invoke-virtual {v0}, Landroid/app/Application;->onTerminate()V",
+    "invoke-virtual {v0, p1}, Lcom/kf/framework/KFApplication;->onConfigurationChanged(Landroid/content/res/Configuration;)V": "invoke-virtual {v0, p1}, Landroid/app/Application;->onConfigurationChanged(Landroid/content/res/Configuration;)V",
+    "invoke-virtual {v0, p1}, Lcom/kf/framework/KFApplication;->onTrimMemory(I)V": "invoke-virtual {v0, p1}, Landroid/app/Application;->onTrimMemory(I)V", }
+
+
+def replace_super_application(decompileDir):
+    smali_files = glob.glob(
+        os.path.join(decompileDir, 'smali*/ourpalm/android/channels/Info/Ourpalm_Channels_Application.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 script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['SDKName'] == 'reverseforkupai':
+        replace_super_application(decompileDir)
+
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "549":
+        s1 = os.path.join(decompileDir, "smali_classes3/androidx")
+        if not os.path.exists(s1):
+            return
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+        s3 = os.path.join(smali_classes2_dir, "androidx")
+        list_package = ["arch", "collection", "core", "customview", "drawerlayout", "interpolator", "lifecycle",
+                        "localbroadcastmanager", "multidex", "asynclayoutinflater", "coordinatorlayout",
+                        "cursoradapter", "documentfile", "fragment", "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
+
+
+if __name__ == '__main__':
+    replace_super_application("D:\\work\\yqcr")

BIN
一拳超人酷派/script.pyc


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


+ 94 - 0
一梦江湖酷派/script.py

@@ -0,0 +1,94 @@
+# coding:utf8
+
+__author__ = 'Snow'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+import distutils.dir_util
+import gw_file_system
+from xml.etree import ElementTree as ET
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "589":
+        modify_manifest(decompileDir)
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    # smali_classes4
+    s1 = os.path.join(decompileDir, "smali_classes4", "com")
+    if not os.path.exists(s1):
+        return
+    smali_classes2_dir = create_mutil_smali(decompileDir)
+
+    s3 = smali_classes2_dir
+    list_package = ["example", "getkeepsafe", "netease"]
+    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
+    os.mkdir(smali_classes2_dir)
+    return smali_classes2_dir
+
+
+def modify_manifest(decompileDir):
+    ET.register_namespace('android', ANDROID_NS)
+    xmlparse = os.path.join(decompileDir, 'AndroidManifest.xml')
+    root_node = ET.parse(xmlparse)
+    root = root_node.getroot()
+    name = '{' + ANDROID_NS + '}name'
+    authorities = '{' + ANDROID_NS + '}foregroundServiceType'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application/service')
+    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__':
+    ""

BIN
一梦江湖酷派/script.pyc


BIN
三国志2017-光荣正版360/9eP8mT.zip


BIN
三国志2017-光荣正版360/FFFFFF-0.png


+ 119 - 0
三国志2017-光荣正版360/script.py

@@ -0,0 +1,119 @@
+# coding:utf8
+import os
+import logging
+import re
+import glob
+import shutil
+import gw_data_center
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    gw_data_center.pack_small = True
+    return
+
+
+def script(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    logging.info('game_pack_info: ' + str(channel_sdk_info))
+    # 逆向渠道id
+    if channel_sdk_info['id'] == "323":
+        fixLifecycleMethod(extract_dir)
+        hideSplash(extract_dir)
+    return
+
+
+def script_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+
+def hideSplash(preDir):
+    tfile = preDir + "/assets/bin/Data/splash.png"
+    picDir = os.path.dirname(tfile)
+    if not os.path.exists(picDir):
+        os.makedirs(picDir)
+        shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + '/FFFFFF-0.png', tfile)
+    else:
+        if os.path.isfile(tfile):
+            shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + '/FFFFFF-0.png', tfile)
+        else:
+            logging.info('game_pack_info: ' + tfile + 'is not exists!')
+
+    tfile = preDir + "/res/drawable/youkia_splash.png"
+    picDir = os.path.dirname(tfile)
+    if not os.path.exists(picDir):
+        os.makedirs(picDir)
+        shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + '/FFFFFF-0.png', tfile)
+    else:
+        if os.path.isfile(tfile):
+            shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + '/FFFFFF-0.png', tfile)
+        else:
+            logging.info('game_pack_info: ' + tfile + 'is not exists!')
+
+    tfile = preDir + "/res/values/styles.xml"
+    if os.path.isfile(tfile):
+        with open(tfile, 'r+') as f:
+            cont = f.read()
+            cont = cont.replace('<item name="android:windowBackground">@drawable/youkia_splash</item>'
+                                , '<item name="android:windowBackground">@color/transparent</item>')
+            f.truncate(len(cont))
+            f.seek(0)
+            f.write(cont)
+            f.close()
+    else:
+        logging.info('game_pack_info: ' + tfile + 'is not exists!')
+    return
+
+
+def intoFirstLine(target, repl, cont, superclass):
+    # 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:
+        # do call .super method
+        isuper = "invoke-super {p0}, " + superclass + "->" + target + "()V"
+        cont += "\n\n.method protected " + target + "()V\n    .locals 0\n\n    " + repl + "\n\n    " + isuper + "\n\n    return-void\n.end method"
+
+    return cont
+
+
+def fixLifecycleMethod(preDir):
+    for tfile in glob.glob(preDir + "/" + "smali*/com/youkia/gamecenter/GameCenterActivity.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"
+                }
+                mas = re.search('^.super L([^;]*);?', cont, re.MULTILINE)
+
+                superclass = ""
+                if mas:
+                    superclass = 'L' + mas.group(1) + ';'
+
+                for k, v in changes.iteritems():
+                    cont = intoFirstLine(k, v, cont, superclass)
+
+                f.seek(0)
+                f.truncate(len(cont))
+                f.write(cont)
+                f.close()
+
+
+if __name__ == '__main__':
+    script("/tmp/ss", "/mnt/share/yanghuang/python_test/any_dir", {"id": "323"}, "", "")
+    # hideSplash("/mnt/share/yanghuang/python_test/cr")

BIN
三国志2017-光荣正版360/script.pyc


BIN
三国志2017-光荣正版360/三国志2017-光荣正版360.zip


+ 120 - 0
三国志威力无双酷派/script.py

@@ -0,0 +1,120 @@
+# coding:utf8
+import os
+import logging
+import re
+import glob
+import shutil
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(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_pre(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    if channel_sdk_info['id'] == "512":
+        smali_classes2 = os.path.join(extract_dir, "smali_classes2/com/youkia/gamecenter")
+        smali = os.path.join(extract_dir, "smali/com/youkia/gamecenter")
+        if os.path.exists(smali_classes2):
+            # if not os.path.exists(smali):
+            #     os.mkdir(smali)
+            shutil.copytree(smali_classes2, smali)
+            shutil.rmtree(smali_classes2)
+    return
+
+
+def hideSplash(preDir):
+    tfile = preDir + "/assets/bin/Data/splash.png"
+    picDir = os.path.dirname(tfile)
+    if not os.path.exists(picDir):
+        os.makedirs(picDir)
+        shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + '/FFFFFF-0.png', tfile)
+    else:
+        if os.path.isfile(tfile):
+            shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + '/FFFFFF-0.png', tfile)
+        else:
+            logging.info('game_pack_info: ' + tfile + 'is not exists!')
+
+    tfile = preDir + "/res/drawable/youkia_splash.png"
+    picDir = os.path.dirname(tfile)
+    if not os.path.exists(picDir):
+        os.makedirs(picDir)
+        shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + '/FFFFFF-0.png', tfile)
+    else:
+        if os.path.isfile(tfile):
+            shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + '/FFFFFF-0.png', tfile)
+        else:
+            logging.info('game_pack_info: ' + tfile + 'is not exists!')
+
+    tfile = preDir + "/res/values/styles.xml"
+    if os.path.isfile(tfile):
+        with open(tfile, 'r+') as f:
+            cont = f.read()
+            cont = cont.replace('<item name="android:windowBackground">@drawable/youkia_splash</item>'
+                                , '<item name="android:windowBackground">@color/transparent</item>')
+            f.truncate(len(cont))
+            f.seek(0)
+            f.write(cont)
+            f.close()
+    else:
+        logging.info('game_pack_info: ' + tfile + 'is not exists!')
+    return
+
+
+def intoFirstLine(target, repl, cont, superclass):
+    # 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:
+        # do call .super method
+        isuper = "invoke-super {p0}, " + superclass + "->" + target + "()V"
+        cont += "\n\n.method protected " + target + "()V\n    .locals 0\n\n    " + repl + "\n\n    " + isuper + "\n\n    return-void\n.end method"
+
+    return cont
+
+
+def fixLifecycleMethod(preDir):
+    for tfile in glob.glob(preDir + "/" + "smali*/com/youkia/gamecenter/GameCenterActivity.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"
+                }
+                mas = re.search('^.super L([^;]*);?', cont, re.MULTILINE)
+
+                superclass = ""
+                if mas:
+                    superclass = 'L' + mas.group(1) + ';'
+
+                for k, v in changes.iteritems():
+                    cont = intoFirstLine(k, v, cont, superclass)
+
+                f.seek(0)
+                f.truncate(len(cont))
+                f.write(cont)
+                f.close()
+
+
+if __name__ == '__main__':
+    script_pre("/tmp/ss", "E:/apk/youhua", {"id": "323"}, "", "")
+    # hideSplash("/mnt/share/yanghuang/python_test/cr")

BIN
三国志威力无双酷派/script.pyc


BIN
三国志威力无双酷派/三国志威力无双酷派.zip


BIN
三国志战略版/DyL0aH.zip


BIN
三国志战略版/bDWD04.zip


+ 75 - 0
三国志战略版/script.py

@@ -0,0 +1,75 @@
+# 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
+
+
+def script_pre(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    # s3 = decompileDir + "/smali_classes3"
+    s1 = os.path.join(decompileDir, "smali", "com")
+    s3 = os.path.join(decompileDir, "smali_classes3", "com")
+    # distutils.dir_util.copy_tree(src, assets)
+    list = ["alibaba", "coolcloud", "huawei", "taobao", "xiaomi"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    # os.mkdir(s3)
+    for d in list:
+        src = os.path.join(s1, d)
+        if os.path.exists(src):
+            dst = os.path.join(s3, d)
+            # shutil.copy(src, dst)
+            distutils.dir_util.copy_tree(src, dst)
+            distutils.dir_util.remove_tree(src)
+
+    arm64 = os.path.join(decompileDir, "lib", "arm64-v8a")
+    if os.path.exists(arm64):
+        distutils.dir_util.remove_tree(arm64)
+    logging.info("-----debug-----")
+
+    if channelSdkInfo['id'] == "345":
+        # loading_png9 = os.path.join(SDK, "100qu/ForRes/drawable-hdpi/loading_bg.9.png")
+        loading_png9 = os.path.join(decompileDir, "res/drawable-hdpi/loading_bg.png")
+        remove_source(loading_png9)
+
+        # sdk_public = os.path.join(SDK, "100qu/ForRes/values/public.xml")
+        # modify_xml(sdk_public, "loading_bg")
+
+
+def remove_source(path_source):
+    logging.info(path_source)
+    if not os.path.exists(path_source):
+        logging.info("path_source_not_exits")
+        return
+    os.remove(path_source)
+
+
+def modify_xml(path_xml, name_xml):
+    root_node = ET.parse(path_xml)
+    root = root_node.getroot()
+
+    name = 'name'
+    providers = root.findall("./public/[@name='loading_bg']")
+    if providers is not None:
+        for provider in providers:
+            # 使用try 主要是为了 防止此属性不在时,导致的错误,而程序终止
+            try:
+                root.remove(provider)
+            except:
+                ""
+
+    root_node.write(path_xml, 'utf-8')
+
+
+if __name__ == '__main__':
+    # script_pre("", "f:\\ztest", "", "", "")
+    modify_xml("G:\\autopack2.0_kuaifa\\tool\\config\\sdk4\\public.xml", "loading_bg")

BIN
三国志战略版/script.pyc


BIN
三国志战略版/三国志战略版.zip


BIN
三国杀名将传酷派/39285EFA.dex


+ 40 - 0
三国杀名将传酷派/script.py

@@ -0,0 +1,40 @@
+# coding:utf8
+
+__author__ = 'd'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+from xml.etree.ElementTree import ElementTree, Element
+import distutils.dir_util
+import gw_file_system
+import gw_data_center
+from xml.etree import ElementTree as ET
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    sdk_id = channel_sdk_info['id']
+    if sdk_id == "512":
+        gw_data_center.pack_small = False
+        logging.info('script_init: ' + str(channel_sdk_info))
+
+
+def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info("-----debug exec first func-----")
+    game_apk = decompileDir + "/../game.apk"
+    if os.path.exists(game_apk):
+        gw_file_system.delete_apk_file_by_aapt(game_apk, "assets/39285EFA.dex")
+    logging.info("-----debug-----")
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    dex = decompileDir + "../39285EFA.dex"
+    asserts = os.path.join(decompileDir, "assets/39285EFA.dex")
+    if os.path.exists(asserts) and os.path.exists(os.path.join(dex)):
+        distutils.dir_util.copy_tree(dex, asserts)
+    logging.info("-----debug-----")

BIN
三国杀名将传酷派/script.pyc


BIN
三国杀名将传酷派/三国杀名将传酷派.zip


BIN
九州天空城/1m1K04.zip


BIN
九州天空城/39285EFA.dex


+ 18 - 0
九州天空城/script.py

@@ -0,0 +1,18 @@
+# -*- coding:utf-8 -*-
+__author__ = 'ALIXie'
+
+import os
+import logging
+import gw_data_center
+
+
+def script_init(workspace_sdk_dir, extract_dir, channelSdkInfo, new_game_channel_info, game_info):
+    gw_data_center.pack_small = False
+    return
+
+
+def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+if __name__ == "__main__":
+    ""

BIN
九州天空城/script.pyc


BIN
九州天空城/九州天空城.zip


BIN
九州天空城/龙珠觉醒360.zip


BIN
乱斗大联盟/39285EFA.dex


BIN
乱斗大联盟/bdxadsdk.jar


+ 100 - 0
乱斗大联盟/script.py

@@ -0,0 +1,100 @@
+# 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
+
+asserts_dex = "39285EFA.dex"
+assets_jar = "bdxadsdk.jar"
+
+
+def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    sdk_id = channelSdkInfo['id']
+    # if sdk_id == "584":
+    gw_data_center.pack_small = False
+    # gw_apk_tool.__apk_tool__ = 'apktool_2.3.4.jar'
+    gw_apk_tool.__apk_tool__ = 'apktool_2.4.1.jar'
+
+
+def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    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)
+    return
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['SDKName'] == 'rose':
+        replace_init_code(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 = 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):
+    file = os.path.join(decompileDir, 'assets/developer.properties')
+    if os.path.exists(file):
+        with open(file, 'r+') as f:
+            cont = f.read()
+            change_str = 'com.kfsdk.wake.SplashKFActivity'
+            str = 'com.enigma.alliance.w.UnityPlayerActivity'
+            cont = cont.replace(change_str, str)
+            logging.info('replace_str: ' + cont)
+        with open(file, 'w+') as tf:
+            tf.write(cont)
+
+
+if __name__ == '__main__':
+    replace_init_code("D:\work\lyjymb")

BIN
乱斗大联盟/script.pyc


BIN
乱斗大联盟/乱斗大联盟.zip


+ 135 - 0
仙凡幻想360/script.py

@@ -0,0 +1,135 @@
+# 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
+    sdk_id = channelSdkInfo['id']
+    # if sdk_id == "544":
+        # gw_data_center.pack_small = False
+    gw_apk_tool.__apk_tool__ = 'apktool_2.3.4.jar'
+    # gw_apk_tool.__apk_tool__ = 'apktool_2.4.1.jar'
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+    # 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"
+    s1 = os.path.join(decompileDir, "smali", "com")
+    smali_classes2_dir = create_mutil_smali(decompileDir)
+
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["yeepay", "utx", "tencent", "lilith", "lilithgame", "activeandroid", "qihoo", "android"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    logging.info("-----debug-----")
+
+
+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 script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['SDKName'] == 'reversefor360':
+        replace_application(decompileDir)
+        replace_init_code(decompileDir)
+
+
+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")

BIN
仙凡幻想360/script.pyc


BIN
仙凡幻想360/仙凡幻想360.zip


+ 98 - 0
仙剑奇侠传3D回合360/script.py

@@ -0,0 +1,98 @@
+# coding:utf8
+
+
+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_data_center
+import gw_file_system
+import gw_apk_tool
+
+from xml.etree import ElementTree as ET
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+    game_apk = decompileDir + "/../game.apk"
+    if os.path.exists(game_apk):
+        # A3AEECD8
+        gw_file_system.delete_apk_file_by_aapt(game_apk, "assets/39285EFA.dex")
+    return
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+    dex = decompileDir + "../39285EFA.dex"
+    asserts = os.path.join(decompileDir, "assets/39285EFA.dex")
+    if os.path.exists(asserts) and os.path.exists(os.path.join(dex)):
+        distutils.dir_util.copy_tree(dex, asserts)
+    return
+
+
+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 modify_manifest(decompileDir):
+    ET.register_namespace('android', ANDROID_NS)
+    xmlparse = os.path.join(decompileDir, 'AndroidManifest.xml')
+    root_node = ET.parse(xmlparse)
+    root = root_node.getroot()
+    name = '{' + ANDROID_NS + '}name'
+    authorities = '{' + ANDROID_NS + '}foregroundServiceType'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application/service')
+    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__':
+    # script("", "E:\\apk\\youhua\\LYJY360_12412_360逆向_1.23.00", "", "", "")
+    modify_manifest("G:\\autopack2.0_kuaifa\\tool\\workspace\\mhlskp\\15377\\extract\\")

BIN
仙剑奇侠传3D回合360/script.pyc


BIN
仙剑奇侠传3D回合360/仙剑奇侠传3D回合360.zip


BIN
仙剑奇侠传移动版酷派/kupai.zip


+ 60 - 0
仙剑奇侠传移动版酷派/script.py

@@ -0,0 +1,60 @@
+# coding:utf8
+
+__author__ = '极无双'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+
+lines = ['invoke-virtual {v0}, Lcom/kf/framework/KFApplication;->onCreate()V',
+         'invoke-virtual {v0}, Lcom/kf/framework/KFApplication;->onLowMemory()V',
+         'invoke-virtual {v0}, Lcom/kf/framework/KFApplication;->onTerminate()V',
+         'invoke-virtual {v0, p1}, Lcom/kf/framework/KFApplication;->onTrimMemory(I)V',
+         'invoke-virtual {v0, p1}, Lcom/kf/framework/KFApplication;->onConfigurationChanged(Landroid/content/res/Configuration;)V']
+
+
+# def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+#     if channelSdkInfo["id"] == "549":
+#         gw_data_center.pack_small = False
+#     return
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    # logging.info('------------SDK:'+SDK)
+    # logging.info('------------decompileDir:'+decompileDir)
+    # logging.info('------------channelSdkInfo:'+str(channelSdkInfo))
+    # logging.info('------------new_game_channel_info:'+str(new_game_channel_info))
+    # logging.info('------------gameInfo:'+str(gameInfo))
+    # logging.info("------rm baidu smali------")
+    # restdir = decompileDir+"/"+"smali_classes2/com/baidu/gamesdk"
+    # if os.path.exists(restdir):
+    # shutil.rmtree(restdir)
+
+    # s3 = decompileDir + "/smali_classes3"
+
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['SDKName'] == 'reverseforkupai':
+        replace_kf_application(decompileDir)
+
+
+def replace_kf_application(extract_dir):
+    goal_file = os.path.join(extract_dir, 'smali/com/kunlun/platform/android/KunlunApplication.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()
+            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("C:\\Users\\Administrator\\Desktop\\xianjian")

BIN
仙剑奇侠传移动版酷派/script.pyc


+ 18 - 0
余烬风暴酷派/script.py

@@ -0,0 +1,18 @@
+# -*- coding:utf-8 -*-
+__author__ = 'ALIXie'
+
+import os
+import logging
+import gw_data_center
+
+
+def script_init(workspace_sdk_dir, extract_dir, channelSdkInfo, new_game_channel_info, game_info):
+    gw_data_center.pack_small = False
+    return
+
+
+def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    return
+
+if __name__ == "__main__":
+    ""

BIN
余烬风暴酷派/script.pyc


BIN
余烬风暴酷派/余烬风暴酷派.zip


+ 113 - 0
傲世龙城酷派/script.py

@@ -0,0 +1,113 @@
+# 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):
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "549":
+        gw_data_center.pack_small = True
+    # gw_apk_tool.__apk_tool__ = 'apktool_2.3.4.jar'
+    # gw_apk_tool.__apk_tool__ = 'apktool_2.4.1.jar'
+
+
+def script(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 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 script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    # if channelSdkInfo['SDKName'] == 'reversefor360':
+    #     replace_application(decompileDir)
+    #     replace_init_code(decompileDir)
+    return
+
+
+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")

BIN
傲世龙城酷派/script.pyc


BIN
傲世龙城酷派/傲世龙城酷派.zip


+ 61 - 0
冰火创世纪酷派/script.py

@@ -0,0 +1,61 @@
+# 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):
+    gw_data_center.pack_small = False
+    gw_apk_tool.__apk_tool__ = 'apktool_2.6.0.jar'
+
+
+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):
+    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)
+
+
+if __name__ == '__main__':
+    ""

BIN
冰火创世纪酷派/script.pyc


BIN
冰火创世纪酷派/冰火创世纪酷派.zip


BIN
剑与家园360/T0er9C.zip


+ 132 - 0
剑与家园360/script.py

@@ -0,0 +1,132 @@
+# 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):
+    sdk_id = channelSdkInfo['id']
+    # if sdk_id == "544":
+        # gw_data_center.pack_small = False
+    gw_apk_tool.__apk_tool__ = 'apktool_2.3.4.jar'
+    # gw_apk_tool.__apk_tool__ = 'apktool_2.4.1.jar'
+
+
+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"
+    s1 = os.path.join(decompileDir, "smali", "com")
+    smali_classes2_dir = create_mutil_smali(decompileDir)
+
+    s3 = os.path.join(smali_classes2_dir, "com")
+    list_package = ["yeepay", "utx", "tencent", "lilith", "lilithgame", "activeandroid", "qihoo", "android"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    logging.info("-----debug-----")
+
+
+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 script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['SDKName'] == 'reversefor360':
+        replace_application(decompileDir)
+        replace_init_code(decompileDir)
+
+
+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")

BIN
剑与家园360/script.pyc


BIN
剑与家园360/剑与家园360.zip


+ 122 - 0
呆萌骑士酷派/script.py

@@ -0,0 +1,122 @@
+# 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
+from xml.etree import ElementTree as ET
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['id'] == "597":
+        s1 = os.path.join(decompileDir, "smali_classes3/androidx")
+        smali_classes_new = create_mutil_smali(decompileDir)
+        s3 = os.path.join(decompileDir, smali_classes_new)
+        list_package = ["annotation", "asynclayoutinflater", "coordinatorlayout", "customview", "fragment", "lifecycle",
+                        "print", "swiperefreshlayout", "versionedparcelable", "appcompat", "cardview", "core",
+                        "documentfile", "interpolator", "loader"]
+        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")
+        # smali_classes_new = create_mutil_smali(decompileDir)
+        # s3 = os.path.join(decompileDir, smali_classes_new)
+        # list_package = ["friendtime", "friendtimes", "ft", "GF"]
+        # if not os.path.exists(s3):
+        #     distutils.dir_util.mkpath(s3)
+        # move_package(s1, s3, list_package)
+
+    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):
+            f_idx += 1
+        else:
+            smali_classes2_dir = tmp
+            break
+    # endwhile
+    os.mkdir(smali_classes2_dir)
+    return smali_classes2_dir
+
+
+def modify_manifest(decompileDir):
+    ET.register_namespace('android', ANDROID_NS)
+    xmlparse = os.path.join(decompileDir, 'AndroidManifest.xml')
+    root_node = ET.parse(xmlparse)
+    root = root_node.getroot()
+    name = '{' + ANDROID_NS + '}name'
+    authorities = '{' + ANDROID_NS + '}foregroundServiceType'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application/service')
+    if providers != None:
+        for provider in providers:
+            providerName = provider.attrib.get(name)
+            if 'com.netease.cc.screen_record.codec.screencapture.ScreenCaptureService' == providerName:
+                # 使用try 主要是为了 防止此属性不在时,导致的错误,而程序终止
+                try:
+                    del provider.attrib[authorities]
+                except:
+                    ""
+
+    root_node.write(xmlparse, 'utf-8')
+
+
+def modify_manifest_common(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\\bh")

BIN
呆萌骑士酷派/script.pyc


BIN
呆萌骑士酷派/呆萌骑士酷派.zip


BIN
哥哥捕鱼/1SaDmL.zip


+ 93 - 0
哥哥捕鱼/1SaDmL/script.py

@@ -0,0 +1,93 @@
+# coding:utf8
+
+__author__ = '哥哥捕鱼酷派'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+
+
+def add_super_invoke(decompileDir):
+    goal_file = os.path.join(decompileDir,'smali_classes2/com/bohaoo/dlby/coolpad/MyApplication.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 = '.method public onCreate()V'
+            str = '.method public onCreate()V\n' \
+                  'invoke-super {p0}, Lcom/kf/framework/KFApplication;->onCreate()V'
+            cont = cont.replace(change_str,str)
+
+            logging.info('replace_str: '+cont)
+        with open(goal_file,'w+') as tf:
+            tf.write(cont)
+
+
+def replace_permission_tips(decompileDir):
+    goal_file = os.path.join(decompileDir,'smali_classes2/com/bohaoo/dlby/coolpad/AppActivity.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()
+            print(cont)
+            change_str = "\u672a\u80fd\u83b7\u53d6\u5230\u5bf9\u5e94\u6743\u9650"
+            str = ""
+            cont = cont.replace(change_str,str)
+
+        with open(goal_file,'w+') as tf:
+            tf.write(cont)
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    # logging.info('------------SDK:'+SDK)
+    # logging.info('------------decompileDir:'+decompileDir)
+    # logging.info('------------channelSdkInfo:'+str(channelSdkInfo))
+    # logging.info('------------new_game_channel_info:'+str(new_game_channel_info))
+    # logging.info('------------gameInfo:'+str(gameInfo))
+    # logging.info("------rm baidu smali------")
+    # restdir = decompileDir+"/"+"smali_classes2/com/baidu/gamesdk"
+    # if os.path.exists(restdir):
+    # shutil.rmtree(restdir)
+
+    # s3 = decompileDir + "/smali_classes3"
+
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['id'] == '549':
+        add_super_invoke(decompileDir)
+        replace_life_method(decompileDir)
+        replace_permission_tips(decompileDir)
+
+
+
+def replace_life_method(extract_dir):
+    goal_file = os.path.join(extract_dir,'smali_classes2/org/cocos2dx/javascript/AppActivity.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 = '.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)
+
+
+if __name__ == '__main__':
+    replace_permission_tips("C:\\Users\\Administrator\\Desktop\\gege")
+

BIN
哥哥捕鱼/1SaDmL/script.pyc


+ 26 - 0
哥哥捕鱼/script.py

@@ -0,0 +1,26 @@
+# coding:utf8
+
+__author__ = 'shikuangzuqiukupai'
+
+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
+
+from xml.etree import ElementTree as ET
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    sdk_id = channelSdkInfo['id']
+    gw_apk_tool.__apk_tool__ = 'apktool_2.4.1.jar'
+    gw_data_center.pack_small = False
+    return

BIN
哥哥捕鱼/script.pyc


BIN
哥哥捕鱼/哥哥捕鱼.zip


BIN
哥哥捕鱼酷派/1SaDmL.zip


+ 84 - 0
哥哥捕鱼酷派/script.py

@@ -0,0 +1,84 @@
+# coding:utf8
+
+__author__ = '哥哥捕鱼酷派'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+import gw_data_center
+
+
+def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    gw_data_center.pack_small = False
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['id'] == '549':
+        add_super_invoke(decompileDir)
+        replace_life_method(decompileDir)
+        replace_permission_tips(decompileDir)
+
+
+def add_super_invoke(decompileDir):
+    goal_file = os.path.join(decompileDir, 'smali_classes2/com/bohaoo/dlby/coolpad/MyApplication.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 = '.method public onCreate()V'
+            str = '.method public onCreate()V\n' \
+                  'invoke-super {p0}, Lcom/kf/framework/KFApplication;->onCreate()V'
+            cont = cont.replace(change_str, str)
+
+            logging.info('replace_str: ' + cont)
+        with open(goal_file, 'w+') as tf:
+            tf.write(cont)
+
+
+def replace_permission_tips(decompileDir):
+    goal_file = os.path.join(decompileDir, 'smali_classes2/com/bohaoo/dlby/coolpad/AppActivity.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()
+            print(cont)
+            change_str = "\u672a\u80fd\u83b7\u53d6\u5230\u5bf9\u5e94\u6743\u9650"
+            str = ""
+            cont = cont.replace(change_str, str)
+
+        with open(goal_file, 'w+') as tf:
+            tf.write(cont)
+
+
+def replace_life_method(extract_dir):
+    goal_file = os.path.join(extract_dir, 'smali_classes2/org/cocos2dx/javascript/AppActivity.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 = '.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)
+
+
+if __name__ == '__main__':
+    replace_permission_tips("C:\\Users\\Administrator\\Desktop\\gege")

BIN
哥哥捕鱼酷派/script.pyc


BIN
哥哥捕鱼酷派/哥哥捕鱼酷派.zip


BIN
圣斗士星矢重生360/39285EFA.dex


BIN
圣斗士星矢重生360/FFFFFF-0.png


+ 254 - 0
圣斗士星矢重生360/script.py

@@ -0,0 +1,254 @@
+# coding:utf8
+import os
+import logging
+import re
+import glob
+import shutil
+
+import gw_data_center
+import gw_file_system
+import gw_apk_tool
+
+import yaml
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    gw_data_center.pack_small = False
+    return
+
+    # sdk_id = channel_sdk_info['id']
+    # if sdk_id == "323":
+    #     gw_data_center.pack_small = False
+    #     logging.info('script_init: ' + str(channel_sdk_info))
+
+
+def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info("-----debug exec first func-----")
+    # game_apk = os.path.join(decompileDir, "game.apk")
+    game_apk = decompileDir + "/../game.apk"
+    if os.path.exists(game_apk):
+        gw_file_system.delete_apk_file_by_aapt(game_apk, "assets/39285EFA.dex")
+    logging.info("-----debug-----")
+
+
+def script(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    logging.info('game_pack_info: ' + str(channel_sdk_info))
+    # 逆向渠道id
+    if channel_sdk_info['id'] == "323" or channel_sdk_info['id'] == "542":
+        fixLifecycleMethod(extract_dir)
+        hideSplash(extract_dir)
+    decompileDir = extract_dir
+    assets_dex = os.path.join(decompileDir, "../39285EFA.dex")
+    assets_dir = os.path.join(decompileDir, "assets/39285EFA.dex")
+    logging.info(assets_dex)
+    logging.info(assets_dir)
+    if os.path.exists(assets_dex):
+        gw_file_system.copy_file(assets_dex, assets_dir)
+
+    # gw_apk_tool.yml_remove_uncompress(extract_dir)
+    del_do_not_compress(extract_dir)
+    return
+
+
+def script_last(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    if channel_sdk_info['id'] == "542":
+        fix_float(extract_dir)
+    return
+
+
+def script_pre(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'] == "542":
+        remove_smali(extract_dir)
+        add_pay_field(extract_dir)
+
+    return
+
+
+def hideSplash(preDir):
+    tfile = preDir + "/assets/bin/Data/splash.png"
+    picDir = os.path.dirname(tfile)
+    if not os.path.exists(picDir):
+        os.makedirs(picDir)
+        shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + '/FFFFFF-0.png', tfile)
+    else:
+        if os.path.isfile(tfile):
+            shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + '/FFFFFF-0.png', tfile)
+        else:
+            logging.info('game_pack_info: ' + tfile + 'is not exists!')
+
+    tfile = preDir + "/res/values/styles.xml"
+    if os.path.isfile(tfile):
+        with open(tfile, 'r+') as f:
+            cont = f.read()
+            cont = cont.replace('<item name="android:windowBackground">@drawable/youkia_splash</item>'
+                                , '<item name="android:windowBackground">@color/transparent</item>')
+            f.truncate(len(cont))
+            f.seek(0)
+            f.write(cont)
+            f.close()
+    else:
+        logging.info('game_pack_info: ' + tfile + 'is not exists!')
+    return
+
+
+def intoFirstLine(target, repl, cont, superclass):
+    # 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:
+        # do call .super method
+        isuper = "invoke-super {p0}, " + superclass + "->" + target + "()V"
+        cont += "\n\n.method protected " + target + "()V\n    .locals 0\n\n    " + repl + "\n\n    " + isuper + "\n\n    return-void\n.end method"
+
+    return cont
+
+
+def fixLifecycleMethod(preDir):
+    for tfile in glob.glob(preDir + "/" + "smali*/com/youkia/gamecenter/GameCenterActivity.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"
+                }
+                mas = re.search('^.super L([^;]*);?', cont, re.MULTILINE)
+
+                superclass = ""
+                if mas:
+                    superclass = 'L' + mas.group(1) + ';'
+
+                for k, v in changes.iteritems():
+                    cont = intoFirstLine(k, v, cont, superclass)
+
+                f.seek(0)
+                f.truncate(len(cont))
+                f.write(cont)
+                f.close()
+
+
+def add_pay_field(fooDir):
+    for tfile in glob.glob(fooDir + "/" + "smali*/com/youkia/gamecenter/BaseMainActivity.smali"):
+        print tfile
+        if os.path.isfile(tfile):
+            with open(tfile, 'r+') as f:
+                cont = f.read()
+                rrr = re.compile(r'const-string v13, \"app_order_id\"')
+                endStr = rrr.findall(cont)
+                if len(endStr) > 1:
+                    if endStr[0] == None:
+                        return
+                    logging.info('替换字符串为:' + endStr[0])
+                inserts = '''
+    const-string v13, "app_ext_2"\n
+
+	invoke-static {}, Lcom/kf/framework/java/KFSDKUser;->getInstance()Lcom/kf/framework/java/KFSDKUser;\n
+
+    move-result-object v14\n
+
+    invoke-virtual {v14}, Lcom/kf/framework/java/KFSDKUser;->getOpenId()Ljava/lang/String;\n
+
+    move-result-object v14\n
+
+	invoke-virtual {v3, v13, v14}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V\n
+
+	const-string v13, "app_order_id"'''
+
+                if len(endStr) > 1:
+                    cont = cont.replace(endStr[0], inserts)
+                    f.seek(0)
+                    f.write(cont)
+
+
+def remove_smali(path):
+    for tfile in glob.glob(path + "/" + "smali*/com/youkia/gamecenter/BaseMainActivity.smali"):
+        print tfile
+        logging.info('删除路径:' + tfile)
+        if os.path.isfile(tfile):
+            with open(tfile, 'r+') as f:
+                lines = f.readlines()
+                start = 0
+                end = 0
+                line_num = 0
+                for i in lines:
+                    print len(i.strip(" "))
+                    print len('const-string v13, "access_token"')
+                    if i.replace('\n', '').strip(" ") == 'const-string v13, "access_token"':
+                        start = lines.index(i)
+                        print start
+                    if start > 0 and i.replace('\n', '').strip(" ") == 'const-string v13, "amount"':
+                        end = line_num
+                        end -= 1
+                        print end
+                        break
+                    line_num += 1
+                for i, v in enumerate(lines):
+                    if i >= start and i < end:
+                        lines[i] = ''
+                    if i > end:
+                        break
+
+            with open(tfile, 'w') as tf:
+                tf.write(''.join(lines))
+
+
+def fix_float(lastDir):
+    for tfile in glob.glob(lastDir + "/" + "smali*/com/qihoo/sdkplugging/host/ApkPluggingManager.smali"):
+        print tfile
+        if os.path.isfile(tfile):
+            with open(tfile, 'r+') as f:
+                cont = f.read()
+                goalStr = 'invoke-virtual {v1, p1, p2, p3, p4}, Lcom/qihoo/sdkplugging/host/pluggingitem/ApkPluggingItem;->doPluggingCommandInItem(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Object;)Ljava/lang/Object;'
+                print type(goalStr)
+                changes = '''
+    const v2, 0xc350\n
+
+    invoke-virtual {p3}, Ljava/lang/Integer;->intValue()I\n
+
+    move-result v3\n
+
+    if-eq v2, v3, :cond_f\n
+
+    invoke-virtual {v1, p1, p2, p3, p4}, Lcom/qihoo/sdkplugging/host/pluggingitem/ApkPluggingItem;->doPluggingCommandInItem(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Object;)Ljava/lang/Object;'''
+                cont = cont.replace(goalStr, changes)
+                f.seek(0)
+                f.write(cont)
+
+
+def del_do_not_compress(dir_path):
+    yml_file = os.path.join(dir_path, 'apktool.yml')
+    if not os.path.exists(yml_file):
+        logging.info(yml_file + 'is not exist')
+        return
+    with open(yml_file, 'r') as f:
+        d = yaml.load(f)
+        print d
+        del d['doNotCompress']
+        print d
+    with open(yml_file, 'w') as fl:
+        fl.write(yaml.dump(d))
+
+
+if __name__ == '__main__':
+    # remove_smali('D:\\xqnnn')
+    # add_pay_field('D:\\xqnnn')
+    # fix_float("D:\\test")
+    # script("/tmp/ss", "/mnt/share/yanghuang/python_test/any_dir", { "id": "323" }, "", "")
+    # hideSplash("/mnt/share/yanghuang/python_test/cr")
+    del_do_not_compress('e:\\apk\\youhua')

BIN
圣斗士星矢重生360/script.pyc


BIN
圣斗士星矢重生360/圣斗士星矢重生360.zip


BIN
坦克前线360/39285EFA.dex


+ 100 - 0
坦克前线360/script.py

@@ -0,0 +1,100 @@
+# coding:utf8
+
+
+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_data_center
+import gw_file_system
+import gw_apk_tool
+
+from xml.etree import ElementTree as ET
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    gw_data_center.pack_small = False
+    gw_apk_tool.__apk_tool__ = 'apktool_2.6.0.jar'
+    return
+
+
+def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+    game_apk = decompileDir + "/../game.apk"
+    if os.path.exists(game_apk):
+        # A3AEECD8
+        gw_file_system.delete_apk_file_by_aapt(game_apk, "assets/39285EFA.dex")
+    return
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+    dex = decompileDir + "../39285EFA.dex"
+    asserts = os.path.join(decompileDir, "assets/39285EFA.dex")
+    if os.path.exists(asserts) and os.path.exists(os.path.join(dex)):
+        distutils.dir_util.copy_tree(dex, asserts)
+    return
+
+
+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 modify_manifest(decompileDir):
+    ET.register_namespace('android', ANDROID_NS)
+    xmlparse = os.path.join(decompileDir, 'AndroidManifest.xml')
+    root_node = ET.parse(xmlparse)
+    root = root_node.getroot()
+    name = '{' + ANDROID_NS + '}name'
+    authorities = '{' + ANDROID_NS + '}foregroundServiceType'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application/service')
+    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__':
+    # script("", "E:\\apk\\youhua\\LYJY360_12412_360逆向_1.23.00", "", "", "")
+    modify_manifest("G:\\autopack2.0_kuaifa\\tool\\workspace\\mhlskp\\15377\\extract\\")

BIN
坦克前线360/script.pyc


BIN
坦克前线360/坦克前线360.zip


+ 114 - 0
大唐无双/script.py

@@ -0,0 +1,114 @@
+# -*- 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):
+    logging.info('method_proceed: ' + 'script_pre')
+
+
+def script(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    logging.info('method_proceed: ' + 'script')
+    logging.info('channel_sdk_info: ' + str(channel_sdk_info))
+    # 遥望
+    if channel_sdk_info['id'] == "412":
+        add_hjr_checkSelfPermission(extract_dir)
+
+    if channel_sdk_info['id'] == "521" or channel_sdk_info['id'] == "535" or channel_sdk_info['id'] == "558":
+        add_checkSelfPermission(extract_dir)
+
+
+def script_last(workspace_sdk_dir, decompileDir, channel_sdk_info, new_game_channel_info, game_info):
+    if channel_sdk_info['id'] == "549":
+        s1 = os.path.join(decompileDir, "smali_classes3/com")
+        smali_classes_new = create_mutil_smali(decompileDir)
+        s3 = os.path.join(decompileDir, smali_classes_new)
+        list_package = ["netease"]
+        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")

BIN
大唐无双/script.pyc


BIN
大唐无双/大唐无双.zip


+ 139 - 0
大唐无双其它CP/script.py

@@ -0,0 +1,139 @@
+# coding:utf8
+
+__author__ = 'Snow'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+import distutils.dir_util
+import gw_file_system
+from xml.etree import ElementTree as ET
+import gw_data_center
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    gw_data_center.pack_small = False
+    return
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "512":
+        modify_manifest(decompileDir)
+        modify_manifest_requestLegacyExternalStorage(decompileDir)
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    # smali_classes4
+    s1 = os.path.join(decompileDir, "smali")
+    if not os.path.exists(s1):
+        return
+    smali_classes2_dir = create_mutil_smali(decompileDir)
+
+    s3 = smali_classes2_dir
+    list_package = ["androidx"]
+    if not os.path.exists(s3):
+        distutils.dir_util.mkpath(s3)
+    move_package(s1, s3, list_package)
+
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "549":
+        s1 = os.path.join(decompileDir, "smali_classes4", "com")
+        if not os.path.exists(s1):
+            return
+        smali_classes2_dir = create_mutil_smali(decompileDir)
+
+        s3 = smali_classes2_dir
+        list_package = ["meizu", "netease"]
+        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 modify_manifest(decompileDir):
+    ET.register_namespace('android', ANDROID_NS)
+    xmlparse = os.path.join(decompileDir, 'AndroidManifest.xml')
+    root_node = ET.parse(xmlparse)
+    root = root_node.getroot()
+    name = '{' + ANDROID_NS + '}name'
+    authorities = '{' + ANDROID_NS + '}foregroundServiceType'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application/service')
+    if providers != None:
+        for provider in providers:
+            providerName = provider.attrib.get(name)
+            if 'com.netease.cc.screen_record.codec.screencapture.ScreenCaptureService' == providerName:
+                # 使用try 主要是为了 防止此属性不在时,导致的错误,而程序终止
+                try:
+                    del provider.attrib[authorities]
+                except:
+                    ""
+
+    root_node.write(xmlparse, 'utf-8')
+
+
+def modify_manifest_requestLegacyExternalStorage(decompileDir):
+    ET.register_namespace('android', ANDROID_NS)
+    xmlparse = os.path.join(decompileDir, 'AndroidManifest.xml')
+    root_node = ET.parse(xmlparse)
+    root = root_node.getroot()
+    name = '{' + ANDROID_NS + '}name'
+    authorities = '{' + ANDROID_NS + '}requestLegacyExternalStorage'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application')
+    if providers != None:
+        for provider in providers:
+            # 使用try 主要是为了 防止此属性不在时,导致的错误,而程序终止
+            try:
+                del provider.attrib[authorities]
+            except:
+                ""
+
+    root_node.write(xmlparse, 'utf-8')
+
+
+if __name__ == '__main__':
+    ""

BIN
大唐无双其它CP/script.pyc


BIN
大唐无双其它CP/大唐无双其它CP.zip


BIN
天下360/39285EFA.dex


+ 147 - 0
天下360/script.py

@@ -0,0 +1,147 @@
+# 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
+from xml.etree import ElementTree as ET
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    sdk_id = channel_sdk_info['id']
+    if sdk_id == "549":
+        gw_data_center.pack_small = False
+        logging.info('script_init: ' + str(channel_sdk_info))
+
+
+def script_first(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)
+
+    logging.info("-----debug exec first func-----")
+    # game_apk = os.path.join(decompileDir, "game.apk")
+    game_apk = decompileDir + "/../game.apk"
+    if os.path.exists(game_apk):
+        # A3AEECD8
+        gw_file_system.delete_apk_file_by_aapt(game_apk, "assets/39285EFA.dex")
+    logging.info("-----debug-----")
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    # s3 = decompileDir + "/smali_classes3"
+    # A3AEECD8.dex
+    dex = decompileDir + "../39285EFA.dex"
+    asserts = os.path.join(decompileDir, "assets/39285EFA.dex")
+    if os.path.exists(asserts) and os.path.exists(os.path.join(dex)):
+        distutils.dir_util.copy_tree(dex, asserts)
+    logging.info("-----debug-----")
+    # 分包
+    split_package(decompileDir)
+
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "323":
+        modify_manifest(decompileDir)
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    if channelSdkInfo['SDKName'] == 'reversefor360':
+        replace_super_application(decompileDir)
+
+
+def split_package(decompileDir):
+    s1 = os.path.join(decompileDir, "smali", "com")
+    smali_classes2_dir = ''
+    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)
+
+    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)
+
+
+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)
+
+
+change_map = {".super Landroid/support/multidex/MultiDexApplication;": ".super Lcom/kf/framework/KFApplication;",
+              "invoke-direct {p0}, Landroid/support/multidex/MultiDexApplication;-><init>()V": "invoke-direct {p0}, Lcom/kf/framework/KFApplication;-><init>()V",
+              "invoke-super {p0, p1}, Landroid/support/multidex/MultiDexApplication;->attachBaseContext(Landroid/content/Context;)V": "invoke-super {p0, p1}, Lcom/kf/framework/KFApplication;->attachBaseContext(Landroid/content/Context;)V",
+              "invoke-super {p0}, Landroid/support/multidex/MultiDexApplication;->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/netease/ntunisdk/application/NtSdkApplication.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):
+    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 + '}foregroundServiceType'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application/service')
+    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\\tx360")

BIN
天下360/script.pyc


BIN
天下360/天下360.zip


+ 111 - 0
天下酷派/script.py

@@ -0,0 +1,111 @@
+# coding:utf8
+import os
+import logging
+import re
+import glob
+import shutil
+import xml.etree.ElementTree as ET
+import gw_data_center
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
+    gw_data_center.pack_small = False
+    logging.info('script_init: ' + str(channel_sdk_info))
+
+
+def script_pre(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):
+    sdk_id = channel_sdk_info['id']
+    if sdk_id == "512":
+        modify_manifest(extract_dir)
+
+
+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*/org/bojoy/publish/PublishActivity.smali"):
+        if os.path.isfile(tfile):
+            with open(tfile, 'r+') as f:
+                cont = f.read()
+                changes = {
+                    "onCreate": "invoke-static {p0}, Lcom/baidu/gamesdk/BDGameSDK;->setContext(Landroid/app/Activity;)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("qihoo_game_sdk_authenticator") > -1:
+                continue
+            new_lines.append(line)
+        f.seek(0)
+        f.truncate()
+        f.writelines(new_lines)
+    return
+
+
+def modify_manifest(decompileDir):
+    ET.register_namespace('android', ANDROID_NS)
+    xmlparse = os.path.join(decompileDir, 'AndroidManifest.xml')
+    root_node = ET.parse(xmlparse)
+    root = root_node.getroot()
+    name = '{' + ANDROID_NS + '}name'
+    authorities = '{' + ANDROID_NS + '}foregroundServiceType'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application/service')
+    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__':
+    # script("/tmp/ss", "/mnt/share/yanghuang/python_test/any_dir", {"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")

BIN
天下酷派/script.pyc


BIN
天下酷派/天下酷派.zip


+ 134 - 0
天谕手游其它cp/script.py

@@ -0,0 +1,134 @@
+# coding:utf8
+
+__author__ = 'Snow'
+
+import os
+import logging
+import xml.dom.minidom
+import re
+import shutil
+import glob
+import distutils.dir_util
+import gw_file_system
+from xml.etree import ElementTree as ET
+import gw_data_center
+
+ANDROID_NS = 'http://schemas.android.com/apk/res/android'
+
+
+def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    gw_data_center.pack_small = False
+    return
+
+
+def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    return
+    sdk_id = channelSdkInfo['id']
+    if sdk_id == "512":
+        modify_manifest(decompileDir)
+        modify_manifest_requestLegacyExternalStorage(decompileDir)
+
+
+def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
+    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
+    # smali_classes4
+    s1 = os.path.join(decompileDir, "smali_classes2")
+    if not os.path.exists(s1):
+        return
+    smali_classes2_dir = create_mutil_smali(decompileDir)
+    s3 = 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_classes7", "com")
+    if not os.path.exists(s1):
+        return
+    smali_classes2_dir = create_mutil_smali(decompileDir)
+    s3 = smali_classes2_dir
+    list_package = ["hjr", "huya", "huyaudbunify", "ipaynow", "netease"]
+    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 modify_manifest(decompileDir):
+    ET.register_namespace('android', ANDROID_NS)
+    xmlparse = os.path.join(decompileDir, 'AndroidManifest.xml')
+    root_node = ET.parse(xmlparse)
+    root = root_node.getroot()
+    name = '{' + ANDROID_NS + '}name'
+    authorities = '{' + ANDROID_NS + '}foregroundServiceType'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application/service')
+    if providers != None:
+        for provider in providers:
+            providerName = provider.attrib.get(name)
+            if 'com.netease.cc.screen_record.codec.screencapture.ScreenCaptureService' == providerName:
+                # 使用try 主要是为了 防止此属性不在时,导致的错误,而程序终止
+                try:
+                    del provider.attrib[authorities]
+                except:
+                    ""
+
+    root_node.write(xmlparse, 'utf-8')
+
+
+def modify_manifest_requestLegacyExternalStorage(decompileDir):
+    ET.register_namespace('android', ANDROID_NS)
+    xmlparse = os.path.join(decompileDir, 'AndroidManifest.xml')
+    root_node = ET.parse(xmlparse)
+    root = root_node.getroot()
+    name = '{' + ANDROID_NS + '}name'
+    authorities = '{' + ANDROID_NS + '}requestLegacyExternalStorage'
+    package_name = root.attrib.get('package')
+    if package_name == None:
+        return
+    providers = root.findall('./application')
+    if providers != None:
+        for provider in providers:
+            # 使用try 主要是为了 防止此属性不在时,导致的错误,而程序终止
+            try:
+                del provider.attrib[authorities]
+            except:
+                ""
+
+    root_node.write(xmlparse, 'utf-8')
+
+
+if __name__ == '__main__':
+    ""

BIN
天谕手游其它cp/script.pyc


BIN
天谕手游其它cp/天谕手游其它cp.zip


+ 0 - 0
天龙八部3D麟游/XX5mnD.zip


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor