def list_packages(self, filter_list: Optional[List[str]] = None) -> List[str]:
        """
        Args:
            filter_list (List[str]): package filter
                -f: See associated file.
                -d: Filter to only show disabled packages.
                -e: Filter to only show enabled packages.
                -s: Filter to only show system packages.
                -3: Filter to only show third-party packages.
                -i: See the installer for the packages.
                -u: Include uninstalled packages.
                --user user_id: The user space to query.
        Returns:
            list of package names
        """
        result = []
        cmd = ["pm", "list", "packages"]
        if filter_list:
            cmd.extend(filter_list)
        output = self.shell(cmd)
        for m in re.finditer(r"^package:([^\s]+)\r?$", output, re.M):
            result.append(m.group(1))
        return list(sorted(result))

        Args:
            filter_list (List[str]): package filter
                -f: See associated file.
                -d: Filter to only show disabled packages.
                -e: Filter to only show enabled packages.
                -s: Filter to only show system packages.
                -3: Filter to only show third-party packages.
                -i: See the installer for the packages.
                -u: Include uninstalled packages.
                --user user_id: The user space to query.
        Returns:
            list of package names
        
adbutils/shell.py