parameters: (jsdata, **options)
docstring: prepare a content-libs.jar file with ZIM file for inclusion in APK
docstring_summary: prepare a content-libs.jar file with ZIM file for inclusion in APK
docstring_tokens: prepare a content - libs . jar file with ZIM file for inclusion in APK
function: def step_embed_zimfile(jsdata, **options):
      """ prepare a content-libs.jar file with ZIM file for inclusion in APK """
  
      if not jsdata.get('embed_zim'):
          return
  
      move_to_android_placeholder()
      # create content-libs.jar
      tmpd = tempfile.mkdtemp()
      archs = os.listdir('libs')
      for arch in archs:
          os.makedirs(os.path.join(tmpd, 'lib', arch))
          # shutil.copy(os.path.join('libs', arch, 'libkiwix.so'),
          #             os.path.join(tmpd, 'lib', arch, 'libkiwix.so'))
      copy_to(jsdata.get('zim_file'),
              os.path.join(tmpd, 'lib', archs[0], jsdata.get('zim_name')))
      for arch in archs[1:]:
          os.chdir(os.path.join(tmpd, 'lib', arch))
          os.link('../{}/{}'.format(archs[0], jsdata.get('zim_name')),
                  jsdata.get('zim_name'))
      os.chdir(tmpd)
      syscall('zip -r -0 -y {} lib'
              .format(os.path.join(ANDROID_PATH, 'content-libs.jar')))
      shutil.rmtree(tmpd)
function_tokens: def step_embed_zimfile ( jsdata , * * options ) : if not jsdata . get ( 'embed_zim' ) : return move_to_android_placeholder ( ) # create content-libs.jar tmpd = tempfile . mkdtemp ( ) archs = os . listdir ( 'libs' ) for arch in archs : os . makedirs ( os . path . join ( tmpd , 'lib' , arch ) ) # shutil.copy(os.path.join('libs', arch, 'libkiwix.so'), #             os.path.join(tmpd, 'lib', arch, 'libkiwix.so')) copy_to ( jsdata . get ( 'zim_file' ) , os . path . join ( tmpd , 'lib' , archs [ 0 ] , jsdata . get ( 'zim_name' ) ) ) for arch in archs [ 1 : ] : os . chdir ( os . path . join ( tmpd , 'lib' , arch ) ) os . link ( '../{}/{}' . format ( archs [ 0 ] , jsdata . get ( 'zim_name' ) ) , jsdata . get ( 'zim_name' ) ) os . chdir ( tmpd ) syscall ( 'zip -r -0 -y {} lib' . format ( os . path . join ( ANDROID_PATH , 'content-libs.jar' ) ) ) shutil . rmtree ( tmpd )