Ejemplo n.º 1
0
def cat(args: list = None) -> None:
    """
        Parses a plist on an iOS device and echoes it in a more human
        readable way.

        :param args:
        :return:
    """

    if len(args) <= 0:
        click.secho('Usage: ios plist cat <remote_plist>', bold=True)
        return

    plist = args[0]

    if not os.path.isabs(plist):
        pwd = filemanager.pwd()
        plist = os.path.join(pwd, plist)

    runner = FridaRunner()
    runner.set_hook_with_data(ios_hook('plist/get'), plist=plist)
    runner.run()

    response = runner.get_last_message()

    if not response.is_successful():
        click.secho('Failed to get plist with error: {0}'.format(
            response.error_reason),
                    fg='red')
        return

    click.secho(response.data, bold=True)
Ejemplo n.º 2
0
def cat(args: list = None) -> None:
    """
        Parses a plist on an iOS device and echoes it in a more human
        readable way.

        :param args:
        :return:
    """

    if len(args) <= 0:
        click.secho('Usage: ios plist cat <remote_plist>', bold=True)
        return

    plist = args[0]

    if not os.path.isabs(plist):
        pwd = filemanager.pwd()
        plist = device_state.device_type.path_seperator.join([pwd, plist])

    api = state_connection.get_api()
    plist_data = api.ios_plist_read(plist)

    click.secho(plist_data, bold=True)
Ejemplo n.º 3
0
    def test_returns_current_directory_via_helper_for_ios(self, mock_pwd_ios):
        mock_pwd_ios.return_value = '/foo/bar'
        device_state.device_type = Ios

        self.assertEqual(pwd(), '/foo/bar')
        self.assertTrue(mock_pwd_ios.called)
Ejemplo n.º 4
0
    def test_returns_current_directory_via_helper_for_android(self, mock_pwd_android):
        mock_pwd_android.return_value = '/foo/bar'
        device_state.device_type = Android

        self.assertEqual(pwd(), '/foo/bar')
        self.assertTrue(mock_pwd_android.called)
Ejemplo n.º 5
0
    def test_returns_current_directory_via_helper_when_already_set(self):
        file_manager_state.cwd = '/foo'

        self.assertEqual(pwd(), '/foo')