Android-ElectricSheep-Automator

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    script/electric-sheep-open-app.pl

      Open an app by its exact name or a keyword matching it (uniquely):

      script/electric-sheep-open-app.pl --configfile config/myapp.conf
      --name com.android.settings

      script/electric-sheep-open-app.pl --configfile config/myapp.conf
      --keyword 'clock'

      Note that it constructs a regular expression from escaped user input.

    script/electric-sheep-close-app.pl

      Close an app by its exact name or a keyword matching it (uniquely):

      script/electric-sheep-close-app.pl --configfile config/myapp.conf
      --name com.android.settings

      script/electric-sheep-close-app.pl --configfile config/myapp.conf
      --keyword 'clock'

      Note that it constructs a regular expression from escaped user input.

    script/electric-sheep-dump-ui.pl

      Dump the current screen UI as XML to STDOUT or to a file:

      script/electric-sheep-dump-ui.pl --configfile config/myapp.conf
      --output ui.xml

      Note that it constructs a regular expression from escaped user input.

    script/electric-sheep-dump-current-location.pl

      Dump the GPS / geo-location position for the device from its various
      providers, if enabled.

      script/electric-sheep-dump-current-location.pl --configfile
      config/myapp.conf --output geolocation.json

    script/electric-sheep-emulator-geofix.pl

README.md  view on Meta::CPAN

    `script/electric-sheep-find-installed-apps.pl --configfile config/myapp.conf --device Pixel_2_API_30_x86_ --output myapps.json --fast`

- **`script/electric-sheep-open-app.pl`**

    Open an app by its exact name or a keyword matching it (uniquely):

    `script/electric-sheep-open-app.pl --configfile config/myapp.conf --name com.android.settings`

    `script/electric-sheep-open-app.pl --configfile config/myapp.conf --keyword 'clock'`

    Note that it constructs a regular expression from escaped user input.

- **`script/electric-sheep-close-app.pl`**

    Close an app by its exact name or a keyword matching it (uniquely):

    `script/electric-sheep-close-app.pl --configfile config/myapp.conf --name com.android.settings`

    `script/electric-sheep-close-app.pl --configfile config/myapp.conf --keyword 'clock'`

    Note that it constructs a regular expression from escaped user input.

- **`script/electric-sheep-dump-ui.pl`**

    Dump the current screen UI as XML to STDOUT or to a file:

    `script/electric-sheep-dump-ui.pl --configfile config/myapp.conf --output ui.xml`

    Note that it constructs a regular expression from escaped user input.

- **`script/electric-sheep-dump-current-location.pl`**

    Dump the GPS / geo-location position for the device from its various providers, if enabled.

    `script/electric-sheep-dump-current-location.pl --configfile config/myapp.conf --output geolocation.json`

- **`script/electric-sheep-emulator-geofix.pl`**

    Set the GPS / geo-location position to the specified coordinates.

lib/Android/ElectricSheep/Automator.pm  view on Meta::CPAN

use Android::ElectricSheep::Automator::ADB;
use File::Temp qw/tempfile/;
use Cwd;
use FindBin;
use Time::HiRes qw/usleep/;
use Image::PNG;
use XML::LibXML;
use XML::LibXML::XPathContext;
use Text::ParseWords;

use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator::DeviceProperties;
use Android::ElectricSheep::Automator::AppProperties;
use Android::ElectricSheep::Automator::ScreenLayout;
use Android::ElectricSheep::Automator::XMLParsers;

my $_DEFAULT_CONFIG = <<'EODC';
</* $VERSION = '0.06'; */>
</* comments are allowed */>
</* and <% vars %> and <% verbatim sections %> */>

lib/Android/ElectricSheep/Automator.pm  view on Meta::CPAN



=item B<C<script/electric-sheep-open-app.pl>>

Open an app by its exact name or a keyword matching it (uniquely):

C<< script/electric-sheep-open-app.pl --configfile config/myapp.conf --name com.android.settings >>

C<< script/electric-sheep-open-app.pl --configfile config/myapp.conf --keyword 'clock' >>

Note that it constructs a regular expression from escaped user input.

=item B<C<script/electric-sheep-close-app.pl>>

Close an app by its exact name or a keyword matching it (uniquely):

C<< script/electric-sheep-close-app.pl --configfile config/myapp.conf --name com.android.settings >>

C<< script/electric-sheep-close-app.pl --configfile config/myapp.conf --keyword 'clock' >>

Note that it constructs a regular expression from escaped user input.

=item B<C<script/electric-sheep-dump-ui.pl>>

Dump the current screen UI as XML to STDOUT or to a file:

