今天工作的时候需要在Sdklancher中将待安装的APP的Pagename显示出来.批量在N多个APP的apk文件中去找Pagename太麻烦了,就用python写了一个批量脚本,虽然很烂但也勉强能使用.
# Author by Acidsweet
# Version 0.01
# Require OS:*unix
# How To Use It
# Use "python <self.name>.py <the-dir-where-your-apks-in>"
# Tips:Remenber to put the AXMLPrinter2.jar and <self.name>.py in the same dir
# Remenber to install the java and make sure it in the PATH
# <the-dir-where-your-apks-in> must end with '/'
# The result will in the result.txt which in <the-dir-where-your-apks-in>
import os,sys
from xml.dom import minidom
def unPack(pathdir,packname):
apkfile=pathdir+packname+'.apk'
filename=pathdir+packname
os.system('unzip '+apkfile+' -d '+filename)
#-----------------------------------------------------------------------
def getTarget(pathdir):
xmldoc=minidom.parse(pathdir+'XML.xml')
activit

本文介绍了一种使用Python编写的批量解析apk文件中AndroidManifest.xml以获取Pagename的方法。在处理大量APP时,此脚本简化了手动查找的过程,依赖于"AXMLPrinter2.jar"工具,该工具需与.py脚本放在同一目录下。
1万+

被折叠的 条评论
为什么被折叠?



