You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**
* Check if any package in the list is installed
* @param packages - list of packages to search for
* @return true if any of the packages are installed
*/
private boolean isAnyPackageFromListInstalled(List<String> packages){
boolean result = false;
PackageManager pm = mContext.getPackageManager();
for (String packageName : packages) {
try {
// Root app detected
pm.getPackageInfo(packageName, 0);
QLog.e(packageName + " ROOT management app detected!");
result = true;
} catch (PackageManager.NameNotFoundException e) {
// Exception thrown, package is not installed into the system
}
}
return result;
}
pm.getPackageInfo(packageName, 0); this method may be not allowed to be called frequently to some other policies (because it's in a for loop).
Myabe cache an installed app list in RootBeer class, and do some local List operations to check if any package is installed, this would be better?
Thanks!
The text was updated successfully, but these errors were encountered:
KiBa1215
changed the title
Frequently request app installed list in RootBeer.isRooted()
Frequently getPackageInfo in RootBeer.isRooted()Oct 31, 2023
In every detect method will finally call
pm.getPackageInfo(packageName, 0);
this method may be not allowed to be called frequently to some other policies (because it's in a for loop).Myabe cache an installed app list in RootBeer class, and do some local List operations to check if any package is installed, this would be better?
Thanks!
The text was updated successfully, but these errors were encountered: