def __init__(self, dvclass, vma): name = dvclass.get_name() if name.find('/') > 0: pckg, name = name.rsplit('/', 1) else: pckg, name = '', name self.package = pckg[1:].replace('/', '.') self.name = name[:-1] self.vma = vma self.methods = dvclass.get_methods() self.fields = dvclass.get_fields() self.code = [] self.inner = False access = dvclass.get_access_flags() # If interface we remove the class and abstract keywords if 0x200 & access: prototype = '%s %s' if access & 0x400: access -= 0x400 else: prototype = '%s class %s' self.access = util.get_access_class(access) self.prototype = prototype % (' '.join(self.access), self.name) self.interfaces = dvclass.get_interfaces() self.superclass = dvclass.get_superclassname() self.thisclass = dvclass.get_name() logger.debug('Class : %s', self.name) logger.debug('Methods added :') for meth in self.methods: logger.debug('%s (%s, %s)', meth.get_method_idx(), self.name, meth.name) logger.debug('') self.adi = dvclass.annotations_directory_item if self.adi != None: field_idxes = [x.get_field_idx() for x in self.fields] self.class_annotations = get_annotations( dvclass.CM, [self.adi.get_class_annotations_off()]) self.field_annotations = { x.get_field_idx(): get_annotations(dvclass.CM, [x.get_annotations_off()]) for x in self.adi.get_field_annotations() if x.get_field_idx() in field_idxes } else: self.class_annotations = [] self.field_annotations = {}
def __init__(self, dvclass, vma): """ :param androguard.core.bytecodes.dvm.ClassDefItem dvclass: the class item :param androguard.core.analysis.analysis.Analysis vma: an Analysis object """ name = dvclass.get_name() if name.find('/') > 0: pckg, name = name.rsplit('/', 1) else: pckg, name = '', name self.package = pckg[1:].replace('/', '.') self.name = name[:-1] self.vma = vma self.methods = dvclass.get_methods() self.fields = dvclass.get_fields() self.code = [] self.inner = False access = dvclass.get_access_flags() # If interface we remove the class and abstract keywords if 0x200 & access: prototype = '%s %s' if access & 0x400: access -= 0x400 else: prototype = '%s class %s' self.access = util.get_access_class(access) self.prototype = prototype % (' '.join(self.access), self.name) self.interfaces = dvclass.get_interfaces() self.superclass = dvclass.get_superclassname() self.thisclass = dvclass.get_name() logger.debug('Class : %s', self.name) logger.debug('Methods added :') for meth in self.methods: logger.debug('%s (%s, %s)', meth.get_method_idx(), self.name, meth.name) logger.debug('')
def __init__(self, dvclass, vma): """ :param androguard.core.bytecodes.dvm.ClassDefItem dvclass: the class item :param androguard.core.analysis.analysis.Analysis vma: an Analysis object """ name = dvclass.get_name() if name.find('/') > 0: pckg, name = name.rsplit('/', 1) else: pckg, name = '', name self.package = pckg[1:].replace('/', '.') self.name = name[:-1] self.vma = vma self.methods = dvclass.get_methods() self.fields = dvclass.get_fields() self.code = [] self.inner = False access = dvclass.get_access_flags() # If interface we remove the class and abstract keywords if 0x200 & access: prototype = '%s %s' if access & 0x400: access -= 0x400 else: prototype = '%s class %s' self.access = util.get_access_class(access) self.prototype = prototype % (' '.join(self.access), self.name) self.interfaces = dvclass.get_interfaces() self.superclass = dvclass.get_superclassname() self.thisclass = dvclass.get_name() logger.debug('Class : %s', self.name) logger.debug('Methods added :') for meth in self.methods: logger.debug('%s (%s, %s)', meth.get_method_idx(), self.name, meth.name) logger.debug('')
def __init__(self, dvclass, vma): name = dvclass.get_name() if name.find('/') > 0: pckg, name = name.rsplit('/', 1) else: pckg, name = '', name self.package = pckg[1:].replace('/', '.') self.name = name[:-1] self.vma = vma self.methods = dvclass.get_methods() self.fields = dvclass.get_fields() self.subclasses = {} self.code = [] self.inner = False access = dvclass.get_access_flags() # If interface we remove the class and abstract keywords if 0x200 & access: prototype = '%s %s' if access & 0x400: access -= 0x400 else: prototype = '%s class %s' self.access = util.get_access_class(access) self.prototype = prototype % (' '.join(self.access), self.name) self.interfaces = dvclass.get_interfaces() self.superclass = dvclass.get_superclassname() self.thisclass = dvclass.get_name() logger.info('Class : %s', self.name) logger.info('Methods added :') for meth in self.methods: logger.info('%s (%s, %s)', meth.get_method_idx(), self.name, meth.name) logger.info('')
def __init__(self, dvclass, vma): name = dvclass.get_name() if name.find('/') > 0: pckg, name = name.rsplit('/', 1) else: pckg, name = '', name self.package = pckg[1:].replace('/', '.') self.name = name[:-1] self.vma = vma self.methods = dvclass.get_methods() self.fields = dvclass.get_fields() self.subclasses = {} self.code = [] self.inner = False access = dvclass.get_access_flags() # If interface we remove the class and abstract keywords if 0x200 & access: prototype = '%s %s' if access & 0x400: access -= 0x400 else: prototype = '%s class %s' self.access = util.get_access_class(access) self.prototype = prototype % (' '.join(self.access), self.name) self.interfaces = dvclass.get_interfaces() self.superclass = dvclass.get_superclassname() self.thisclass = dvclass.get_name() logger.info('Class : %s', self.name) logger.info('Methods added :') for meth in self.methods: logger.info('%s (%s, %s)', meth.get_method_idx(), self.name, meth.name) logger.info('')