Release a C # generate a Jad DLL class library based on the jar game file

Source: Internet
Author: User

My friend asked me: if the corresponding JAD file is generated based on jar, he said that some games that require installation on mobile phones must have Jad files.

To be honest, I don't know much about this. I searched it and found a friend on the Internet wrote

Jar is something of Java, so it is supported by class libraries. Of course.

And C # how to do it?

According to Google's content, the JAD file is the manifest. MF file in the jar package appended with MIDlet-jar-size: and MIDlet-jar-URL:

After learning about this, our current task is to obtain the manifest. MF file. We know that jar can be decompressed using WinRAR.

If we uncompress the JAR file, everything will be okay.

So our task becomes how to decompress the jar

Simply call WinRAR, which is convenient. At the same time, WinRAR has a high penetration rate, so you don't have to worry about not installing WinRAR.

Decompress the manifest. MF file to a temporary directory and delete it after reading the file. Do not leave garbage in your computer.

After reading the data, write a copy of the content appended with MIDlet-jar-size: and MIDlet-jar-URL :.

I have encapsulated this idea.

You can directly download and use:/files/Suyuan/jadmakerhelper.rar

The call is very simple. First, you can reference this DLL in your project and then call it like this.

Using System;
Using System. Collections. Generic;
Using System. text;
Using Jadmakerhelper;

Namespace Test
{
Class Program
{
Static   Void Main ( String [] ARGs)
{
Jadmakerhelper Jad =   New Jadmakerhelper ( @" D :\ " , " Cangwuji. Jar " );
Jad. createjad ();
}
}
} // Generate the JAD file and your jar file together. If there is a problem, please mail the suyuan19@qq.com

 

Java version see here http://www.knowsky.com/362909.html

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.