//获取APK包名等信息
import console;
getPackageName=function(apkPath){
import process.popen;
var aaptPath="D:\Changzhi\dnplayer2\aapt.exe"//雷电模拟器
var cmd=" dump badging "++apkPath
var subprocess = ..process.popen(aaptPath,cmd)
var str = subprocess.read()
subprocess.close();
//console.log(str)
m,n,packageName=string.find(str,"name='(.+?)'")
//console.log(m,n,packageName)
if(m>0){
return packageName;
}else {
return false
}
}
console.log(getPackageName("D:\桌面\QQ.apk"))
console.pause()
网友评论