Can you edit a jar file with live code?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Nano1000
Posts: 1
Joined: Mon Jul 22, 2013 5:44 pm

Can you edit a jar file with live code?

Post by Nano1000 » Mon Jul 22, 2013 5:50 pm

Hello, I am new to live code and I was wondering if anyone knew any way to edit a .jar file (specifically the minecraft.jar, which is the file within the source-code for the game Minecraft that controls everything that is in any way important).
If you can help with this I would be very appreciative!
Thank You!

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can you edit a jar file with live code?

Post by Klaus » Mon Jul 22, 2013 7:31 pm

Hi Nano,

1. welcome to the forum! :-)

2. Not out of the box!

You may be able to write a parser for these JAR files in Livecode,
but that will be a lot of work.


Best

Klaus

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: Can you edit a jar file with live code?

Post by dave_probertGA6e24 » Mon Jul 22, 2013 8:00 pm

In theory you could actually modify a jar file with the LC ZIP functions. A Jar file (such as mine craft.jar) is just a zip/rar (not sure which) file with a different extension.

You could therefore open it with LC, do stuff and save it (close it) as long as you can do so without losing the .jar extension on the way. You could rename the file temporarily if needed.

Look in the dictionary for: revZipOpenArchive, revZipAddUncompressedItemWithFile, revZipDeleteItem and revZipCloseArchive. There are more than these, but you should check these first.

LC cannot modify the compiled Java files inside though - that is not something you can do unless you have the actual sources.

But, while testing, DEFINITELY make a BACKUP. Don't even play with the jar without one. If it breaks then it's not likely you can glue it together again.

With the minecraft.jar you are probably wanting to delete and replace files inside it (for modding) and then remove the META.INF file too :) As you can probably guess, I'm also a MC player ;)

Let us know how it works if you get anywhere.

Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Post Reply