apk檔案解析,學習筆記

2022-09-01 11:30:14 字數 1500 閱讀 6659

android應用程式包檔案(apk) 是一種android作業系統上的應用程式安裝檔案格式,其英文全稱為 

。主要方法如下

using icsharpcode.sharpziplib.zip;

public static dictionarygetpackageinfo(string path);

if (string.isnullorwhitespace(path))

string str = "";

if (path.lastindexof(".") >= 0)

if (".apk".equals(str, stringcomparison.ordinalignorecase))

else if (list.contains(item))}}

zip.close();

}catch (exception exception)

}return returnmap;

}private static void getsig(zipinputstream zip, zipentry zipentry, dictionaryreturnmap)

stream.seek(0l, seekorigin.begin);

string str = "";

x509certificate certificate = new x509certificate(stream.getbuffer());

returnmap["證書有效期"] = certificate.geteffectivedatestring();

returnmap["證書過期時間"] = certificate.getexpirationdatestring();

returnmap["證書hash"] = certificate.getcerthashstring();

returnmap["證書md5"] = bitconverter.tostring(md5.create().computehash(certificate.getrawcertdata())).replace('-', ':');

returnmap["publickey"] = certificate.getpublickeystring();

rawcertdata = certificate.getrawcertdata();

byte buffer2 = sha1.create().computehash(certificate.getrawcertdata());

for (int i = 0; i < buffer2.length; i++)

stream.close();

returnmap["簽名(sig)"] = str;

}apk檔案上傳大小限制,web.config檔案新增如下:

1073741824" executiontimeout="3600" />

1073741824">

apk檔案結構解析一

apk檔案用winrar壓縮軟體解壓縮後,如下圖所示 主要是三個檔案 lib meta inf res 和三個資料夾 androidmanifest.xml classes.dex resources.arsc 用工具展開可以看到如下所示的檔案結構 資料夾中的內容可能不一致,這裡我舉得例子是乙個jn...

關於解析apk檔案的詳細步驟《1》

private processbuilder mbuilder private static final string split regex private static final string feature split regex aapt所在的目錄。比如你可以放在lib下 private ...

關於解析apk檔案的詳細步驟《2》

如需解析檔案簽名,建議用md5工具類 public class md5util 十六進製制下數字到字元的對映陣列 private final static string hexdigits md5加密演算法 param originstring return public static string...