tomliamlynch / androguard

Automatically exported from code.google.com/p/androguard
Apache License 2.0
0 stars 0 forks source link

add get_detailed_permission to VMAnalysis #59

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
   def get_detailed_permissions(self, permissions_needed) :
        """
            @param permissions_needed : a list of restricted permissions to get ([] returns all permissions)

            @rtype : a dictionnary of permissions' paths
        """
        permissions = {}

        permissions.update( self.tainted_packages.get_permissions( permissions_needed ) )
        permissions.update( self.tainted_variables.get_permissions( permissions_needed ) )
        l = {}

        for i in permissions :
            perm = i
            pos = i.rfind(".")

            if pos != -1 :
                perm = i[pos+1:]

            try :
                l[ i ] = DVM_PERMISSIONS["MANIFEST_PERMISSION"][ perm ]
            except KeyError :
                l[ i ] = [ "dangerous", "Unknown permission from android reference", "Unknown permission from android reference" ]

        return l 

Original issue reported on code.google.com by liadalex82@gmail.com on 3 Jul 2012 at 8:58

GoogleCodeExporter commented 8 years ago
You would like to add this in the repository to filter specific permissions ?

Original comment by anthony....@gmail.com on 17 Jul 2012 at 7:32

GoogleCodeExporter commented 8 years ago
I need this method to have a complete detailed list of permissions (manifest + 
implicit used by DVM and not declared in the manifest)

Original comment by liadalex82@gmail.com on 17 Jul 2012 at 12:17