private Manifest makeManifest() throws IOException {
    byte[] manifestBytes = outputResources.get(MANIFEST_NAME);
    Manifest manifest;
    Attributes attribs;

    if (manifestBytes == null) {
      // We need to construct an entirely new manifest.
      manifest = new Manifest();
      attribs = manifest.getMainAttributes();
      attribs.put(Attributes.Name.MANIFEST_VERSION, "1.0");
    } else {
      manifest = new Manifest(new ByteArrayInputStream(manifestBytes));
      attribs = manifest.getMainAttributes();
      outputResources.remove(MANIFEST_NAME);
    }

    String createdBy = attribs.getValue(CREATED_BY);
    if (createdBy == null) {
      createdBy = "";
    } else {
      createdBy += " + ";
    }
    createdBy += "dx " + Version.VERSION;

    attribs.put(CREATED_BY, createdBy);
    attribs.putValue("Dex-Location", DexFormat.DEX_IN_JAR_NAME);

    return manifest;
  }
Creates and returns the manifest to use for the output. This may modify {@link
#outputResources} (removing the pre-existing manifest).

@return {@code non-null;} the manifest
android/android_framework/dex-maker/src/main/java/com/android/dx/command/dexer/Main.java