Module: Apkstats::Command::Executable

Included in:
ApkAnalyzer
Defined in:
lib/apkstats/command/executable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#command_pathObject (readonly)

Returns the value of attribute command_path.



7
8
9
# File 'lib/apkstats/command/executable.rb', line 7

def command_path
  @command_path
end

Instance Method Details

#compare_with(apk_filepath, other_apk_filepath) ⇒ Hash

Compare two apk files and return results.

{

base: {
  file_size: Integer,
  download_size: Integer,
  required_features: Array<String>,
  non_required_features: Array<String>,
  permissions: Array<String>,
  min_sdk: String,
  target_sdk: String,
  method_reference_count: Integer,
  dex_count: Integer,
},
other: {
  file_size: Integer,
  download_size: Integer,
  required_features: Array<String>,
  non_required_features: Array<String>,
  permissions: Array<String>,
  min_sdk: String,
  target_sdk: String,
  method_reference_count: Integer,
  dex_count: Integer,
},
diff: {
  file_size: Integer,
  download_size: Integer,
  required_features: {
    new: Array<String>,
    removed: Array<String>,
  },
  non_required_features:{
    new: Array<String>,
    removed: Array<String>,
  },
  permissions: {
    new: Array<String>,
    removed: Array<String>,
  },
  min_sdk: Array<String>,
  target_sdk: Array<String>,
  method_reference_count: Integer,
  dex_count: Integer,
}

}

Returns:

  • (Hash)


61
62
63
64
65
66
# File 'lib/apkstats/command/executable.rb', line 61

def compare_with(apk_filepath, other_apk_filepath)
  base = Apkstats::Entity::ApkInfo.new(self, apk_filepath)
  other = Apkstats::Entity::ApkInfo.new(self, other_apk_filepath)

  Apkstats::Entity::ApkInfoDiff.new(base, other).to_h
end

#executable?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/apkstats/command/executable.rb', line 9

def executable?
  File.executable?(command_path)
end