XPrivacy
XPrivacy copied to clipboard
Allow own package to queryIntentActivities
List of installed packages is leaked someway (probably through list of intent receivers) even when getInstalledApplications and getInstalledPackages are restricted.
This issue is missing important information. https://github.com/M66B/XPrivacy#support
I am missing steps to reproduce, a link to the application used to test and a logcat with XPrivacy logging enabled.
Probably list of packages was retrieved in the following way
private List<String> getApps() {
PackageManager pm;
List<String> apps = new ArrayList<String>();
List queryIntentActivities = pm.queryIntentActivities(new Intent("android.intent.action.MAIN", (Uri)null), 0);
Iterator<ResolveInfo> it = queryIntentActivities.iterator();
while (it.hasNext()) {
String packageName = it.next().activityInfo.packageName;//according the docs there is no such a field in ActivityInfo
/*
invokeinterface java/util/Iterator.next:()Ljava/lang/Object;
checkcast Landroid/content/pm/ResolveInfo;
getfield android/content/pm/ResolveInfo.activityInfo:Landroid/content/pm/ActivityInfo;
getfield android/content/pm/ActivityInfo.packageName:Ljava/lang/String;
*/
if (!apps.contains(packageName)) {
apps.add(packageName);
}
}
return apps;
}
Sorry for the delay, had no time to analyse the app until now.
I will add a (dangerous) restriction for queryIntentActivities, but you'll have to wait at least a week until I have returned home again.
Such restriction already exists, but restricting it can create troubles with app operation. I think that there should be a way to mask identifiers. You can make masking based on crypto, but I think it is overkill here (it won't be an overkill if you have a lot of values to mask, if you decided to to use crypto, use authenticated encryption scheme). So 1 for each package generate a random id 2 use associative container mapping generated id and real package id to each others 3 if app is restricted to get package ids but allowed to call queryIntentActivities, give it masked ids and unmask them in other APIs.
This is too complicated (too slow and will give maintenance headaches). It is better to allow only the own package and filter the rest.
This is too complicated (too slow and will give maintenance headaches).
Why? I don't think that mapping masked id to id and back is slower than hooked call itself.
Even then I don't want to maintain such a feature.
Can't we just use the list of allowed packages for this app when this call is restricted?
That is why I have marked this issue as an enhancement (=feature request).