script.py 30 KB

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