Current location - Quotes Website - Signature design - How to modify the manifest.mf file in j2me
How to modify the manifest.mf file in j2me

MANIFEST.MF

Just open it with Notepad and modify it. The previous items cannot be changed casually. Some are must-haves and some can be deleted. You can check the related items. Documentation for each definition.

If we classify the configuration information in MANIFEST, it can be summarized into the following categories:

1. General attributes

1. Manifest-Version

Used to define the version of the manifest file, for example: Manifest-Version: 1.0

2. Created-By

Declare the generator of the file, generally this Properties are generated by the jar command line tool, for example: Created-By: Apache Ant 1.5.1

3. Signature-Version

Define the signature version of the jar file

4. Class-Path

The application or class loader uses this value to build the internal class search path

2. Application-related properties

1. Main-Class

Define the entry class of the jar file. This class must be an executable class. Once this attribute is defined, the jar file can be run through java -jar x.jar.

3. Applet related attributes

1. Extension-List

This attribute specifies a list of extended information required by the applet. Each name corresponds to the following attributes

2. -Extension-Name

3. -Specification-Version

4. -Implementation-Version

5. -Implementation-Vendor-Id

5. -Implementation-URL

IV. Extension identification Properties

1. Extension-Name

This property defines the identifier of the jar file, such as Extension-Name: Struts Framework

5. Package extension properties

p>

1. Implementation-Title defines the title of the extension implementation

2. Implementation-Version defines the version of the extension implementation

3. Implementation-Vendor defines the organization of the extension implementation

4. Implementation-Vendor-Id defines the identity of the organization that implements the extension

5. Implementation-URL: defines the download address (URL) of the extension package

6. Specification-Title defines the title of the extended specification

7. Specification-Version defines the version of the extended specification

8. Specification-Vendor declares the organization that maintains the specification

9. Sealed defines whether the jar file is sealed, the value can be true or false (I don’t understand this very well)

6. Signature related attributes

Signature aspects For attributes, we can refer to a section in mail.jar provided by JavaMail

Name: javax/mail/Address.class

Digest-Algorithms: SHA MD5

SHA-Digest: AjR7RqnN//cdYGouxbd06mSVfI4=

MD5-Digest: ZnTIQ2aQAtSNIOWXI1pQpw==

This content defines the class name of the class signature, the algorithm name for calculating the digest, and the corresponding digest Content (encoded using BASE64 method)

7. Custom attributes

In addition to some of the attributes mentioned earlier, you can also add your own attributes and responses in MANIFEST.MF The value, for example, the J2ME program jar package may contain the following information

MicroEdition-Configuration: CLDC-1.0

MIDlet-Name: J2ME_MOBBER Midlet Suite

MIDlet-Info-URL: /

MIDlet-Icon: /icon.png

MIDlet-Vendor: Midlet Suite Vendor

MIDlet-1: mobber,/ icon.png,mobber

MIDlet-Version: 1.0.0

MicroEdition-Profile: MIDP-1.0

MIDlet-Description: Communicator

< p>The key is how do we read this information? In fact, it is very simple. JDK provides us with an API for processing this information. For detailed information, please see the java.util.jar package. We can obtain it by passing the path of a jar file to JarFile and then calling the getManifest method of JarFile. Manifest information.