third_party/android_platform/development/scripts/symbol.py
def _GetApkPackageName(apk_path):
  """Return the package name of a given apk."""
  package_name = _package_name_cache.get(apk_path, None)
  if package_name:
    return package_name

  aapt_path = host_paths.GetAaptPath()
  aapt_output = subprocess.check_output(
      [aapt_path, 'dump', 'badging', apk_path]).split('\n')
  for line in aapt_output:
    match = _PACKAGE_NAME_RE.match(line)
    if match:
      package_name = match.group(1)
      _package_name_cache[apk_path] = package_name
      logging.debug('Package name %s for %s', package_name, apk_path)
      return package_name

  return None
Return the package name of a given apk.
Return the package name of a given apk.
Return the package name of a given apk .
def _GetApkPackageName(apk_path):
  package_name = _package_name_cache.get(apk_path, None)
  if package_name:
    return package_name
  aapt_path = host_paths.GetAaptPath()
  aapt_output = subprocess.check_output(
      [aapt_path, 'dump', 'badging', apk_path]).split('\n')
  for line in aapt_output:
    match = _PACKAGE_NAME_RE.match(line)
    if match:
      package_name = match.group(1)
      _package_name_cache[apk_path] = package_name
      logging.debug('Package name %s for %s', package_name, apk_path)
      return package_name
  return None
def _GetApkPackageName ( apk_path ) : package_name = _package_name_cache . get ( apk_path , None ) if package_name : return package_name aapt_path = host_paths . GetAaptPath ( ) aapt_output = subprocess . check_output ( [ aapt_path , 'dump' , 'badging' , apk_path ] ) . split ( '\n' ) for line in aapt_output : match = _PACKAGE_NAME_RE . match ( line ) if match : package_name = match . group ( 1 ) _package_name_cache [ apk_path ] = package_name logging . debug ( 'Package name %s for %s' , package_name , apk_path ) return package_name return None
Return the package name of a given apk.
Return the package name of a given apk .
"""Return the package name of a given apk."""
apk_path