Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list no longer lists 3rd party packages, but all packages #46

Closed
cryptax opened this issue Jul 7, 2023 · 3 comments
Closed

list no longer lists 3rd party packages, but all packages #46

cryptax opened this issue Jul 7, 2023 · 3 comments

Comments

@cryptax
Copy link

cryptax commented Jul 7, 2023

Medusa used to list only 3rd party packages, which IMHO was a good idea because you don't have all the standard Android processes. This has been modified and now we get all packages :( To get only 3rd party packages, you should modify this line with pm list packages -3.

    def refreshPackages(self):
        self.packages = []
        for line in os.popen('adb -s {} shell pm list packages'.format(self.device.id)):
            self.packages.append(line.split(':')[1].strip('\n'))

Note the code documentation always talks about "third party packages" which is not consistent with doing pm list packages without the -3:

                        - run -n     [package num]  : Initiate a Frida session and spawn the 3rd party package 
...
                        - list                      : List 3rd party packages
...                        
    def do_list(self,line) -> None:
        """
        List installed 3rd party applications of the android device 
        """
...

However, maybe some users want all packages. Then, it would be helpful to have 2 different commands, perhaps list and list3. Beware that run -n <NUM> runs a package based on its listed number, so the number has to be the same with list or list3 and not a mere counter.

@Ch0pin
Copy link
Owner

Ch0pin commented Jul 7, 2023

This changed due to a request, but it would be a good idea to filter out the packages. I'll add an option.

@Ch0pin
Copy link
Owner

Ch0pin commented Jul 10, 2023

@cryptax check the new commit and let me know if it works:

        Set the currently working package set / get infor about an installed package
        list [opt]
        Where opt:
            -a: all known packages (but excluding APEXes)
            -s: filter to only show system packages
            -3: filter to only show third party packages
        
        Get info about a package:

        list package_name [path]
        - Use the option path argument to return the application's installation path

        Examples:

        list com.example.app
        list com.example.app path
        list -3

@cryptax
Copy link
Author

cryptax commented Jul 20, 2023

Checked: it works fine thanks!

@cryptax cryptax closed this as completed Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants