借助aapt.exe文件

aapt.exe 解析apk包信息cmd命令:

aapt dump badging *.apk
aapt d badging *.apk >1.txt(保存成1.txt文件)

ProcessStartInfo start = new ProcessStartInfo("cmd.exe");
start.CreateNoWindow = true;
start.RedirectStandardInput = true;
start.RedirectStandardOutput = true;
start.UseShellExecute = false;
Process process = Process.Start(start);
try
{
     var aaptFile = Server.MapPath("~/aaptFile/aapt.exe");
     //apkPath 安装包路径
     process.StandardInput.WriteLine(aaptFile + " d badging \"" + apkPath + "\"");
     StreamReader reader = process.StandardOutput;

     while (!reader.EndOfStream)
     {
         //解析所需要数据
         string output = reader.ReadLine();
     }
}
catch
{}    

  

相关文章:

  • 2021-07-07
  • 2022-12-23
  • 2021-05-14
  • 2021-11-02
  • 2021-08-10
  • 2022-02-02
  • 2021-09-16
猜你喜欢
  • 2021-06-15
  • 2022-02-26
  • 2021-09-01
  • 2022-01-10
  • 2021-08-25
  • 2021-06-08
相关资源
相似解决方案