/** * Access to APK basic information * @param apkpath * @return * @throws java.io.IOException * *
String osname = System.getproperty ("Os.name"). toUpperCase (); String appName = Osname.indexof ("LINUX")!=-1? "
Aapt/aapt ":" Aapt/aapt.exe ";
map<string,string> map = new hashmap<string, string> (); String command = Thread.CurrentThread (). Getcontextclassloader (). GetResource (AppName). GetFile () + "Dump badging d://
XXX.APK ";
Process process= runtime.getruntime (). exec (command);
BufferedReader reader= New BufferedReader (New InputStreamReader (Process.getinputstream (), "UTF-8"));
String Line;
StringBuilder result = new StringBuilder (100);
while ((Line=reader.readline ())!=null) {result.append (line+ "\ n");
} System.out.println (result.tostring () + "\ n \ nthe"); String reg = "\\s (. +?)
[=|:]'(.*?)'"; Matcher MatcheR = Pattern.compile (reg). Matcher (Result.tostring ());
while (Matcher.find ()) {System.out.println (Matcher.group (1) + "" +matcher.group (2));
String key = Matcher.group (1);
if (map.get (key) = = null) {Map.put (Key,matcher.group (2)); }
}
AAPT Download Address