How to Recompile Deconstructed EXE - java

I had some software developed on oDesk about a year ago. What I get back is a java based .EXE
It runs as a standalone without any sort of installation. The problem is they screwed up some graphics for the buttons, it didn't bother me at the time, because I got what I wanted, a minimal viable product that got the job done.
With that said, it's been bothering me for a while, and when I reach back out to the guy - I can't get him.
I used 7zip to open the .EXE and extracted all the contents. I found where the buttons were and fixed them, obviously trying to drag it into 7Zip in the specified location isn't going to work.
How do I go about recompiling everything?
I'm new to all this, so if you need any additional information, please don't hesitate to ask. I just want this thing to look as I intended.

Related

Is there a way that I can get back my accidently deleted code in eclipse?

A couple of days ago, I was copying and pasting my code into a new class. While the entire code was selected, I hit the backspace key. The entire code deleted, and I did not realize. My computer then died. Today, I opened it back up, and none of the code was there. The only thing that remained was an empty file. Is there anything I can do?
The two comments cover most of it. There are only 3 places your code could possibly be. If you checked them all and none of them have it, you're out of luck.
Eclipse Local History
Right click the file in the package explorer and pick the 'Restore from local history...' option. Hurry up, eclipse auto-removes local history that's older than 7 days!
VCS
If you're using version control and you checked this in before, it's a simple restore away. For example, git checkout path/to/the/file.java would do it. You'd have to explain which VCS system you are using and how are you accessing it (via eclipse teams, via e.g. Fork.app, via the command line, etc).
Backups
You're using a computer. It should have backups. These backups need to run automatically and preferably be going 'off site' (to a place that you do not live, you don't want a fire or some serious burglary to mean you have lost both your system and your backup!). If you don't have that, you're, uh, well, I don't want to insult you, so you should find some suitable insult that describes a very silly person and then yell that at a mirror.
The only excuse to not have backups for a system is if the system does everything in the cloud. Chromebooks really don't need it for example. If you're programming, unless it's some fancy cloud-based programming layout, this does not apply to you, and therefore you should be finding a mirror right about now if you don't have a backup solution in place.
There are open source tools like arq where you fully control where the data goes. Various NAS (Network-Attached-Storage) systems have the option to sync with another NAS elsewhere over the network, so buy one for yourself and for a friend, and be each other's backup buddy. Or just toss some money at it; services like Backblaze offer fixed fee backups and offer client side encryption if that's a worry for you.

Is it possible to embed JDK and other requirements into runnable jar?

Two days ago I got close to finishing a java program that wrote, I wanted to let some friends play with it for a bit to find flaws etc. I created a runnable jar trough Eclipse and then I used Launch4j to transform the runnable jar into a .exe
It worked perfectly fine on my pc, but any other user couldn't open it. After a while I discovered that when people would install java JDK, it worked for about 40%, but this atleast pushed me in the direction of what the flaw is. Is there a way to (automaticly?) embed everything in the jar that my program is in need of? Or is there a way to determine what exactly it all is that people need for the .exe to run and what they are missing by running some pre-checks that can re-direct them to links where they can download this? I can't seem to find much on this subject, so I probably made a mis assumption somewhere, any help/clearance is appreciated!
There is a new tool called jpackage, which should do what you want.
Also see the User's Guide.

Differences in execution behavior of Java program

I wrote a java program, which manipulates Word documents (docx) with Apache POI. It runs fine within Eclipse, and it runs fine as a runnable JAR on my computer (Windows 10).
I copied that JAR to another computer, and it is starting up normally. The GUI behaves like expected.
The problem is the Word document I write out (docx).
I am performing two types of changes. The first one is the addition of new paragraphs or concatenation of content to the runs. If I stay with this, the document gets written into the file system correctly. The second type is the simple replacement of content within the runs (changes of words and some grammatical changes). I would see that part as the "simpler" one, but if I stay with this or if I combine both change types, no document is written out at all. It does look like there is a bug, but there isn't one because it worked fine on my system.
I wrote myself a function to write out an error log (txt) to get information about that issue. This one worked on both systems. But the log didn't get any information, why the document was not written out.
I suppose there are some Windows security settings which interfer with my program or something like that. The computer that does not like to run my program has Win 7 installed on it, and there are some security domain settings, which affect all other computers in the local network.
Does anyone experienced something similar yet? Any suggestions what to check? Suggestions how to find out if an error happened are appreciated as well.
OK, the problem got solved by simply updating the Java version. I saw that update icon in the system tray, which didn't open update the update dialog. So I wanted to update the Java-version at least.
When I wanted to de-install the current Java version first, I noticed that the Win7-machine hadn't a Java-update for three years now. It was just installed in 2014. As soon as the recent version was installed, everything worked like expected again.
The strange behavior that some parts of my program worked and some not, confused me. I hoped that the Java update would fix this, but I doubted that. I didn't knew that old versions make programs run unpredictably.

Recover corrupted java file

I tried to reimport my android project on eclipse to solve a problem but I accidently overwrote all my files in the project. All of them had been corrupted which means their size is now 0B...
I tried to use Local History but it's useless since my project is no longer in my workspace, same for .metadata.
I also tried to use Recuva (Software for recovering files) which see my files with their real size but when I try recover them, their size is always 0B...
I lost about 7 days of work and I don't really want to rewrite my code using Java Decompiler...
So my question is, is there any solution to recover that files ?
I wrote 200 lines of code and suddenly system restarted. I lost all code. But I recovered data from eclipse's local history. Right click on the file -->replace with-->previous from Local History
Eclipse has a local history, although by default it's set very low - one of my first tasks when setting up a new development machine is to up the values (in addition to my other version control)
If you do have a history you can right click on your class, and select compare with local history.
You could try decompiling with something like JD-GUI. It might not be as onerous as you think. Obfuscators exist for a reason.
It is not really programming question, but i had similar situation and "Mini Tool Power Data Recovery" tool helped me (it is paid tool, free version exists, but maybe you can search in this direction and find something open source). I tried some another tools then, but with no results.

Replacing/Rebuilding framework.jar in Android Source

This could be a rather crazy question, but I wanted to get some insight on it before I spend all the time trying it.
Is it possible to rebuild framework.jar (like say pulling the framework.jar from MIUI), decompile it to smali and then rebuilt it from scratch (via reading through and remaking it yourself into java)?
I planned on doing that + taking the similar files from Cyanogen mod as a reference to build off of. The reason I was interested in doing all this was because I have a phone that needs the Radio Interface Layer more or less rebuilt and it's just become too much of a hassle to deal with editing the smali directly and debugging it.
I figured I would ask here because people would be less quick to rush to judgment on whether it was possible or not. I don't see why it wouldnt work if you are adding everything correctly (in theory) and rebuilt the classes.dex file in the source after.
Main reason I am asking is part of an effort to port MIUI to my phone. I figured the lesser of too headaches was rewriting the java and rebuilding a working framework.jar (which has parts in it that are not in the CM7 or AOSP sources) than editing the framework.jar that comes with MIUI to work correctly.
While there are various ways to decompile a dex file back into java, none of them will produce java that is perfectly compilable. You would have to spend tons of effort cleaning up the java code from a decompiler, to get it to compile. It's pretty much not an option for something as big as that.
Your best bet is to get something like AOSP or CM working on your phone, so that you can build the framework yourself directly, with whatever modifications you need.

Categories