示例#1
0
    def get_apk_sub_path(self, apk):
        '''
        Returns the sub path structure for the `apk`.

        The structure is:
        ...
        |-> package
          |-> version
            |-> sha256

        Parameters
        ----------
        apk: Apk

        Returns
        -------
        str: path

        Raises
        ------
        CouldNotOpenApk
            If the APK could no be opened
        '''
        package = apk.package_name
        version_name = apk.version_name
        # if hash caluclated from file, can raise CouldNotOpenApk
        sha256 = apk.hash
        return StorageUtil.get_apk_path(package, version_name, sha256)
示例#2
0
    def get_apk_res_path_all_args(self, package_name, version_name, _hash):
        '''
        Returns the path structure for result storage.

        Parameters
        ----------
        package_name : str
            Package name of the apk.
            Unique apk identifier (at least in the store)
        version_name : str
            Version name
        _hash : str
            The hash of the apk.

        Returns
        -------
        str: path
        '''
        return join(self.store_root_dir, self.APK_RES_DIRNAME, StorageUtil.get_apk_path(package_name, version_name, _hash))