Source

APKinspector / APKInfo.py

The default branch has multiple heads

import sys

if sys.path[0] == "":
	sys.path.append(sys.path[1]+"/androguard/")
	PATH_INSTALL = sys.path[1]+"/androguard"
else:
	sys.path.append(sys.path[0]+"/androguard/")
	PATH_INSTALL = sys.path[0]+"/androguard"

sys.path.append(PATH_INSTALL + "./")
sys.path.append(PATH_INSTALL + "/core")
sys.path.append(PATH_INSTALL + "/core/bytecodes")
sys.path.append(PATH_INSTALL + "/core/predicates")
sys.path.append(PATH_INSTALL + "/core/analysis")
sys.path.append(PATH_INSTALL + "/core/vm")
sys.path.append(PATH_INSTALL + "/core/wm")
sys.path.append(PATH_INSTALL + "/core/protection")
sys.path.append(PATH_INSTALL + "/classification")
 
import androguard, analysis, androlyze
import bytecode


def androlyzeAPK(filename):
    a = androlyze.APK(filename)
    return a

def is_valid_APK(a):
    return a.is_valid_APK()

def get_filename(a):
    return str(a.get_filename())
    
def get_versionCode(a):
    return str(a.get_androidversion_code())
    
def get_versionName(a):
    return str(a.get_androidversion_name())

def get_package(a):
    return str(a.get_package())

def get_receivers(a):
    retStr = ""
    receivers = a.get_receivers()
    for i in receivers:
        retStr += i +"\n"
    if retStr != "":
        retStr = retStr[:-1]
    return (retStr, len(receivers))
    
def get_services(a):
    retStr = ""
    services = a.get_services()
    for i in services:
        retStr += i +"\n"
    if retStr != "":
        retStr = retStr[:-1]
    return (retStr, len(services))

def get_permissions(a):
    retStr = ""
    permissions = a.get_permissions()
    for i in permissions:
        retStr += i +"\n"
    if retStr != "":
        retStr = retStr[:-1]
    return (retStr, len(permissions))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.