def __init__(self, callId, clazz, method, argsAndReturnValue): self.callId = callId self.clazz = unicode(clazz) self.method = unicode(method) self.argsAndReturnValue = TypeRefToStr(plistlib.readPlistFromString(argsAndReturnValue.encode('utf-8'))).args # Get the call's group and subgroup self.subgroup = APIGroups.find_subgroup(clazz, method) self.group = APIGroups.find_group(self.subgroup)
def __init__(self, callId, clazz, method, argsAndReturnValue): self.callId = callId self.clazz = clazz self.method = method self.argsAndReturnValue = argsAndReturnValue # Get the call's group and subgroup self.subgroup = APIGroups.find_subgroup(clazz, method) self.group = APIGroups.find_group(self.subgroup)
def __init__(self, title, description, severity, filter): self.title = title self.description = description self.severity = severity self.filter = filter # Figure out the signature's group and subgroup based # on the classes / methods it looks for self.subgroup = APIGroups.find_subgroup_from_filter(filter) self.group = APIGroups.find_group(self.subgroup)
def write_to_directory(self, directory): # Copy the template shutil.copytree('./html', directory) # Copy the DB file # shutil.copy(self.db_filename, directory) # Dump the traced calls self.traceStorage.write_to_JS_file(directory) # Dump the findings self.analyzer.write_to_JS_file(directory) # Dump the API groups APIGroups.write_to_JS_file(directory)
def write_report_to_directory(self, outDir): # Copy the template shutil.copytree(self.TEMPLATE_FOLDER, outDir) # Copy the DB file shutil.copy(self.analyzedDB.dbPath, outDir) # Dump the traced calls with open(os.path.join(outDir, self.TRACED_CALLS_FILE_NAME), 'w') as jsFile: jsFile.write('var tracedCalls = ' + self.analyzedDB.get_traced_calls_as_JSON() + ';') # Dump the findings with open(os.path.join(outDir, self.FINDINGS_FILE_NAME), 'w') as jsFile: jsFile.write( 'var findings = ' + self.analyzedDB.get_findings_as_JSON() + ';') # Dump the API groups with open(os.path.join(outDir, self.API_GROUPS_FILE_NAME), 'w') as jsFile: jsFile.write('var apiGroups = ' + APIGroups.get_groups_as_JSON() + ';')