script.py 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. # coding:utf8
  2. __author__ = 'dong'
  3. import os
  4. import logging
  5. import xml.dom.minidom
  6. import re
  7. import shutil
  8. import glob
  9. import distutils.dir_util
  10. import os
  11. import gw_apk_tool
  12. import gw_data_center
  13. def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  14. # if channelSdkInfo['id'] == '597':
  15. # gw_data_center.pack_small = True
  16. return
  17. def script_second(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  18. xml=os.path.join(decompileDir,"res/values/drawables.xml")
  19. handle_public_xml(xml,"APKTOOL")
  20. xml=os.path.join(decompileDir,"res/values/public.xml")
  21. handle_public_xml(xml,"APKTOOL")
  22. def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  23. logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
  24. if channelSdkInfo['id'] == '597':
  25. logging.info("remove_navigate")
  26. remove_navigate(decompileDir)
  27. def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  28. logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
  29. if channelSdkInfo['id'] == '597':
  30. move_11_bytedance(decompileDir)
  31. move(decompileDir)
  32. move_10_bytedance(decompileDir)
  33. move_4_bytedance(decompileDir)
  34. move_2(decompileDir)
  35. move_5_bytedance(decompileDir)
  36. move_6_bytedance(decompileDir)
  37. move_60_ss(decompileDir)
  38. move_64_bytedance(decompileDir)
  39. move_7_bytedance(decompileDir)
  40. move_8_bytedance(decompileDir)
  41. move_9_bytedance(decompileDir)
  42. move_37_bytedance(decompileDir)
  43. move_49_bytedance(decompileDir)
  44. move_103_bytedance(decompileDir)
  45. move_125_bytedance(decompileDir)
  46. move_158_bytedance(decompileDir)
  47. else:
  48. move_224_bytedance(decompileDir)
  49. def move(decompileDir):
  50. s1 = os.path.join(decompileDir, "smali_classes10/com")
  51. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  52. s3 = os.path.join(decompileDir, smali_classes_new, "com")
  53. list_package = ["facebook"]
  54. if not os.path.exists(s3):
  55. distutils.dir_util.mkpath(s3)
  56. gw_apk_tool.move_package(s1, s3, list_package)
  57. s1 = os.path.join(decompileDir, "smali_classes11/com")
  58. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  59. s3 = os.path.join(decompileDir, smali_classes_new, "com")
  60. list_package = ["facebook", "feiyu", "google", "hermes"]
  61. if not os.path.exists(s3):
  62. distutils.dir_util.mkpath(s3)
  63. gw_apk_tool.move_package(s1, s3, list_package)
  64. s1 = os.path.join(decompileDir, "smali_classes11/com")
  65. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  66. s3 = os.path.join(decompileDir, smali_classes_new, "com")
  67. list_package = ["sedna", "service", "sina"]
  68. if not os.path.exists(s3):
  69. distutils.dir_util.mkpath(s3)
  70. gw_apk_tool.move_package(s1, s3, list_package)
  71. s1 = os.path.join(decompileDir, "smali_classes11/com")
  72. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  73. s3 = os.path.join(decompileDir, smali_classes_new, "com")
  74. list_package = ["heytap", "huawei", "hw", "ixigua", "just", "loc", "luck"]
  75. if not os.path.exists(s3):
  76. distutils.dir_util.mkpath(s3)
  77. gw_apk_tool.move_package(s1, s3, list_package)
  78. s1 = os.path.join(decompileDir, "smali_classes11/com")
  79. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  80. s3 = os.path.join(decompileDir, smali_classes_new, "com")
  81. list_package = ["squareup", "ss", "swmansion"]
  82. if not os.path.exists(s3):
  83. distutils.dir_util.mkpath(s3)
  84. gw_apk_tool.move_package(s1, s3, list_package)
  85. s1 = os.path.join(decompileDir, "smali_classes12/androidx")
  86. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  87. s3 = os.path.join(decompileDir, smali_classes_new, "androidx")
  88. list_package = ["activity", "annotation", "appcompat", "arch", "asynclayoutinflater", "cardview", "collection",
  89. "concurrent", "constraintlayout", "coordinatorlayout"]
  90. if not os.path.exists(s3):
  91. distutils.dir_util.mkpath(s3)
  92. gw_apk_tool.move_package(s1, s3, list_package)
  93. s1 = os.path.join(decompileDir, "smali_classes12/androidx")
  94. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  95. s3 = os.path.join(decompileDir, smali_classes_new, "androidx")
  96. list_package = ["print", "room", "sqlite", "tracing", "versionedparcelable", "viewpager2", "recyclerview",
  97. "savedstate", "startup", "transition", "viewbinding", "window", "resourceinspection",
  98. "slidingpanelayout", "swiperefreshlayout", "vectordrawable", "viewpager"]
  99. if not os.path.exists(s3):
  100. distutils.dir_util.mkpath(s3)
  101. gw_apk_tool.move_package(s1, s3, list_package)
  102. s1 = os.path.join(decompileDir, "smali_classes12/androidx")
  103. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  104. s3 = os.path.join(decompileDir, smali_classes_new, "androidx")
  105. list_package = ["core", "customview", "drawerlayout", "emoji2", "fragment", "legacy", "loader", "media",
  106. "navigation", "cursoradapter", "documentfile", "dynamicanimation", "exifinterface", "interpolator",
  107. "lifecycle", "localbroadcastmanager", "multidex"]
  108. if not os.path.exists(s3):
  109. distutils.dir_util.mkpath(s3)
  110. gw_apk_tool.move_package(s1, s3, list_package)
  111. s1 = os.path.join(decompileDir, "smali_classes2", "com")
  112. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  113. s3 = os.path.join(decompileDir, smali_classes_new, "com")
  114. list_package = ["swmansion", "sxd3", "taptap", "tds", "tencent", "ttnet", "unicom", "unity3d", "uodis", "vivo",
  115. "volcengine", "vv", "weibo", "xiaomi", "xm", "yqritc"]
  116. if not os.path.exists(s3):
  117. distutils.dir_util.mkpath(s3)
  118. gw_apk_tool.move_package(s1, s3, list_package)
  119. def remove_navigate(decompileDir):
  120. tmp_res = os.path.join(decompileDir, "res", "navigation")
  121. tmp_public_xml = os.path.join(decompileDir, "res", "values", "public.xml")
  122. if os.path.exists(tmp_res):
  123. distutils.dir_util.remove_tree(tmp_res)
  124. if os.path.exists(tmp_public_xml):
  125. os.remove(tmp_public_xml)
  126. def move_10_bytedance(decompileDir):
  127. s1 = os.path.join(decompileDir, "smali_classes10/com/bytedance")
  128. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  129. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  130. list_package = ["ttgame"]
  131. if not os.path.exists(s3):
  132. distutils.dir_util.mkpath(s3)
  133. gw_apk_tool.move_package(s1, s3, list_package)
  134. s1 = os.path.join(decompileDir, "smali_classes10/com/bytedance")
  135. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  136. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  137. list_package = ["ttnet"]
  138. if not os.path.exists(s3):
  139. distutils.dir_util.mkpath(s3)
  140. gw_apk_tool.move_package(s1, s3, list_package)
  141. s1 = os.path.join(decompileDir, "smali_classes10/com/bytedance")
  142. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  143. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  144. list_package = ["ug"]
  145. if not os.path.exists(s3):
  146. distutils.dir_util.mkpath(s3)
  147. gw_apk_tool.move_package(s1, s3, list_package)
  148. s1 = os.path.join(decompileDir, "smali_classes10/com/bytedance")
  149. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  150. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  151. list_package = ["unbridge"]
  152. if not os.path.exists(s3):
  153. distutils.dir_util.mkpath(s3)
  154. gw_apk_tool.move_package(s1, s3, list_package)
  155. s1 = os.path.join(decompileDir, "smali_classes10/com/bytedance")
  156. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  157. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  158. list_package = ["usergrowth"]
  159. if not os.path.exists(s3):
  160. distutils.dir_util.mkpath(s3)
  161. gw_apk_tool.move_package(s1, s3, list_package)
  162. s1 = os.path.join(decompileDir, "smali_classes10/com/bytedance")
  163. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  164. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  165. list_package = ["watson"]
  166. if not os.path.exists(s3):
  167. distutils.dir_util.mkpath(s3)
  168. gw_apk_tool.move_package(s1, s3, list_package)
  169. s1 = os.path.join(decompileDir, "smali_classes19/com")
  170. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  171. s3 = os.path.join(decompileDir, smali_classes_new, "com")
  172. list_package = ["ixigua", "just", "loc", "luck"]
  173. if not os.path.exists(s3):
  174. distutils.dir_util.mkpath(s3)
  175. gw_apk_tool.move_package(s1, s3, list_package)
  176. def move_11_bytedance(decompileDir):
  177. s1 = os.path.join(decompileDir, "smali_classes10/com/bytedance")
  178. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  179. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  180. list_package = ["rocketapi", "wrapper_account", "wrapper_alog", "wrapper_appcloud", "wrapper_applog"]
  181. if not os.path.exists(s3):
  182. distutils.dir_util.mkpath(s3)
  183. gw_apk_tool.move_package(s1, s3, list_package)
  184. s1 = os.path.join(decompileDir, "smali_classes10/com/bytedance")
  185. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  186. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  187. list_package = ["wrapper_download", "wrapper_encrypt", "wrapper_jsbridge", "wrapper_librarian", "wrapper_net"]
  188. if not os.path.exists(s3):
  189. distutils.dir_util.mkpath(s3)
  190. gw_apk_tool.move_package(s1, s3, list_package)
  191. s1 = os.path.join(decompileDir, "smali_classes10/com/bytedance")
  192. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  193. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  194. list_package = ["wrapper_pangolinsdk", "wrapper_push", "wrapper_sdk_monitor", "wrapper_service_manager",
  195. "wrapper_setting_manager"]
  196. if not os.path.exists(s3):
  197. distutils.dir_util.mkpath(s3)
  198. gw_apk_tool.move_package(s1, s3, list_package)
  199. s1 = os.path.join(decompileDir, "smali_classes10/com/bytedance")
  200. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  201. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  202. list_package = ["wrapper_share", "wrapper_smartrouter", "wrapper_utility"]
  203. if not os.path.exists(s3):
  204. distutils.dir_util.mkpath(s3)
  205. gw_apk_tool.move_package(s1, s3, list_package)
  206. def move_4_bytedance(decompileDir):
  207. s1 = os.path.join(decompileDir, "smali_classes4/com/bytedance")
  208. list_b = ["android", "apm6", "article", "bdinstall", "boost_multidex", "cloudplay", "crash", "ttgame",
  209. "apkidentity", "apmsdk", "bdauditsdk", "bdlocation", "boringssl", "common", "crashthanos", "apm",
  210. "applog", "bdauditsdkbase", "bdturing", "channelmigrator", "constants2", "frameworks"]
  211. for a in list_b:
  212. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  213. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  214. list_package = [a]
  215. if not os.path.exists(s3):
  216. distutils.dir_util.mkpath(s3)
  217. gw_apk_tool.move_package(s1, s3, list_package)
  218. def move_5_bytedance(decompileDir):
  219. s1 = os.path.join(decompileDir, "smali_classes5/com/bytedance")
  220. list_b = ["frameworks", "gamerecord", "lynx", "perf", "reader_apk", "shadowhook", "thanos", "framwork", "geckox",
  221. "mira", "permissions", "remote", "share_channel_douyin", "tpssdk", "frankie", "grecorder", "monitor",
  222. "pipeline", "retrofit2", "share_channel_weibo", "tracing", "frankie_sohotfix_util", "gumiho", "mpaas",
  223. "platform", "robust", "share_image_token", "ttgame", "frankie_sohotfix_util_emulator", "hidden_watermark",
  224. "msgsdk", "praisedialoglib", "router", "share_qq", "fresco", "ies", "news", "push", "sdk", "share_ui",
  225. "game", "keva", "notification", "react", "security", "share_wechat", "gameprotect", "librarian", "pangle",
  226. "reactnative", "services", "sync"]
  227. for a in list_b:
  228. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  229. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance")
  230. list_package = [a]
  231. if not os.path.exists(s3):
  232. distutils.dir_util.mkpath(s3)
  233. gw_apk_tool.move_package(s1, s3, list_package)
  234. def move_6_bytedance(decompileDir):
  235. s1 = os.path.join(decompileDir, "smali_classes6/com/bytedance/ttgame")
  236. list_b = ["account", "base", "core", "framework", "glog", "gsdk_base_common_ui", "gsdk_base_utils", "library",
  237. "module", "audio", "channel", "engine", "gecko", "gsdk", "gsdk_base_sdk_config", "gsdksync", "main"]
  238. for a in list_b:
  239. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  240. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame")
  241. list_package = [a]
  242. if not os.path.exists(s3):
  243. distutils.dir_util.mkpath(s3)
  244. gw_apk_tool.move_package(s1, s3, list_package)
  245. def move_60_ss(decompileDir):
  246. s1 = os.path.join(decompileDir, "smali_classes60/com/ss/android")
  247. list_b = ["account", "applog", "bytedcert", "deviceregister", "downloadad", "downloadlib", "newmedia",
  248. "push_3rd_module", "pushmanager", "token", "ug", "agilelogger", "article", "common", "download",
  249. "downloadapi", "message", "push", "push_common_lib", "socialbase", "ttmd5", "ugc"]
  250. for a in list_b:
  251. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  252. s3 = os.path.join(decompileDir, smali_classes_new, "com/ss/android")
  253. list_package = [a]
  254. if not os.path.exists(s3):
  255. distutils.dir_util.mkpath(s3)
  256. gw_apk_tool.move_package(s1, s3, list_package)
  257. def move_64_bytedance(decompileDir):
  258. s1 = os.path.join(decompileDir, "smali_classes64/com/bytedance/ttgame")
  259. list_b = ["rocket", "rocketapi", "sdk", "tps", "unity"]
  260. for a in list_b:
  261. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  262. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame")
  263. list_package = [a]
  264. if not os.path.exists(s3):
  265. distutils.dir_util.mkpath(s3)
  266. gw_apk_tool.move_package(s1, s3, list_package)
  267. def move_7_bytedance(decompileDir):
  268. s1 = os.path.join(decompileDir, "smali_classes7/com/bytedance/ttgame/module")
  269. list_b = ["compliance", "crash", "deeplink", "download", "fileupload", "gameinfo", "gameprotect", "compress",
  270. "database", "demo", "dynamic", "friendchain", "gamelivesdk"]
  271. for a in list_b:
  272. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  273. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module")
  274. list_package = [a]
  275. if not os.path.exists(s3):
  276. distutils.dir_util.mkpath(s3)
  277. gw_apk_tool.move_package(s1, s3, list_package)
  278. def move_8_bytedance(decompileDir):
  279. s1 = os.path.join(decompileDir, "smali_classes8/com/bytedance/ttgame/module")
  280. list_b = ["location", "log", "mediaupload", "netdiagnose", "pay", "push", "rn", "rnengine", "screenrecord",
  281. "loccom", "main", "monitor", "notice", "privacy", "rating", "rncore"]
  282. for a in list_b:
  283. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  284. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module")
  285. list_package = [a]
  286. if not os.path.exists(s3):
  287. distutils.dir_util.mkpath(s3)
  288. gw_apk_tool.move_package(s1, s3, list_package)
  289. def move_9_bytedance(decompileDir):
  290. s1 = os.path.join(decompileDir, "smali_classes9/com/bytedance/ttgame/module")
  291. list_b = ["screenrecord", "share", "thanos", "unitelive"]
  292. for a in list_b:
  293. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  294. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module")
  295. list_package = [a]
  296. if not os.path.exists(s3):
  297. distutils.dir_util.mkpath(s3)
  298. gw_apk_tool.move_package(s1, s3, list_package)
  299. def move_37_bytedance(decompileDir):
  300. s1 = os.path.join(decompileDir, "smali_classes37/com/bytedance/apm6")
  301. list_b = ["foundation", "hub", "memory", "monitor", "perf", "service", "util"]
  302. # for a in list_b:
  303. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  304. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/apm6")
  305. list_package = list_b
  306. if not os.path.exists(s3):
  307. distutils.dir_util.mkpath(s3)
  308. gw_apk_tool.move_package(s1, s3, list_package)
  309. def move_49_bytedance(decompileDir):
  310. s1 = os.path.join(decompileDir, "smali_classes49/com/bytedance/common")
  311. list_b = ["perf_block", "process", "profilesdk", "push", "support", "util", "utility", "wschannel"]
  312. # for a in list_b:
  313. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  314. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/common")
  315. list_package = list_b
  316. if not os.path.exists(s3):
  317. distutils.dir_util.mkpath(s3)
  318. gw_apk_tool.move_package(s1, s3, list_package)
  319. def move_103_bytedance(decompileDir):
  320. s1 = os.path.join(decompileDir, "smali_classes103/com/bytedance/sdk")
  321. list_b = ["bridge", "account", "open", "openadsdk"]
  322. for a in list_b:
  323. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  324. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/sdk")
  325. list_package = [a]
  326. if not os.path.exists(s3):
  327. distutils.dir_util.mkpath(s3)
  328. gw_apk_tool.move_package(s1, s3, list_package)
  329. def move_125_bytedance(decompileDir):
  330. s1 = os.path.join(decompileDir, "smali_classes125/com/bytedance/ttgame/module")
  331. list_b = ["abtest", "account", "apimonitor", "asr", "boost", "bridge", "cdkey", "cloud", "cloudgame", "common",
  332. "compliance", "gpm", "location"]
  333. for a in list_b:
  334. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  335. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module")
  336. list_package = [a]
  337. if not os.path.exists(s3):
  338. distutils.dir_util.mkpath(s3)
  339. gw_apk_tool.move_package(s1, s3, list_package)
  340. def move_158_bytedance(decompileDir):
  341. s1 = os.path.join(decompileDir, "smali_classes158/com/bytedance/ttgame/sdk/module")
  342. list_b = ["entity", "location", "pojo", "skin", "ui", "utils"]
  343. # for a in list_b:
  344. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  345. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/sdk/module")
  346. list_package = list_b
  347. if not os.path.exists(s3):
  348. distutils.dir_util.mkpath(s3)
  349. gw_apk_tool.move_package(s1, s3, list_package)
  350. s1 = os.path.join(decompileDir, "smali_classes158/com/bytedance/ttgame/sdk/module")
  351. list_b = ["account", "bridge"]
  352. # for a in list_b:
  353. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  354. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/sdk/module")
  355. list_package = list_b
  356. if not os.path.exists(s3):
  357. distutils.dir_util.mkpath(s3)
  358. gw_apk_tool.move_package(s1, s3, list_package)
  359. s1 = os.path.join(decompileDir, "smali_classes161/com/bytedance/ttgame/module/compliance")
  360. list_b = ["bridge"]
  361. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  362. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module/compliance")
  363. list_package = list_b
  364. if not os.path.exists(s3):
  365. distutils.dir_util.mkpath(s3)
  366. gw_apk_tool.move_package(s1, s3, list_package)
  367. s1 = os.path.join(decompileDir, "smali_classes190/com/bytedance/ttgame/module/screenrecord")
  368. list_b = ["bridge", "download", "impl", "interceptor", "lib", "log", "net"]
  369. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  370. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module/screenrecord")
  371. list_package = list_b
  372. if not os.path.exists(s3):
  373. distutils.dir_util.mkpath(s3)
  374. gw_apk_tool.move_package(s1, s3, list_package)
  375. s1 = os.path.join(decompileDir, "smali_classes191/com/bytedance/ttgame/module/share")
  376. list_b = ["bridge", "api", "impl"]
  377. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  378. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module/share")
  379. list_package = list_b
  380. if not os.path.exists(s3):
  381. distutils.dir_util.mkpath(s3)
  382. gw_apk_tool.move_package(s1, s3, list_package)
  383. s1 = os.path.join(decompileDir, "smali_classes197/com/bytedance/sdk/account")
  384. list_b = ["api", "bpea", "constants", "extra"]
  385. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  386. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/sdk/account")
  387. list_package = list_b
  388. if not os.path.exists(s3):
  389. distutils.dir_util.mkpath(s3)
  390. gw_apk_tool.move_package(s1, s3, list_package)
  391. s1 = os.path.join(decompileDir, "smali_classes197/com/bytedance/sdk/account")
  392. list_b = ["impl", "information", "mobile", "network"]
  393. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  394. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/sdk/account")
  395. list_package = list_b
  396. if not os.path.exists(s3):
  397. distutils.dir_util.mkpath(s3)
  398. gw_apk_tool.move_package(s1, s3, list_package)
  399. s1 = os.path.join(decompileDir, "smali_classes197/com/bytedance/sdk/account")
  400. list_b = ["save", "sso", "user", "bdopen", "common"]
  401. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  402. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/sdk/account")
  403. list_package = list_b
  404. if not os.path.exists(s3):
  405. distutils.dir_util.mkpath(s3)
  406. gw_apk_tool.move_package(s1, s3, list_package)
  407. s1 = os.path.join(decompileDir, "smali_classes197/com/bytedance/sdk/account")
  408. list_b = ["execute", "helper", "induce", "job", "monitor"]
  409. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  410. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/sdk/account")
  411. list_package = list_b
  412. if not os.path.exists(s3):
  413. distutils.dir_util.mkpath(s3)
  414. gw_apk_tool.move_package(s1, s3, list_package)
  415. s1 = os.path.join(decompileDir, "smali_classes197/com/bytedance/sdk/account")
  416. list_b = ["response", "special", "third", "utils"]
  417. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  418. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/sdk/account")
  419. list_package = list_b
  420. if not os.path.exists(s3):
  421. distutils.dir_util.mkpath(s3)
  422. gw_apk_tool.move_package(s1, s3, list_package)
  423. s1 = os.path.join(decompileDir, "smali_classes197/com/bytedance/sdk/account")
  424. list_b = ["param", "platform_china"]
  425. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  426. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/sdk/account")
  427. list_package = list_b
  428. if not os.path.exists(s3):
  429. distutils.dir_util.mkpath(s3)
  430. gw_apk_tool.move_package(s1, s3, list_package)
  431. s1 = os.path.join(decompileDir, "smali_classes197/com/bytedance/sdk/account")
  432. list_b = ["platform", "open"]
  433. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  434. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/sdk/account")
  435. list_package = list_b
  436. if not os.path.exists(s3):
  437. distutils.dir_util.mkpath(s3)
  438. gw_apk_tool.move_package(s1, s3, list_package)
  439. s1 = os.path.join(decompileDir, "smali_classes210/com/bytedance/ttgame/module/compliance")
  440. list_b = ["bridge"]
  441. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  442. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module/compliance")
  443. list_package = list_b
  444. if not os.path.exists(s3):
  445. distutils.dir_util.mkpath(s3)
  446. gw_apk_tool.move_package(s1, s3, list_package)
  447. s1 = os.path.join(decompileDir, "smali_classes214/com/bytedance/ttgame/sdk/module/account")
  448. list_b = ["api", "login"]
  449. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  450. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/sdk/module/account")
  451. list_package = list_b
  452. if not os.path.exists(s3):
  453. distutils.dir_util.mkpath(s3)
  454. gw_apk_tool.move_package(s1, s3, list_package)
  455. s1 = os.path.join(decompileDir, "smali_classes214/com/bytedance/ttgame/sdk/module/account")
  456. list_b = ["pojo"]
  457. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  458. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/sdk/module/account")
  459. list_package = list_b
  460. if not os.path.exists(s3):
  461. distutils.dir_util.mkpath(s3)
  462. gw_apk_tool.move_package(s1, s3, list_package)
  463. s1 = os.path.join(decompileDir, "smali_classes214/com/bytedance/ttgame/sdk/module/account")
  464. list_b = ["platform"]
  465. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  466. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/sdk/module/account")
  467. list_package = list_b
  468. if not os.path.exists(s3):
  469. distutils.dir_util.mkpath(s3)
  470. gw_apk_tool.move_package(s1, s3, list_package)
  471. s1 = os.path.join(decompileDir, "smali_classes216/com/bytedance/ttgame/module/screenrecord")
  472. list_b = ["bridge"]
  473. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  474. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module/screenrecord")
  475. list_package = list_b
  476. if not os.path.exists(s3):
  477. distutils.dir_util.mkpath(s3)
  478. gw_apk_tool.move_package(s1, s3, list_package)
  479. s1 = os.path.join(decompileDir, "smali_classes217/com/bytedance/ttgame/module/share")
  480. list_b = ["bridge"]
  481. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  482. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module/share")
  483. list_package = list_b
  484. if not os.path.exists(s3):
  485. distutils.dir_util.mkpath(s3)
  486. gw_apk_tool.move_package(s1, s3, list_package)
  487. s1 = os.path.join(decompileDir, "smali_classes217/com/bytedance/ttgame/module/share")
  488. list_b = ["api"]
  489. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  490. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/module/share")
  491. list_package = list_b
  492. if not os.path.exists(s3):
  493. distutils.dir_util.mkpath(s3)
  494. gw_apk_tool.move_package(s1, s3, list_package)
  495. s1 = os.path.join(decompileDir, "smali_classes228/com/bytedance/ttgame/sdk/module/account/platform")
  496. list_b = ["api", "douyin", "huoshan", "onekey"]
  497. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  498. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame/sdk/module/account/platform")
  499. list_package = list_b
  500. if not os.path.exists(s3):
  501. distutils.dir_util.mkpath(s3)
  502. gw_apk_tool.move_package(s1, s3, list_package)
  503. def move_224_bytedance(decompileDir):
  504. s1 = os.path.join(decompileDir, "smali_classes224/com/bytedance/sdk/account")
  505. list_b = ["open"]
  506. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  507. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/sdk/account")
  508. list_package = list_b
  509. if not os.path.exists(s3):
  510. distutils.dir_util.mkpath(s3)
  511. gw_apk_tool.move_package(s1, s3, list_package)
  512. s1 = os.path.join(decompileDir, "smali_classes25/androidx")
  513. list_b = ["cardview","collection","concurrent","constraintlayout","coordinatorlayout"]
  514. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  515. s3 = os.path.join(decompileDir, smali_classes_new, "androidx")
  516. list_package = list_b
  517. if not os.path.exists(s3):
  518. distutils.dir_util.mkpath(s3)
  519. gw_apk_tool.move_package(s1, s3, list_package)
  520. s1 = os.path.join(decompileDir, "smali_classes28/com")
  521. list_b = ["unity3d","uodis","vivo","volcengine","vv","weibo","xiaomi","xiaomi","xm","yqritc"]
  522. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  523. s3 = os.path.join(decompileDir, smali_classes_new, "com")
  524. list_package = list_b
  525. if not os.path.exists(s3):
  526. distutils.dir_util.mkpath(s3)
  527. gw_apk_tool.move_package(s1, s3, list_package)
  528. def move_2(decompileDir):
  529. s1 = os.path.join(decompileDir, "smali_classes23/com")
  530. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  531. s3 = os.path.join(decompileDir, smali_classes_new, "com")
  532. list_package = ["ixigua", "just", "loc", "luck"]
  533. if not os.path.exists(s3):
  534. distutils.dir_util.mkpath(s3)
  535. gw_apk_tool.move_package(s1, s3, list_package)
  536. s1 = os.path.join(decompileDir, "smali_classes24/com/ss")
  537. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  538. s3 = os.path.join(decompileDir, smali_classes_new, "com/ss")
  539. list_package = ["bduploader", "cgpa", "mediakit"]
  540. if not os.path.exists(s3):
  541. distutils.dir_util.mkpath(s3)
  542. gw_apk_tool.move_package(s1, s3, list_package)
  543. s1 = os.path.join(decompileDir, "smali_classes24/com/ss")
  544. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  545. s3 = os.path.join(decompileDir, smali_classes_new, "com/ss")
  546. list_package = ["android"]
  547. if not os.path.exists(s3):
  548. distutils.dir_util.mkpath(s3)
  549. gw_apk_tool.move_package(s1, s3, list_package)
  550. s1 = os.path.join(decompileDir, "smali_classes26/androidx")
  551. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  552. s3 = os.path.join(decompileDir, smali_classes_new, "com/androidx")
  553. list_package = ["tracing", "transition", "vectordrawable", "versionedparcelable", "viewbinding", "viewpager",
  554. "viewpager2", "window"]
  555. if not os.path.exists(s3):
  556. distutils.dir_util.mkpath(s3)
  557. gw_apk_tool.move_package(s1, s3, list_package)
  558. s1 = os.path.join(decompileDir, "smali_classes27/androidx")
  559. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  560. s3 = os.path.join(decompileDir, smali_classes_new, "com/androidx")
  561. list_package = ["interpolator", "legacy", "lifecycle", "loader"]
  562. if not os.path.exists(s3):
  563. distutils.dir_util.mkpath(s3)
  564. gw_apk_tool.move_package(s1, s3, list_package)
  565. s1 = os.path.join(decompileDir, "smali_classes27/androidx")
  566. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  567. s3 = os.path.join(decompileDir, smali_classes_new, "com/androidx")
  568. list_package = ["localbroadcastmanager", "media", "multidex", "navigation"]
  569. if not os.path.exists(s3):
  570. distutils.dir_util.mkpath(s3)
  571. gw_apk_tool.move_package(s1, s3, list_package)
  572. s1 = os.path.join(decompileDir, "smali_classes29/com/bytedance/ttgame")
  573. smali_classes_new = gw_apk_tool.create_mutil_smali(decompileDir)
  574. s3 = os.path.join(decompileDir, smali_classes_new, "com/bytedance/ttgame")
  575. list_package = ["rocket", "rocketapi", "sdk", "tps", "unity"]
  576. if not os.path.exists(s3):
  577. distutils.dir_util.mkpath(s3)
  578. gw_apk_tool.move_package(s1, s3, list_package)
  579. def handle_public_xml(public_xml_path, remove_node):
  580. if not os.path.exists(public_xml_path):
  581. logging.info('public_xml is null: ' + public_xml_path)
  582. return
  583. new_lines = []
  584. with open(public_xml_path, 'r+') as f:
  585. for line in f.readlines():
  586. # l = line.strip()
  587. if line.find(remove_node) > -1:
  588. continue
  589. new_lines.append(line)
  590. f.seek(0)
  591. f.truncate()
  592. f.writelines(new_lines)
  593. return
  594. if __name__ == '__main__':
  595. # del_qihoo("C:\\Users\\Administrator\\Desktop\\zt")
  596. remove_navigate("G:\\autopack2.0_kuaifa\\tool\\workspace\\lrs360\\13651\\extract")