I need to develop an android application to detect malwares.
I am looking to develop this based on permissions used by all the applications installed. Please let me know how to identify the permissions used by other applications
Select Start > Settings > Privacy & security. Select an App permission (for example, Location) then choose which apps can access it.
Go to Settings and find the App Management or Apps section, depending on your phone. If you can't locate it, simply perform a quick search within Settings. Once in App Management, tap on See All Apps or App Settings to see the list of apps installed on your device, excluding the system apps.
Open Settings, go to Privacy, and choose Permission manager. Here, you'll find a list that includes Body sensors, Calendar, Camera, Contacts, Location, Microphone, SMS, Storage, Telephone, and more. Tap any entry to see which apps can access that particular function.
You can get all installed applications permissions like this.
- Get all installed applications
- Iterate over the applications
- Get each application permissions list
- Iterate over the each permission
PackageManager pm = getPackageManager();
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo applicationInfo : packages) {
Log.d("test", "App: " + applicationInfo.name + " Package: " + applicationInfo.packageName);
try {
PackageInfo packageInfo = pm.getPackageInfo(applicationInfo.packageName, PackageManager.GET_PERMISSIONS);
//Get Permissions
String[] requestedPermissions = packageInfo.requestedPermissions;
if(requestedPermissions != null) {
for (int i = 0; i < requestedPermissions.length; i++) {
Log.d("test", requestedPermissions[i]);
}
}
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With