Skip to content

Instantly share code, notes, and snippets.

@micronax
Created June 9, 2016 12:41
Show Gist options
  • Save micronax/eae53956b40dfacaa95f0c44f328f765 to your computer and use it in GitHub Desktop.
Save micronax/eae53956b40dfacaa95f0c44f328f765 to your computer and use it in GitHub Desktop.
Repack jar-files with updated manifest file
#!/bin/bash
src_dir=`pwd`
mkdir "done"
for f in *.jar
do
mkdir -p "${f}_extracted"
unzip $f -d "${f}_extracted"
cd "${f}_extracted"
echo "Permissions: all-permissions" >> META-INF/MANIFEST.MF
yes "A" | zip --filesync -r "../done/$f" *
cd $src_dir
rm -rf "$src_dir/${f}_extracted"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment