Android applications state
来源:互联网 发布:三知四会四个能力 编辑:程序博客网 时间:2024/04/29 11:56
String pkgName = getPackageName(); boolean isBuildIn = false; boolean isSigned = false; boolean isDownload = false; try { PackageInfo pkgInfo = mPm.getPackageInfo(pkgName, PackageManager.GET_SIGNATURES); isBuildIn = (pkgInfo.applicationInfo.flags & android.content.pm.ApplicationInfo.FLAG_SYSTEM) != 0; isDownload = (appInfo.flags & ApplicationInfo.DOWNLOADED_FLAG) != 0; if (isBuildIn) { // cannot be removed, disable only PackageInfo sys = mPm.getPackageInfo("android", PackageManager.GET_SIGNATURES); Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); intent.setPackage(pkgName); List<ResolveInfo> homes = mPm.queryIntentActivities(intent, 0); isSigned = (homes != null && homes.size() > 0) || (pkgInfo != null && pkgInfo.signatures != null && sys.signatures[0] .equals(pkgInfo.signatures[0])); } } catch (NameNotFoundException e) { }
isDownload 是指這個APK是不是下載的
isBuildIn 指的是這個APK是不是預載到image裡的
isSigned 指的是這個APK是否跟 system 使用同一個簽名檔
- Android applications state
- State Threads Library for Internet Applications
- Android Signing your Applications
- Debugging android applications
- Debugging Android native applications
- ANR in Android Applications
- android-Making Applications Accessible
- Exploiting Debuggable Android Applications
- android-Making Applications Accessible
- android wifi state and wifi ap state
- android获取短信state
- Android State List
- Android State List
- Android之drawable state
- Android Custom state
- android drawable state
- android SIM state
- Android Wifi State保存
- 揭开函数适配器的面纱,编写自己的函数适配器-------小试牛刀
- Ubuntu下编译glib
- 关于Qt-json解析器
- Log4j与common-logging
- 10.2.4修改游标数据
- Android applications state
- 浅析C++继承与多态
- 外企面试
- TCP/IP面试题(一)
- Java定时器Web(转)
- memcached的过期时间限制和存储限制
- :WindowsForm,控制台与sql server与数据库的链 和 sql server 的一些基本语法
- 队列
- 网络协议