unzip -l jarfilename.jarYou are likely to get output of the format:
Archive: jarfilename.jar Length Date Time Name --------- ---------- ----- ---- 0 2013-02-20 13:35 META-INF/ 868 2013-02-20 13:35 META-INF/MANIFEST.MF 1476 2013-02-20 13:26 plugin.xmlTo view the content of an file type:
unzip -p jarfilename.jar plugin.xmlor the content of a file that is placed in a folder:
unzip -p jarfilename.jar META-INF/MANIFEST.MF
Now that the file to be edited is found, make a copy of it by typing the following:
mkdir META-INFEdit the MANIFEST.MF file, and save it to the disk. Now to update the file in the jar file, type the following lines:
unzip -p jarfilename.jar META-INF/MANIFEST.MF > META-INF/MANIFEST.MF
nano META-INF/MANIFEST.MF
zip -u jarfilename.jar META-INF/MANIFEST.MFAll zip and unzip operations can be piped out to an file that can be examined at later time. And don't forget to clean up by removing your working files and directories. In this case:
rm -rf META-INF
No comments:
Post a Comment