| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- # coding:utf8
- __author__ = 'dong'
- import os
- import logging
- import xml.dom.minidom
- import re
- import shutil
- import glob
- import distutils.dir_util
- import os
- import gw_apk_tool
- def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
- logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
- if channelSdkInfo['id'] == '597':
- logging.info("remove_navigate")
- remove_navigate(decompileDir)
- # if channelSdkInfo['id'] == '549':
- # del_qihoo(decompileDir)
- # gw_apk_tool.yml_remove_uncompress(decompileDir)
- def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
- if channelSdkInfo['id'] == '549' or channelSdkInfo['id'] == '591':
- s1 = os.path.join(decompileDir, "smali_classes4","com")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"com")
- list_package = ["onevcat","RenderHeads","seasun","tencent","twobigears","unionpay","unity3d","vmadalin","xsj","yulong"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes4","com")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"com")
- list_package = ["google","nd"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- if channelSdkInfo['id'] == '597':
- s1 = os.path.join(decompileDir, "smali_classes2","androidx")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["security","tracing","work","appcompat","cardview","coordinatorlayout","drawerlayout","navigation","sqlite","transition","arch","collection","core","emoji2","room","startup","viewpager2"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes3","androidx")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["security","tracing","work","appcompat","cardview","coordinatorlayout","drawerlayout","navigation","sqlite","transition","arch","collection","core","emoji2","room","startup","viewpager2"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes4","androidx")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["security","tracing","work","appcompat","cardview","coordinatorlayout","drawerlayout","navigation","sqlite","transition","arch","collection","core","emoji2","room","startup","viewpager2"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes2","androidx")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["inspection","loader","print","swiperefreshlayout","webkit","asynclayoutinflater","cursoradapter","interpolator","localbroadc","astmanager","recyclerview","vectordrawable","browser","customview","legacy","media","savedstate","versionedparcelable"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes3","androidx")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["inspection","loader","print","swiperefreshlayout","webkit","asynclayoutinflater","cursoradapter","interpolator","localbroadc","astmanager","recyclerview","vectordrawable","browser","customview","legacy","media","savedstate","versionedparcelable"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes4","androidx")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["inspection","loader","print","swiperefreshlayout","webkit","asynclayoutinflater","cursoradapter","interpolator","localbroadc","astmanager","recyclerview","vectordrawable","browser","customview","legacy","media","savedstate","versionedparcelable"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes4")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new)
- list_package = ["androidx"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali","androidx")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["activity","collection","documentfile","legacy","print","startup","viewpager2"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["annotation","concurrent","drawerlayout","lifecycle","recyclerview","swiperefreshlayout","webkit"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["appcompat","constraintlayout","dynamicanimation","loader","resourceinspection","tracing","work"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["appcompat","constraintlayout","dynamicanimation","loader","resourceinspection","tracing","work"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["arch","coordinatorlayout","emoji2","localbroadcastmanager","room","transition"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["asynclayoutinflater","core","fragment","media","savedstate","vectordrawable"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["browser","cursoradapter","inspection","multidex","slidingpanelayout","versionedparcelable"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["cardview","customview","interpolator","navigation","sqlite","viewpager"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes2","com")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"com")
- list_package = ["lh"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes2","com")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"com")
- list_package = ["lh"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes2","com")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"com")
- list_package = ["nd","tencent"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes2","com")
- if os.path.exists(s1):
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"com")
- list_package = ["kingsoft"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- sdk_id = channelSdkInfo['id']
- if sdk_id == "597":
- move(decompileDir)
- else:
- move_smallsheep(decompileDir)
- def remove_navigate(decompileDir):
- tmp_res = os.path.join(decompileDir, "res", "navigation")
- tmp_public_xml = os.path.join(decompileDir, "res", "values", "public.xml")
- if os.path.exists(tmp_res):
- distutils.dir_util.remove_tree(tmp_res)
- if os.path.exists(tmp_public_xml):
- os.remove(tmp_public_xml)
- def move_smallsheep(decompileDir):
- s1 = os.path.join(decompileDir, "smali_classes12/com")
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new)
- list_package = ["onevcat","RenderHeads","tencent"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes4/com")
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new)
- list_package = ["jssy"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- def move(decompileDir):
- s1 = os.path.join(decompileDir, "smali_classes3")
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new)
- list_package = ["androidx"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes3/com")
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"com")
- list_package = ["google","nd","onevcat","RenderHeads","tencent"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes4/com")
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"com")
- list_package = ["google"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes4/com")
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"com")
- list_package = ["iflytek"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes5/androidx")
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["navigation","room","sqlite","startup","tracing","transition","viewpager2","work"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- s1 = os.path.join(decompileDir, "smali_classes6/androidx")
- smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
- s3 = os.path.join(decompileDir, smali_classes_new,"androidx")
- list_package = ["media","print","recyclerview","savedstate","swiperefreshlayout","vectordrawable","versionedparcelable","webkit"]
- if not os.path.exists(s3):
- distutils.dir_util.mkpath(s3)
- gw_apk_tool.move_package(s1, s3, list_package)
- if __name__ == '__main__':
- # del_qihoo("C:\\Users\\Administrator\\Desktop\\zt")
- remove_navigate("G:\\autopack2.0_kuaifa\\tool\\workspace\\lrs360\\13651\\extract")
|