Android-ElectricSheep-Automator
view release on metacpan or search on metacpan
lib/Android/ElectricSheep/Automator/Plugins/Apps/Base.pm view on Meta::CPAN
to it. There is already one plugin provided L<Android::ElectricSheep::Automator::Plugins::Apps::Viber>
which can serve as an example for creating new plugins.
It is as simple as this:
package Android::ElectricSheep::Automator::Plugins::Apps::MyNewPlugin;
use parent 'Android::ElectricSheep::Automator::Plugins::Apps::Base';
sub new {
my ($class, $params) = @_;
my $self = $class->SUPER::new({
%$params,
'child-class' => $class,
});
# add some extra internal fields, e.g. the name of the app
# we are dealing with
$self->{'_private'}->{'appname'} = 'com.viber.voip';
return $self;
}
# new methods
lib/Android/ElectricSheep/Automator/Plugins/Apps/Viber.pm view on Meta::CPAN
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';
return $self;
}
# keeps pressing the back-arrow at the top of the app to hopefully
# arrive at the main activity of the app,
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;
}
sub test_call {
my ($self, $params) = @_;
return 0; # success
( run in 0.531 second using v1.01-cache-2.11-cpan-4face438c0f )