I want to extract all API calls from an Android application's apk. I have used apktool to get the smali code files from the apk. Manually I can spot some API calls, but I need an automated method. For example, I can see the getNetworkInfo
call in this line of code:
invoke-virtual {p0, v0}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;
I have no experience with smali code and very little with Android application analysis; I only spotted the above API call because I happened to know that "getNetworkInfo" is one. But of course, what I don't want to do is begin with a list of all possible API calls and search for each of them in the smali files one by one.
Is there another indication of an API call? Will invoke-virtual
or invoke-direct
will always mean an API call?