tools/binary_size/libsupersize/archive.py
def _AddContainerArguments(parser):
  """Add arguments applicable to a single container."""

  # Special: Use _IdentifyInputFile() to detect main file argument.
  parser.add_argument('-f', metavar='FILE',
                      help='Auto-identify input file type.')

  # Main file argument: Exactly one should be specified (perhaps via -f), with
  # the exception that --map-file can be specified in addition.
  # _IdentifyInputFile() should be kept updated.
  parser.add_argument('--apk-file',
                      help='.apk file to measure. Other flags can generally be '
                      'derived when this is used.')
  parser.add_argument('--minimal-apks-file',
                      help='.minimal.apks file to measure. Other flags can '
                      'generally be derived when this is used.')
  parser.add_argument('--elf-file', help='Path to input ELF file.')
  parser.add_argument('--map-file',
                      help='Path to input .map(.gz) file. Defaults to '
                           '{{elf_file}}.map(.gz)?. If given without '
                           '--elf-file, no size metadata will be recorded.')

  # Auxiliary file arguments.
  parser.add_argument('--mapping-file',
                      help='Proguard .mapping file for deobfuscation.')
  parser.add_argument('--resources-pathmap-file',
                      help='.pathmap.txt file that contains a maping from '
                      'original resource paths to shortened resource paths.')
  parser.add_argument('--pak-file', action='append',
                      help='Paths to pak files.')
  parser.add_argument('--pak-info-file',
                      help='This file should contain all ids found in the pak '
                           'files that have been passed in.')
  parser.add_argument('--aux-elf-file',
                      help='Path to auxiliary ELF if the main file is APK, '
                      'useful for capturing metadata.')

  # Non-file argument.
  parser.add_argument('--no-string-literals', dest='track_string_literals',
                      default=True, action='store_false',
                      help='Disable breaking down "** merge strings" into more '
                           'granular symbols.')
  parser.add_argument('--no-map-file',
                      dest='ignore_linker_map',
                      action='store_true',
                      help='Use debug information to capture symbol sizes '
                      'instead of linker map file.')
  parser.add_argument(
      '--relocations',
      action='store_true',
      help='Instead of counting binary size, count number of relative '
      'relocation instructions in ELF code.')
  parser.add_argument(
      '--java-only', action='store_true', help='Run on only Java symbols')
  parser.add_argument(
      '--native-only', action='store_true', help='Run on only native symbols')
  parser.add_argument(
      '--no-java', action='store_true', help='Do not run on Java symbols')
  parser.add_argument(
      '--no-native', action='store_true', help='Do not run on native symbols')
  parser.add_argument(
      '--include-padding',
      action='store_true',
      help='Include a padding field for each symbol, instead of rederiving '
      'from consecutive symbols on file load.')
  parser.add_argument(
      '--check-data-quality',
      action='store_true',
      help='Perform sanity checks to ensure there is no missing data.')

  # The split_name arg is used for bundles to identify DFMs.
  parser.set_defaults(split_name=None)
Add arguments applicable to a single container.
Add arguments applicable to a single container.
Add arguments applicable to a single container .
def _AddContainerArguments(parser):
  parser.add_argument('-f', metavar='FILE',
                      help='Auto-identify input file type.')
  parser.add_argument('--apk-file',
                      help='.apk file to measure. Other flags can generally be '
                      'derived when this is used.')
  parser.add_argument('--minimal-apks-file',
                      help='.minimal.apks file to measure. Other flags can '
                      'generally be derived when this is used.')
  parser.add_argument('--elf-file', help='Path to input ELF file.')
  parser.add_argument('--map-file',
                      help='Path to input .map(.gz) file. Defaults to '
                           '{{elf_file}}.map(.gz)?. If given without '
                           '--elf-file, no size metadata will be recorded.')
  parser.add_argument('--mapping-file',
                      help='Proguard .mapping file for deobfuscation.')
  parser.add_argument('--resources-pathmap-file',
                      help='.pathmap.txt file that contains a maping from '
                      'original resource paths to shortened resource paths.')
  parser.add_argument('--pak-file', action='append',
                      help='Paths to pak files.')
  parser.add_argument('--pak-info-file',
                      help='This file should contain all ids found in the pak '
                           'files that have been passed in.')
  parser.add_argument('--aux-elf-file',
                      help='Path to auxiliary ELF if the main file is APK, '
                      'useful for capturing metadata.')
  parser.add_argument('--no-string-literals', dest='track_string_literals',
                      default=True, action='store_false',
                      help='Disable breaking down "** merge strings" into more '
                           'granular symbols.')
  parser.add_argument('--no-map-file',
                      dest='ignore_linker_map',
                      action='store_true',
                      help='Use debug information to capture symbol sizes '
                      'instead of linker map file.')
  parser.add_argument(
      '--relocations',
      action='store_true',
      help='Instead of counting binary size, count number of relative '
      'relocation instructions in ELF code.')
  parser.add_argument(
      '--java-only', action='store_true', help='Run on only Java symbols')
  parser.add_argument(
      '--native-only', action='store_true', help='Run on only native symbols')
  parser.add_argument(
      '--no-java', action='store_true', help='Do not run on Java symbols')
  parser.add_argument(
      '--no-native', action='store_true', help='Do not run on native symbols')
  parser.add_argument(
      '--include-padding',
      action='store_true',
      help='Include a padding field for each symbol, instead of rederiving '
      'from consecutive symbols on file load.')
  parser.add_argument(
      '--check-data-quality',
      action='store_true',
      help='Perform sanity checks to ensure there is no missing data.')
  parser.set_defaults(split_name=None)
