def get_packer_activity(addr): # 提过apk路径,获取包名和首页activity cmd = ‘aapt dump badging ‘+ addr+‘>abc.log‘ flag = [] if 0 == os.system(cmd): try: with open(‘abc.log‘, ‘r‘, encoding=‘UTF-8‘) as file: abc = file.readlines() for line in abc: if ‘launchable-activity‘ == line.strip()[:19] or ‘package: name‘ == line.strip()[:13]: flag.append(line.strip().split(‘\‘‘)[1]) except FileNotFoundError: print(‘未找到需要的文件‘) return flag print(get_packer_activity(‘C:\\Users\\Administrator\\Desktop\\AnTuTu.apk‘))
原文地址:https://www.cnblogs.com/ptest/p/10207392.html
时间: 2024-11-03 22:09:46