资源简介

解析apk/ipa图标/名称/包名/版本号等信息,图标百分百解析出来,如果大家不需要解析图标,请移步到这篇博客:http://blog.csdn.net/moyanxuan_1993_2_24/article/details/51330060

资源截图

代码片段和文件信息

package com.app;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sinaapp.msdxblog.apkUtil.entity.ApkInfo;
import com.sinaapp.msdxblog.apkUtil.utils.ApkUtil;
import com.sinaapp.msdxblog.apkUtil.utils.IconUtil;
import com.sinaapp.msdxblog.apkUtil.utils.IpaUtil;

/**
 * Servlet implementation class ReadAppUtil
 */
public class ReadAppUtil extends HttpServlet {
private static final long serialVersionUID = 1L;

    /**
     * Default constructor. 
     */
    public ReadAppUtil() {
        // TODO Auto-generated constructor stub
    }

/**
 * @see HttpServlet#doGet(HttpServletRequest request HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
doPost(requestresponse);
}

/**
 * @see HttpServlet#doPost(HttpServletRequest request HttpServletResponse response)
 */
protected void doPost(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
PrintWriter pw = response.getWriter();
ApkInfo apkInfo = null;
String serverPath = request.getRealPath(File.separator);
System.out.println(“============================serverPath:“ + serverPath);

try {
// String apkpath = “E:/tomcat/apache-tomcat-7.0.55-windows-x64/apache-tomcat-7.0.55/webapps/ReadApp/WEB-INF/classes/shenmiaotaowang_966.apk“;
//放一个apk文件到tomcat/webapps
String apkpath = “/usr/local/apache-tomcat-7.0.29/webapps/shenmiaotaowang_966.apk“;
apkInfo = new ApkUtil().getApkInfo(apkpath);

System.out.println(apkInfo);
//把图片解析到路径/usr/local/python/img/下面,且命名图片名称为apk.png
IconUtil.extractFileFromApk(apkpath apkInfo.getApplicationIcon()“/usr/local/python/img/apk.png“);
} catch (Exception e) {
e.printStackTrace();
}

try {
// Mapject> mapIpa = IpaUtil.readIPA(“E:/tomcat/apache-tomcat-7.0.55-windows-x64/apache-tomcat-7.0.55/webapps/ReadApp/WEB-INF/classes/拳皇97风云再起OL.ipa“);
//放一个ipa文件到tomcat/webapps
Mapject> mapIpa = IpaUtil.readIPA(“/usr/local/apache-tomcat-7.0.29/webapps/quanhuang.ipa“);
System.out.println(“======ipa==========“);
pw.println(“================================ipa begin==================================“);
for (String key : mapIpa.keySet()) {
System.out.println(key + “:“ + mapIpa.get(key));
pw.println(key + “:“ + mapIpa.get(key));
}


// Process process= Runtime.getRuntime().exec(“cmd.exe /c start E:\\python\\img\\serilizeImg.bat“);
//执行脚本文件,解析ipa文件图标 ,ipin.sh文件和ipin.py文件都放在python目录下
Process process= Runtime.getRuntime().exec(“sh /usr/local/python/ipin.sh“);
BufferedReade

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-10-26 19:26  ReadApp\
     文件         744  2016-10-26 19:51  ReadApp\.classpath
     文件        1040  2016-10-26 17:36  ReadApp\.project
     目录           0  2016-10-26 18:13  ReadApp\.settings\
     文件         567  2016-10-26 17:36  ReadApp\.settings\.jsdtscope
     文件          95  2016-12-19 10:10  ReadApp\.settings\org.eclipse.core.resources.prefs
     文件         364  2016-10-26 17:36  ReadApp\.settings\org.eclipse.jdt.core.prefs
     文件         473  2016-10-26 17:36  ReadApp\.settings\org.eclipse.wst.common.component
     文件         305  2016-10-26 17:36  ReadApp\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-10-26 17:36  ReadApp\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-10-26 17:36  ReadApp\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2016-10-26 19:23  ReadApp\build\
     目录           0  2016-12-13 15:58  ReadApp\build\classes\
     目录           0  2016-12-13 15:58  ReadApp\build\classes\com\
     目录           0  2016-12-13 15:58  ReadApp\build\classes\com\app\
     文件        4363  2016-12-19 11:25  ReadApp\build\classes\com\app\ReadAppUtil.class
     目录           0  2016-12-13 15:58  ReadApp\build\classes\com\sinaapp\
     目录           0  2016-12-13 15:58  ReadApp\build\classes\com\sinaapp\msdxblog\
     目录           0  2016-12-13 15:58  ReadApp\build\classes\com\sinaapp\msdxblog\apkUtil\
     目录           0  2016-12-13 15:58  ReadApp\build\classes\com\sinaapp\msdxblog\apkUtil\entity\
     文件        5970  2016-12-13 15:58  ReadApp\build\classes\com\sinaapp\msdxblog\apkUtil\entity\ApkInfo.class
     文件        1204  2016-12-13 15:58  ReadApp\build\classes\com\sinaapp\msdxblog\apkUtil\entity\ImpliedFeature.class
     目录           0  2016-12-13 15:58  ReadApp\build\classes\com\sinaapp\msdxblog\apkUtil\utils\
     文件        6273  2016-12-19 15:48  ReadApp\build\classes\com\sinaapp\msdxblog\apkUtil\utils\ApkUtil.class
     文件        3080  2016-12-13 15:58  ReadApp\build\classes\com\sinaapp\msdxblog\apkUtil\utils\IconUtil.class
     文件        4490  2016-12-19 11:25  ReadApp\build\classes\com\sinaapp\msdxblog\apkUtil\utils\IpaUtil.class
     目录           0  2016-12-13 15:58  ReadApp\src\
     目录           0  2016-10-26 19:07  ReadApp\src\com\
     目录           0  2016-10-26 17:37  ReadApp\src\com\app\
     文件        3623  2016-12-19 11:25  ReadApp\src\com\app\ReadAppUtil.java
     目录           0  2016-10-26 19:07  ReadApp\src\com\sinaapp\
............此处省略74个文件信息

评论

共有 条评论