// TODO Auto-generated method stub
File file = new File("c:\\simple.jar");
if (!file.exists()) { System.exit(0); }
JarFile jar = new JarFile(file);
Manifest mf = jar.getManifest();
Attributes att = mf.getMainAttributes();
PrintWriter jad = new PrintWriter( new FileOutputStream("c:\\simple.jad"));
Set key = att.keySet();
Iterator iterator = key.iterator();
while (iterator.hasNext()) {
String k = iterator.next().toString();
String v = (String) att.getValue(k);
jad.println(k + ": " + v);
}
jad.println("MIDlet-Jar-Size: "+file.length());
jad.println("MIDlet-Jar-URL: simple.jar");
文章来源于领测软件测试网 https://www.ltesting.net/