script.py 32 KB

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