Android-ElectricSheep-Automator

 view release on metacpan or  search on metacpan

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

		# a hash of installed apps by package name (e.g. android.google.calendar)
		# the value will be an AppProperties object if it was enquired or undef
		# if it wasn't. As the addition of apps is done in a lazy way, when
		# needed, unless specified otherwise. In any event open_app() will add an
		# AppProperties object if missing to the specified package.
		'apps' => {},

		# legacy, no worries.
		'apps-roundabout-way' => undef,
	};
	bless $self => $class;

	# this will read configuration and create confighash,
	# make logger, verbosity,
	# instantiate any objects we need here etc.
	if( $self->init($params) ){ print STDERR __PACKAGE__."${whoami} (via $parent), line ".__LINE__." : error, call to init() has failed.\n"; return undef }

	# Now we have a logger
	my $log = $self->log();

	# do module-specific init

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

			'declaredPermissions' => [],
			'enabledComponents' => [],

			# activities
			# each item is a hash with name, fully qualified name etc.
			'MainActivity' => {}, # <<< this is an item as well if found
			'MainActivities' => [], # only those marked as .MAIN and .LAUNCHER
			'activities' => [], # all of them
		}
	};
	bless $self => $class;

	# we need a mother object (Android::ElectricSheep::Automator)
	if( (! exists $params->{'mother'})
	 || (! defined $params->{'mother'})
	 || (! defined $params->{'mother'}->adb())
	){ print STDERR "${whoami} (via $parent), line ".__LINE__." : error, input parameter 'mother' with our parent Android::ElectricSheep::Automator object was not specified.\n"; return undef }
	$self->{'_private'}->{'mother'} = $params->{'mother'};
	# we now have a mother

	if( exists $params->{'logger-object'} ){

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

			# corresponds to dumpsys->RawSurfaceWidth,RawSurfaceHeight
			'w' => 0,
			'h' => 0,
			'orientation' => 0,
			'density' => 0,
			'density-x' => 0,
			'density-y' => 0,
			'serial' => '<na>'
		}
	};
	bless $self => $class;

	if( exists $params->{'logger-object'} ){ $self->{'_private'}->{'logger-object'} = $params->{'logger-object'} } else { $self->{'_private'}->{'logger-object'} = Mojo::Log->new() }
	if( exists $params->{'verbosity'} ){ $self->{'_private'}->{'verbosity'} = $params->{'verbosity'} } else { $self->{'_private'}->{'verbosity'} = Mojo::Log->new() }
	# we now have a log and verbosity

	my $log = $self->log;
	my $verbosity = $self->verbosity;

	# we need a mother object (Android::ElectricSheep::Automator)
	if( (! exists $params->{'mother'})

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

	my $whoami = ( caller(0) )[3];

	my $self = {
		'_private' => {
			'child-class' => $class,
			'mother' => undef, # the Android::ElectricSheep::Automator object
			'confighash' => undef,
			'configfile' => '', # this should never be undef
		},
	};
	bless $self => $class;

	# this will read the confighash, check our params, confighash params, etc.
	# and also instantiate ua etc. and also do the verbosity etc.
	if( $self->init($params) ){ print STDERR __PACKAGE__." (via ".$self->child_class.") : ${whoami} (via $parent), line ".__LINE__." : error, call to init() has failed.\n"; return undef }

	# do module-specific init
	if( $self->init_module_specific($params) ){ print STDERR __PACKAGE__." (via ".$self->child_class.") : ${whoami} (via $parent), line ".__LINE__." : error, call to init_module_specific() has failed.\n"; return undef }

	# Now we have a logger
	my $log = $self->log();

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

			'dock-divider-area' => [0, 0, 0, 0, 0, 0],
					# x1,y1,x2,y2,w,h
			# these are some common apps which don't change if you swipe screens i think
			'hotseat-area' => [0, 0, 0, 0, 0, 0],
					# x1,y1,x2,y2,w,h
			'home-buttons-area' => [0, 0, 0, 0, 0, 0],
			'apps' => {}, # appname => [bounds x1,y1,x2,y2]
			'screen-name' => '',
		}
	};
	bless $self => $class;

	if( exists $params->{'logger-object'} ){ $self->{'_private'}->{'logger-object'} = $params->{'logger-object'} } else { $self->{'_private'}->{'logger-object'} = Mojo::Log->new() }
	if( exists $params->{'verbosity'} ){ $self->{'_private'}->{'verbosity'} = $params->{'verbosity'} } else { $self->{'_private'}->{'verbosity'} = Mojo::Log->new() }
	# we now have a log and verbosity

	my $log = $self->log;
	my $verbosity = $self->verbosity;

	if( exists $params->{'data'} ){
		my $d = $self->{'data'}; 



( run in 0.623 second using v1.01-cache-2.11-cpan-49f99fa48dc )