API DOCUMENTATION

Apklyze also provides an api for getting the result of an analysis for a sha 256, or launching it if it has not been done yet. The url for the request : http://androzoo.uni.lu/apklyze/api/v1/
An example of python script could be :

import requests

post_sha_url = "http://androzoo.uni.lu/apklyze/api/v1/sha/"
post_apk_url = "http://androzoo.uni.lu/apklyze/api/v1/apk/"
get_status_url = "http://androzoo.uni.lu/apklyze/api/v1/status"
get_results_url = "http://androzoo.uni.lu/apklyze/api/v1/results"

sha = "example_of_sha256"
apk = open("path/example.apk", "rb")

post_sha_response = requests.post(post_sha_url, data={"sha256": sha})
post_apk_response = requests.post(post_apk_url, files={"uploaded_file": apk})
get_status_response = requests.get('/'.join((get_status_url, sha)))
get_results_response = requests.get('/'.join((get_results_url, sha)))

  

Then you get the json by doing, for example :


json = post_sha_response.json()
  

For the /api/v1/sha/ or /api/v1/apk/ url, you will get a json with the api status link and the api results link (that you can use later).
An example of response could be :


{'results_link': 'http://androzoo.uni.lu/apklyze/api/v1/results/example_of_sha',
'status_link': 'http://androzoo.uni.lu/apklyze/api/v1/status/example_of_sha256'}
  

For the /api/v1/status url, you just get the status of each analyze for the current sha 256. It can be "ok", "PENDING", "FAILURE" or "not done".


{'apkinfos': 'PENDING', 'permissions': 'ok'}
  

For the /api/v1/results url, the response's json will contain one object for each type of analysis.
An example of response where the apkinfos analysis is pending and the permissions are already available :


{'apkinfos': {'state': 'PENDING'}, 'permissions': {'access_network_state':
'safe', 'change_network_state': 'safe', 'restart_packages': 'safe',
'mount_unmount_filesystems': 'safe', 'system_alert_window': 'safe',
'access_wifi_state': 'safe', 'access_coarse_location': 'safe',
'change_wifi_state': 'safe', 'access_location_extra_commands': 'safe',
'receive_user_present': 'unidentified', 'read_external_storage': 'safe',
'read_media_storage': 'unidentified', 'vibrate': 'safe', 'camera':
'safe', 'internet': 'safe', 'jpush_message': 'unidentified', 'wake_lock':
'safe', 'access_coarse_updates': 'unidentified', 'write_media_storage':
'unidentified', 'write_settings': 'safe', 'get_tasks': 'safe',
'manage_accounts': 'unidentified', 'nfc': 'safe',
'write_external_storage': 'safe', 'call_phone': 'safe',
'receive_boot_completed': 'safe', 'get_accounts': 'safe',
'access_fine_location': 'safe', 'read_phone_state': 'safe'}}