国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

腳本之家,腳本語言編程技術及教程分享平臺!
分類導航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|

服務器之家 - 腳本之家 - Python - 用python解壓分析jar包實例

用python解壓分析jar包實例

2020-04-19 11:09海峰-清歡 Python

今天小編就為大家分享一篇用python解壓分析jar包實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

寫這個玩意的背景:在u8多渠道打包里,需要分析jar包,并把里面的文件按目錄和類型分別放在root和assets文件夾里,之前師兄都是手動解壓,一個一個文件夾找文件,效率比較低,剛好最近手上的android項目已經做完了,就決定寫一個自動化分析jar文件并復制粘貼到指定文件夾的腳本。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# -*- coding: utf-8 -*-
import os
import shutil
import zipfile
 
count = 1
def getSumDir():
  sumfilelist = os.listdir(os.getcwd())
  for dir in sumfilelist:
    if ".idea" not in dir:
      classify(dir)
 
 
def getlibDir():
  sumfilelist = os.listdir(os.getcwd())
  for dir in sumfilelist:
    if "libs" in dir:
      jieyajar(dir)
 
 
def jieyajar(dir):
  files = os.listdir(dir)
  for jars in files:
    if "jar" in jars:
      zfile = zipfile.ZipFile('libs/' + jars, 'r')
      if not os.path.exists(os.getcwd() + '/jarlog/' + jars):
        os.makedirs(os.getcwd() + '/jarlog/' + jars)
      zfile.extractall(os.getcwd() + '/jarlog/' + jars)
 
      if not os.path.exists(os.getcwd() + '/jars/'):
        os.makedirs(os.getcwd() + '/jars/')
      zfile.extractall(os.getcwd() + '/jars/')
      zfile.close
 
  for file in os.listdir(os.getcwd()):
    if "jars" in file:
      classify(file)
 
 
# def classify(path):
#   if os.path.isfile(path):
#     if ".class" not in path:
#       if "assets" in os.path.dirname(path):
#         if not os.path.exists(os.path.dirname(os.getcwd()) + '/assets/' + os.path.dirname(path)):
#           os.makedirs(os.path.dirname(os.getcwd()) + '/assets/' + os.path.dirname(path))
#         shutil.copy(path, os.path.dirname(os.getcwd()) + '/assets/' + os.path.dirname(path))
#       else:
#         if not os.path.exists(os.path.dirname(os.getcwd())+'/root/'+os.path.dirname(path)):
#          os.makedirs(os.path.dirname(os.getcwd())+'/root/'+os.path.dirname(path))
#         shutil.copy(path,os.path.dirname(os.getcwd())+'/root/'+os.path.dirname(path))
#   else :
#     list = os.listdir(path)
#     for dir in list:
#       classify(path+"/"+dir)
 
def classify(path):
  global count
  if os.path.isfile(path):
    if ".class" not in path:
      if not os.path.exists(os.getcwd() + '/root/' + os.path.dirname(path)):
        os.makedirs(os.getcwd() + '/root/' + os.path.dirname(path))
      shutil.copy(path, os.getcwd() + '/root/' + os.path.dirname(path))
  else:
    if 'assets' in path and count == 1:
      count = count + 1
      shutil.copytree(os.getcwd()+'/'+path, os.getcwd() + '/assets')
    elif 'META-INF' not in path:
      list = os.listdir(path)
      for dir in list:
        classify(path + "/" + dir)
 
 
# getSumDir()
getlibDir()

嗯,主要就是對文件夾和文件的操作。。

以上這篇用python解壓分析jar包實例就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持服務器之家。

原文鏈接:https://blog.csdn.net/u013692888/article/details/75011528

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 国产欧美日韩综合精品一区二区 | 国产乱xxxxx97国语对白 | 中文字幕成人av | 国产欧美日本 | 中文字幕在线观看一区 | 国产精品毛片久久久久久久 | 精品在线一区二区三区 | 国产一区二区三区视频 | 91精品国产一区二区 | 欧洲成人午夜免费大片 | 日韩av一区二区在线观看 | 91免费在线视频观看 | 一级录像免费录像在线观看 | 国产精品成人一区二区三区夜夜夜 | 精品国产乱码久久久久久久软件 | 亚洲 在线 | 国产高清视频一区 | 欧美日韩国产影院 | 一级毛片免费看 | 99热在线精品免费 | 久久久久综合精品福利啪啪 | 精品欧美乱码久久久久久1区2区 | 国产最好的精华液网站 | 99精品99| 欧美大片免费高清观看 | av片在线观看| 中文字幕天堂 | 成人性毛片 | 99在线精品视频 | 成人影音 | 国产精品久久久久一区二区三区 | 久草热8精品视频在线观看 毛片黄片免费观看 | 91av官网| 夜久久 | 综合网激情五月 | 午夜免费福利视频 | 久久九| 午夜精品电影 | 亚洲精品日本 | 懂色av成人一区二区三区 | 日本精品一区二区三区视频 |