Ejemplo n.º 1
0
def analyze(app_path, data = []):
	app, d, dx = AnalyzeAPK(app_path)
	#app = APK(os.path.join(folder, app_path))
	app_perms = set(app.get_permissions())
	for perm in ALL_PERMISSIONS:
		if perm in app_perms:
			data.append(True)
		else:
			data.append(False)
	extcount = dict()
	for f in app.get_files():
		ext = os.path.splitext(f)[1]
		if ext in extcount:
			extcount[ext] += 1
		else:
			extcount[ext] = 1
	for ext in FILE_EXTENSIONS:
		if ext in extcount:
			data.append(extcount[ext])
		else:
			data.append(0)

	for call in API_CALLS:
		data.append(len(dx.tainted_packages.search_methods(".", call, ".")))

	return data + [len(app.get_file("classes.dex")), len(app.get_package()), len(app.get_files()), len(app.get_activities()), len(app.get_services()), len(app.get_providers()), len(dx.tainted_packages.search_crypto_packages()), len(dx.tainted_packages.search_telephony_packages()), len(dx.tainted_packages.search_net_packages()), is_dyn_code(dx), is_native_code(dx), is_reflection_code(dx), len(d.get_classes()), len(d.get_methods()), len(d.get_fields())]
Ejemplo n.º 2
0
 def process_apk(self, file_name):
     print('%s processing %s ' % (self.name, file_name))
     apk, dex, dx = AnalyzeAPK(file_name)
     print apk.get_package()