def _AddContainerArguments ( parser ) : parser . add_argument ( '-f' , metavar = 'FILE' , help = 'Auto-identify input file type.' ) parser . add_argument ( '--apk-file' , help = '.apk file to measure. Other flags can generally be ' 'derived when this is used.' ) parser . add_argument ( '--minimal-apks-file' , help = '.minimal.apks file to measure. Other flags can ' 'generally be derived when this is used.' ) parser . add_argument ( '--elf-file' , help = 'Path to input ELF file.' ) parser . add_argument ( '--map-file' , help = 'Path to input .map(.gz) file. Defaults to ' '{{elf_file}}.map(.gz)?. If given without ' '--elf-file, no size metadata will be recorded.' ) parser . add_argument ( '--mapping-file' , help = 'Proguard .mapping file for deobfuscation.' ) parser . add_argument ( '--resources-pathmap-file' , help = '.pathmap.txt file that contains a maping from ' 'original resource paths to shortened resource paths.' ) parser . add_argument ( '--pak-file' , action = 'append' , help = 'Paths to pak files.' ) parser . add_argument ( '--pak-info-file' , help = 'This file should contain all ids found in the pak ' 'files that have been passed in.' ) parser . add_argument ( '--aux-elf-file' , help = 'Path to auxiliary ELF if the main file is APK, ' 'useful for capturing metadata.' ) parser . add_argument ( '--no-string-literals' , dest = 'track_string_literals' , default = True , action = 'store_false' , help = 'Disable breaking down "** merge strings" into more ' 'granular symbols.' ) parser . add_argument ( '--no-map-file' , dest = 'ignore_linker_map' , action = 'store_true' , help = 'Use debug information to capture symbol sizes ' 'instead of linker map file.' ) parser . add_argument ( '--relocations' , action = 'store_true' , help = 'Instead of counting binary size, count number of relative ' 'relocation instructions in ELF code.' ) parser . add_argument ( '--java-only' , action = 'store_true' , help = 'Run on only Java symbols' ) parser . add_argument ( '--native-only' , action = 'store_true' , help = 'Run on only native symbols' ) parser . add_argument ( '--no-java' , action = 'store_true' , help = 'Do not run on Java symbols' ) parser . add_argument ( '--no-native' , action = 'store_true' , help = 'Do not run on native symbols' ) parser . add_argument ( '--include-padding' , action = 'store_true' , help = 'Include a padding field for each symbol, instead of rederiving ' 'from consecutive symbols on file load.' ) parser . add_argument ( '--check-data-quality' , action = 'store_true' , help = 'Perform sanity checks to ensure there is no missing data.' ) parser . set_defaults ( split_name = None )
Add arguments applicable to a single container.
Add arguments applicable to a single container .
"""Add arguments applicable to a single container.""" # Special: Use _IdentifyInputFile() to detect main file argument. # Main file argument: Exactly one should be specified (perhaps via -f), with # the exception that --map-file can be specified in addition. # _IdentifyInputFile() should be kept updated. # Auxiliary file arguments. # Non-file argument. # The split_name arg is used for bundles to identify DFMs.
parser