Android-ElectricSheep-Automator
view release on metacpan or search on metacpan
lib/Android/ElectricSheep/Automator/AppProperties.pm view on Meta::CPAN
package Android::ElectricSheep::Automator::AppProperties;
use 5.006;
use strict;
use warnings;
our $VERSION = '0.09';
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];
my $self = {
'_private' => {
'logger-object' => undef,
'verbosity' => 0,
'mother' => 0,
},
'data' => {
# both are extracted from pkg=Package{3d33653 com.viber.voip}
'packageName' => '',
'packageId' => '',
# where apks are
'codePath' => '',
# path(s) to one or more apk files found under the codePath above,
# it can be empty []
'apkPaths' => [],
'resourcePath' => '',
'applicationInfo' => '',
'dataDir' => '',
'versionCode' => '',
'versionName' => '',
'flags' => [],
'privateFlags' => [],
'pkgFlags' => [],
'usesOptionalLibraries' => [],
'usesLibraryFiles' => [],
'timeStamp' => '',
'firstInstallTime' => '',
'lastUpdateTime' => '',
'signatures' => '',
'requestedPermissions' => [], # requested permissions
'installPermissions' => [],
'runtimePermissions' => [],
'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'};
( run in 1.005 second using v1.01-cache-2.11-cpan-39bf76dae61 )