C<< script/electric-sheep-dump-ui.pl --configfile config/myapp.conf --output ui.xml >>

Note that it constructs a regular expression from escaped user input.

=item B<C<script/electric-sheep-dump-current-location.pl>>

Dump the GPS / geo-location position for the device from its various providers, if enabled.

C<< script/electric-sheep-dump-current-location.pl --configfile config/myapp.conf --output geolocation.json >>

=item B<C<script/electric-sheep-emulator-geofix.pl>>

Set the GPS / geo-location position to the specified coordinates.

lib/Android/ElectricSheep/Automator/AppProperties.pm  view on Meta::CPAN

use strict;
use warnings;

our $VERSION = '0.06';

use Mojo::Log;
use Config::JSON::Enhanced;
use XML::XPath;
use XML::LibXML;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use overload ( '""'  => \&toString );

sub new {
	my $class = $_[0];
	my $params = $_[1] // {};

        my $parent = ( caller(1) )[3] || "N/A";
        my $whoami = ( caller(0) )[3];

lib/Android/ElectricSheep/Automator/DeviceProperties.pm  view on Meta::CPAN

use strict;
use warnings;

our $VERSION = '0.06';

use Mojo::Log;
use Config::JSON::Enhanced;
use XML::XPath;
use XML::LibXML;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use overload ( '""'  => \&toString );

sub new {
	my $class = $_[0];
	my $params = $_[1] // {};

        my $parent = ( caller(1) )[3] || "N/A";
        my $whoami = ( caller(0) )[3];

lib/Android/ElectricSheep/Automator/Plugins/Apps/Base.pm  view on Meta::CPAN

use warnings;

our $VERSION = '0.06';

use Mojo::Log;
use Config::JSON::Enhanced;
use File::Temp qw/tempfile/;
use Cwd;
use FindBin;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator;
use Android::ElectricSheep::Automator::ScreenLayout;
use Android::ElectricSheep::Automator::XMLParsers;

my $_DEFAULT_CONFIG = <<'EODC';
</* comments are allowed */>
</* and <% vars %> and <% verbatim sections %> */>
{
	"Android::ElectricSheep::Automator" : {

lib/Android/ElectricSheep/Automator/Plugins/Apps/Viber.pm  view on Meta::CPAN

package Android::ElectricSheep::Automator::Plugins::Apps::Viber;

use strict;
use warnings;

use parent 'Android::ElectricSheep::Automator::Plugins::Apps::Base';

use Time::HiRes qw/usleep/;
use Encode qw/encode_utf8 decode_utf8/;
use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator::XMLParsers;

sub new {
	my ($class, $params) = @_;
	my $self = $class->SUPER::new({
		%$params,
		'child-class' => $class,
	});
	$self->{'_private'}->{'appname'} = 'com.viber.voip';

lib/Android/ElectricSheep/Automator/ScreenLayout.pm  view on Meta::CPAN

use strict;
use warnings;

our $VERSION = '0.06';

use Mojo::Log;
use Config::JSON::Enhanced;
use XML::XPath;
use XML::LibXML;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use overload ( '""'  => \&toString );

sub new {
	my $class = $_[0];
	my $params = $_[1] // {};

        my $parent = ( caller(1) )[3] || "N/A";
        my $whoami = ( caller(0) )[3];

lib/Android/ElectricSheep/Automator/XMLParsers.pm  view on Meta::CPAN


use 5.006;
use strict;
use warnings;

our $VERSION = '0.06';

use Mojo::Log;
use XML::LibXML;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

# This parser is for parsing UI Automator dump of the screen
# which comes up when you swipe from the bottom up
# which brings all the installed apps, we will find all
# those apps (name+coordinates) and return them as a hash
# keyed on app name.
# e.g. myappname => {'name' => myappname, 'bounds' => [x1,y1,x2,y2]}
# It takes in a UI Automator XML dump either from:
#         a file  : 'xml-filename' => ...
# or from a string: 'xml-string' => ...

script/electric-sheep-dump-current-location.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;

our $VERSION = '0.04';

use lib ('blib/lib');

use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used
my $DEVICE;
my $CONFIGFILE;
my $OUTFILE;

if( ! Getopt::Long::GetOptions(
  'device|d=s' => \$DEVICE,

script/electric-sheep-dump-current-screen-ui.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;

our $VERSION = '0.04';

use lib ('blib/lib');

use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used
my $DEVICE;
my $CONFIGFILE;
my $OUTFILE;

if( ! Getopt::Long::GetOptions(
  'device|d=s' => \$DEVICE,

script/electric-sheep-dump-screen-shot.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;

our $VERSION = '0.04';

use lib ('blib/lib');

use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used
my $DEVICE;
my $CONFIGFILE;
my $OUTFILE;

if( ! Getopt::Long::GetOptions(
  'device|d=s' => \$DEVICE,

script/electric-sheep-dump-screen-video.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;

our $VERSION = '0.04';

use lib ('blib/lib');

use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used
my $DEVICE;
my $CONFIGFILE;
my $OUTFILE;
my %OTHEROPTIONS;
if( ! Getopt::Long::GetOptions(
  'time-limit=s' => sub { $OTHEROPTIONS{$_[0]} = $_[1] },

script/electric-sheep-emulator-geofix.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;

our $VERSION = '0.04';

use lib ('blib/lib');

use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used
my $COORDINATES = {
	'latitude' => undef,
	'longitude' => undef,
};
my $DEVICE;
my $CONFIGFILE;

script/electric-sheep-find-installed-apps.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;

our $VERSION = '0.04';

use lib ('blib/lib');

use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used
my $DEVICE;
my $CONFIGFILE;
my $OUTFILE;
my $FAST = 0;
if( ! Getopt::Long::GetOptions(
  'device|d=s' => \$DEVICE,

script/electric-sheep-find-running-processes.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;

our $VERSION = '0.04';

use lib ('blib/lib');

use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump perl2json no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used
my $DEVICE;
my $CONFIGFILE;
my $OUTFILE;

if( ! Getopt::Long::GetOptions(
  'device|d=s' => \$DEVICE,

script/electric-sheep-viber-send-message.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;

our $VERSION = '0.04';

use lib ('blib/lib');

use Getopt::Long qw(:config no_ignore_case);
use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use Android::ElectricSheep::Automator::Plugins::Apps::Viber;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used
my ($DEVICE, %SENDPARS, $CONFIGFILE);
my $CLOSE_APP_AFTER = 0;
if( ! Getopt::Long::GetOptions(
  'recipient=s' => sub { $SENDPARS{$_[0]} = $_[1] },
  # 1) no unicode, 2) each space must be converted to '%s'
  'message=s' => sub { $SENDPARS{$_[0]} = $_[1] },

t/050-instantiate-config-logger.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

# if for debug you change this make sure that it has path in it e.g. ./xyz

t/100-ScreenLayout.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator::ScreenLayout;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

my ($params, $sl, $tostring, $xmlfilename);

t/150-DeviceProperties.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;
use Android::ElectricSheep::Automator::DeviceProperties;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

t/200-Plugins_Apps-general.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;
use MY::TestPlugin_Apps;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

t/MY/TestPlugin_Apps.pm  view on Meta::CPAN

package MY::TestPlugin_Apps;

use lib ($FindBin::Bin, 'blib/lib');

use parent 'Android::ElectricSheep::Automator::Plugins::Apps::Base';

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

sub new {
	my ($class, $params) = @_;
	my $self = $class->SUPER::new({
		%$params,
		'child-class' => $class,
	});
	return $self;
}

xt/live/100-adb-devices.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

# if for debug you change this make sure that it has path in it e.g. ./xyz

xt/live/110-adb-connect-device.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

# if for debug you change this make sure that it has path in it e.g. ./xyz

xt/live/120-adb-find_current_device_properties.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

# if for debug you change this make sure that it has path in it e.g. ./xyz

xt/live/130-adb-list_physical_displays.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

# if for debug you change this make sure that it has path in it e.g. ./xyz

xt/live/150-adb-home_screen.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

# if for debug you change this make sure that it has path in it e.g. ./xyz

xt/live/170-adb-swipe.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

# if for debug you change this make sure that it has path in it e.g. ./xyz

xt/live/180-adb-next_screen-previous_screen.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

# if for debug you change this make sure that it has path in it e.g. ./xyz

xt/live/190-navigation-menu-bottom.t  view on Meta::CPAN

#use utf8;

our $VERSION = '0.06';

use Test::More;
use Test::More::UTF8;
use FindBin;
use Test::TempDir::Tiny;
use Mojo::Log;

use Data::Roundtrip qw/perl2dump no-unicode-escape-permanently/;

use lib ($FindBin::Bin, 'blib/lib');

use Android::ElectricSheep::Automator;

my $VERBOSITY = 0; # we need verbosity of 10 (max), so this is not used

my $curdir = $FindBin::Bin;

# if for debug you change this make sure that it has path in it e.g. ./xyz



( run in 1.729 second using v1.01-cache-2.11-cpan-c21f80fb71c )