def read_manifest(app_dir, tools_dir, typ, binary):
 try:
  dat = ''
  if (binary is True):
   print '[INFO] Getting Manifest from Binary'
   print '[INFO] AXML -> XML'
   manifest = os.path.join(app_dir, 'AndroidManifest.xml')
   if ((len(settings.AXMLPRINTER_BINARY) > 0) and isFileExists(settings.AXMLPRINTER_BINARY)):
    cp_path = settings.AXMLPRINTER_BINARY
   else:
    cp_path = os.path.join(tools_dir, 'AXMLPrinter2.jar')
   args = [(settings.JAVA_PATH + 'java'), '-jar', cp_path, manifest]
   dat = subprocess.check_output(args)
  else:
   print '[INFO] Getting Manifest from Source'
   if (typ == 'eclipse'):
    manifest = os.path.join(app_dir, 'AndroidManifest.xml')
   elif (typ == 'studio'):
    manifest = os.path.join(app_dir, 'app/src/main/AndroidManifest.xml')
   with io.open(manifest, mode='r', encoding='utf8', errors='ignore') as file_pointer:
    dat = file_pointer.read()
  return dat
 except:
  PrintException('[ERROR] Reading Manifest file')

def read_manifest ( app_dir , tools_dir , typ , binary ) : try : dat = '' if ( binary is True ) : print '[INFO] Getting Manifest from Binary' print '[INFO] AXML -> XML' manifest = os . path . join ( app_dir , 'AndroidManifest.xml' ) if ( ( len ( settings . AXMLPRINTER_BINARY ) > 0 ) and isFileExists ( settings . AXMLPRINTER_BINARY ) ) : cp_path = settings . AXMLPRINTER_BINARY else : cp_path = os . path . join ( tools_dir , 'AXMLPrinter2.jar' ) args = [ ( settings . JAVA_PATH + 'java' ) , '-jar' , cp_path , manifest ] dat = subprocess . check_output ( args ) else : print '[INFO] Getting Manifest from Source' if ( typ == 'eclipse' ) : manifest = os . path . join ( app_dir , 'AndroidManifest.xml' ) elif ( typ == 'studio' ) : manifest = os . path . join ( app_dir , 'app/src/main/AndroidManifest.xml' ) with io . open ( manifest , mode = 'r' , encoding = 'utf8' , errors = 'ignore' ) as file_pointer : dat = file_pointer . read ( ) return dat except : PrintException ( '[ERROR] Reading Manifest file' )
read the manifest file .