当前位置:   article > 正文

利用Androguard获取APK使用权限_androguard提取 apk 的权限

androguard提取 apk 的权限

利用Androguard获取APK使用权限

#-*-conding:utf-8-*-
import os

from androguard.misc import AnalyzeAPK
from androguard.core.bytecodes.apk import APK
from androguard.core.bytecodes.dvm import DalvikVMFormat
from androguard.core.analysis.analysis import Analysis


path = r"/media/gsm/SeagateExp_1TB/androguard/test/apk/2012"
out_path = r"/media/gsm/SeagateExp_1TB/androguard/test/perm/2012"
files = []

for name in os.listdir(path):
        if os.path.isfile(os.path.join(path, name)):
            files.append(name)
# print(files)
files.sort()

def main():
    for apk in files:
        print(apk)
        a, d, dx = AnalyzeAPK(path + '/'+ apk)
        apk_name = os.path.splitext(apk)[0]

        # 获取申请权限
        with open(os.path.join(out_path, apk_name + ".txt"), 'w', encoding='utf-8') as f:
            for i in a.get_permissions():
                f.write(str(i) + '\n')
        f.close()
        print("end"+apk)



if __name__=='__main__':
    main()
  • 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
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/460973
推荐阅读
相关标签
  

闽ICP备14008679号