def __init__(self, filename):
        """
            @param filename: specify the path of the file, or raw data
            @param raw: specify (boolean) if the filename is a path or raw data
        """
        self.filename = filename

        self.xml = {}
        self.package = ""
        self.androidversion = {}
        self._permissions = []
        self.valid_apk = False

        with open(filename, "rb") as fd:
            self.__raw = fd.read()

        self.zip = zipfile.ZipFile(filename)

        for i in self.zip.namelist():
            if i == "AndroidManifest.xml":
                self.xml[i] = minidom.parseString(AXMLPrinter(self.zip.read(i)).getBuff())

                self.package = self.xml[i].documentElement.getAttribute("package")
                self.androidversion["Code"] = self.xml[i].documentElement.getAttribute("android:versionCode")
                self.androidversion["Name"] = self.xml[i].documentElement.getAttribute("android:versionName")

                for item in self.xml[i].getElementsByTagName("uses-permission"):
                    self._permissions.append(str(item.getAttribute("android:name")))

                self.valid_apk = True

            @param filename: specify the path of the file, or raw data
            @param raw: specify (boolean) if the filename is a path or raw data
        
airtest/utils/apkparser/apk.py