Java Code Examples for android.content.pm.ApplicationInfo#FLAG_UPDATED_SYSTEM_APP
The following examples show how to use
android.content.pm.ApplicationInfo#FLAG_UPDATED_SYSTEM_APP .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RedClock.java From AppTroy with Apache License 2.0 | 6 votes |
@Override public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable { if (loadPackageParam == null || (loadPackageParam.appInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0) return; Log.d("cc", "loaded app " + loadPackageParam.packageName); if (loadPackageParam.isFirstApplication && !DUMPAPK.equals(loadPackageParam.packageName)){ Log.d("cc", "the package " + loadPackageParam.packageName + " has hooked"); Log.d("cc", "the target pid is " + android.os.Process.myPid()); PackageMetaInfo info = PackageMetaInfo.fromXposed(loadPackageParam); ModuleContext.getInstance().start(info); ApiMonitorHookManager.Default().startMonitor(); } hookDebug(); antiDebug(); }
Example 2
Source File: ReverseXposedModule.java From ZjDroid with Apache License 2.0 | 6 votes |
@Override public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable { // TODO Auto-generated method stub if(lpparam.appInfo == null || (lpparam.appInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) !=0){ return; }else if(lpparam.isFirstApplication && !ZJDROID_PACKAGENAME.equals(lpparam.packageName)){ Logger.PACKAGENAME = lpparam.packageName; Logger.log("the package = "+lpparam.packageName +" has hook"); Logger.log("the app target id = "+android.os.Process.myPid()); PackageMetaInfo pminfo = PackageMetaInfo.fromXposed(lpparam); ModuleContext.getInstance().initModuleContext(pminfo); DexFileInfoCollecter.getInstance().start(); LuaScriptInvoker.getInstance().start(); ApiMonitorHookManager.getInstance().startMonitor(); }else{ } }
Example 3
Source File: StatsUtil.java From Trebuchet with GNU General Public License v3.0 | 6 votes |
/** * Checks if the stats package is installed * * @param context {@link android.content.Context} * @return {@link Boolean {@link Boolean {@link Boolean {@link Boolean}}}} */ private static boolean isStatsPackageInstalledAndSystemApp(Context context) throws IllegalArgumentException { if (context == null) { throw new IllegalArgumentException("'context' cannot be null!"); } try { PackageInfo pi = context.getPackageManager().getPackageInfo(STATS_PACKAGE, 0); boolean isSystemApp = (pi.applicationInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0; return pi.applicationInfo.enabled && isSystemApp; } catch (PackageManager.NameNotFoundException e) { Log.e(TAG, "stats not found!"); return false; } }
Example 4
Source File: AppsListDBInitializer.java From notSABS with MIT License | 6 votes |
public void fillPackageDb(PackageManager packageManager) { List<ApplicationInfo> applicationsInfo = packageManager.getInstalledApplications(PackageManager.GET_META_DATA); List<AppInfo> appsInfo = new ArrayList<>(); long id = 0; for (ApplicationInfo applicationInfo : applicationsInfo) { String pckg = App.get().getApplicationContext().getPackageName(); if (applicationInfo.packageName.equals(pckg)) continue; AppInfo appInfo = new AppInfo(); appInfo.id = id++; appInfo.appName = packageManager.getApplicationLabel(applicationInfo).toString(); appInfo.packageName = applicationInfo.packageName; appInfo.disabled = !appPolicy.getApplicationStateEnabled(appInfo.packageName); int mask = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP; appInfo.system = (applicationInfo.flags & mask) != 0; try { appInfo.installTime = packageManager.getPackageInfo(applicationInfo.packageName, 0).firstInstallTime; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); appInfo.installTime = 0; } appsInfo.add(appInfo); } appDatabase.applicationInfoDao().insertAll(appsInfo); }
Example 5
Source File: MainActivity.java From AppFloater with GNU General Public License v2.0 | 5 votes |
private List<String> getAppList() { PackageManager pm = getPackageManager(); // List<PackageInfo> appList = pm.getInstalledPackages(PackageManager.GET_ACTIVITIES); List<ApplicationInfo> appList = pm.getInstalledApplications(PackageManager.GET_META_DATA); List list = new ArrayList(); for(ApplicationInfo item : appList) { if((item.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) == 1 || (item.flags & ApplicationInfo.FLAG_SYSTEM) == 0) //list.add(pm.getApplicationLabel(item)); list.add(item.packageName); } return list; }
Example 6
Source File: PathUtils.java From android-chromium with BSD 2-Clause "Simplified" License | 5 votes |
/** * @return the path to native libraries. */ @SuppressWarnings("unused") @CalledByNative private static String getNativeLibraryDirectory(Context appContext) { ApplicationInfo ai = appContext.getApplicationInfo(); if ((ai.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0 || (ai.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { return ai.nativeLibraryDir; } return "/system/lib/"; }
Example 7
Source File: Util.java From kcanotify with GNU General Public License v3.0 | 5 votes |
public static boolean isSystem(String packageName, Context context) { try { PackageManager pm = context.getPackageManager(); PackageInfo info = pm.getPackageInfo(packageName, 0); return ((info.applicationInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0); /* PackageInfo pkg = pm.getPackageInfo(packageName, PackageManager.GET_SIGNATURES); PackageInfo sys = pm.getPackageInfo("android", PackageManager.GET_SIGNATURES); return (pkg != null && pkg.signatures != null && pkg.signatures.length > 0 && sys.signatures.length > 0 && sys.signatures[0].equals(pkg.signatures[0])); */ } catch (PackageManager.NameNotFoundException ignore) { return false; } }
Example 8
Source File: PathUtils.java From cronet with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * @return the path to native libraries. */ @SuppressWarnings("unused") @CalledByNative private static String getNativeLibraryDirectory() { ApplicationInfo ai = ContextUtils.getApplicationContext().getApplicationInfo(); if ((ai.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0 || (ai.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { return ai.nativeLibraryDir; } return "/system/lib/"; }
Example 9
Source File: AppsListDBInitializer.java From SABS with MIT License | 5 votes |
public AppInfo generateAppInfo(PackageManager packageManager, String packageName) { AppInfo appInfo = new AppInfo(); try { ApplicationInfo applicationInfo = packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA); appInfo.id = appDatabase.applicationInfoDao().getMaxId() + 1; appInfo.packageName = packageName; appInfo.appName = packageManager.getApplicationLabel(applicationInfo).toString(); int mask = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP; appInfo.system = (applicationInfo.flags & mask) != 0; appInfo.installTime = packageManager.getPackageInfo(packageName, 0).firstInstallTime; } catch (Exception e) { e.printStackTrace(); } return appInfo; }
Example 10
Source File: PathUtils.java From 365browser with Apache License 2.0 | 5 votes |
/** * @return the path to native libraries. */ @SuppressWarnings("unused") @CalledByNative private static String getNativeLibraryDirectory() { ApplicationInfo ai = ContextUtils.getApplicationContext().getApplicationInfo(); if ((ai.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0 || (ai.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { return ai.nativeLibraryDir; } return "/system/lib/"; }
Example 11
Source File: AppsListDBInitializer.java From notSABS with MIT License | 5 votes |
public AppInfo generateAppInfo(PackageManager packageManager, String packageName) { AppInfo appInfo = new AppInfo(); try { ApplicationInfo applicationInfo = packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA); appInfo.id = appDatabase.applicationInfoDao().getMaxId() + 1; appInfo.packageName = packageName; appInfo.appName = packageManager.getApplicationLabel(applicationInfo).toString(); int mask = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP; appInfo.system = (applicationInfo.flags & mask) != 0; appInfo.installTime = packageManager.getPackageInfo(packageName, 0).firstInstallTime; } catch (Exception e) { e.printStackTrace(); } return appInfo; }
Example 12
Source File: AppUtils.java From NetKnight with Apache License 2.0 | 5 votes |
public static boolean isSystem(String packageName, Context context) { try { PackageManager pm = context.getPackageManager(); PackageInfo info = pm.getPackageInfo(packageName, 0); return ((info.applicationInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0); /* PackageInfo pkg = pm.getPackageInfo(packageName, PackageManager.GET_SIGNATURES); PackageInfo sys = pm.getPackageInfo("android", PackageManager.GET_SIGNATURES); return (pkg != null && pkg.signatures != null && pkg.signatures.length > 0 && sys.signatures.length > 0 && sys.signatures[0].equals(pkg.signatures[0])); */ } catch (PackageManager.NameNotFoundException ignore) { return false; } }
Example 13
Source File: BlacklistActivity.java From HeadsUp with GNU General Public License v2.0 | 5 votes |
/** * Fills header list with a list of installed apps. */ private void buildHeaderList(List<Header> headers, boolean showSystemApps) { String fragmentName = BlacklistAppFragment.class.getCanonicalName(); int id = 1; PackageManager pm = getPackageManager(); List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA); for (ApplicationInfo app : packages) { int systemFlag = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP; int system = MathUtils.bool((app.flags & systemFlag) != 0); if (system == 1 && !showSystemApps) { continue; } Header header = new Header(); header.fragment = fragmentName; header.title = app.loadLabel(pm); // TODO: This is a huge operation header.summary = app.packageName; header.id = system | id++ << 1; // Store if system app to id // Add package name for the fragment Bundle args = new Bundle(); args.putString(BlacklistAppFragment.ARGS_PACKAGE_NAME, app.packageName); header.fragmentArguments = args; headers.add(header); } // Sort by app name Collections.sort(headers, new Comparator<Header>() { @Override public int compare(Header header1, Header header2) { String title1 = header1.title.toString(); String title2 = header2.title.toString(); return title1.compareToIgnoreCase(title2); } }); }
Example 14
Source File: SoLoader.java From SoLoader with Apache License 2.0 | 5 votes |
private static boolean checkIfSystemApp(Context context, int flags) { if ((flags & SOLOADER_DONT_TREAT_AS_SYSTEMAPP) != 0) { return false; } return (context != null) && (context.getApplicationInfo().flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0; }
Example 15
Source File: PathUtils.java From android-chromium with BSD 2-Clause "Simplified" License | 5 votes |
/** * @return the path to native libraries. */ @SuppressWarnings("unused") @CalledByNative private static String getNativeLibraryDirectory(Context appContext) { ApplicationInfo ai = appContext.getApplicationInfo(); if ((ai.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0 || (ai.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { return ai.nativeLibraryDir; } return "/system/lib/"; }
Example 16
Source File: Util.java From tracker-control-android with GNU General Public License v3.0 | 5 votes |
public static boolean isSystem(String packageName, Context context) { try { PackageManager pm = context.getPackageManager(); PackageInfo info = pm.getPackageInfo(packageName, 0); return ((info.applicationInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0); /* PackageInfo pkg = pm.getPackageInfo(packageName, PackageManager.GET_SIGNATURES); PackageInfo sys = pm.getPackageInfo("android", PackageManager.GET_SIGNATURES); return (pkg != null && pkg.signatures != null && pkg.signatures.length > 0 && sys.signatures.length > 0 && sys.signatures[0].equals(pkg.signatures[0])); */ } catch (PackageManager.NameNotFoundException ignore) { return false; } }
Example 17
Source File: AppsProvider.java From FireFiles with Apache License 2.0 | 4 votes |
private static boolean isAppUseful(ApplicationInfo appInfo) { return appInfo.flags != 0 && ((appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0 || (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0); }
Example 18
Source File: AppsProvider.java From FireFiles with Apache License 2.0 | 4 votes |
private static boolean isAppUseful(ApplicationInfo appInfo) { return appInfo.flags != 0 && ((appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0 || (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0); }
Example 19
Source File: AppsProvider.java From FireFiles with Apache License 2.0 | 4 votes |
private static boolean isSystemApp(ApplicationInfo appInfo){ return appInfo.flags != 0 && (appInfo.flags & (ApplicationInfo.FLAG_UPDATED_SYSTEM_APP | ApplicationInfo.FLAG_SYSTEM)) > 0; }
Example 20
Source File: PackageSetting.java From android_9.0.0_r45 with Apache License 2.0 | 4 votes |
public boolean isUpdatedSystem() { return (pkgFlags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0; }