Java gets the two classes of the package name core of the APK installer: respackage
Apkdecoder
Package com.temobi.util; Import Java.io.file;import java.util.set;import brut.androlib.androlibexception;import brut.androlib.ApkDecoder; Import Brut.androlib.res.data.ResPackage; public class Apkutil {public static string Getapkpagename (String apkpath) {Apkdecoder d = new Apkdecoder ();d. Setapkfile (NE W File (Apkpath)); try {set P = d.getrestable (). Listmainpackages (); for (Respackage r:p) {//Here the Set maximum is equal to 1return r.getname () ;}} catch (Androlibexception e) {e.printstacktrace ();} return null;} public static void Main (string[] args) {System.err.println ("The APK Packname is:" +apkutil.getapkpagename ("d:/ Ucbrowser_v8.7.0.187_android_pf145_ (Build12101613). apk "));}}
Java Gets the package name of the APK installer