code: public void sealApk() throws ApkCreationException, SealedApkException {
          if (mIsSealed) {
              throw new SealedApkException("APK is already sealed");
          }
  
          // close and sign the application package.
          try {
              mBuilder.close();
              mIsSealed = true;
          } catch (Exception e) {
              throw new ApkCreationException(e, "Failed to seal APK");
          } finally {
              mBuilder.cleanUp();
          }
      }
docs: Seals the APK, and signs it if necessary.
  @throws ApkCreationException
  @throws ApkCreationException if an error occurred
  @throws SealedApkException if the APK is already sealed.