I made a program on Android. But this is my thesis and I have to give my project to my lecturer. Well I dont want to show some of the code that I wrote. Then I want to encrypt something. If I give him the completed project then he can look at every part of the codes. I don’t know Java that well. I was thinking that I can create something like a dll file in Java (I dont know what it is in Java?) and do some obfuscation. And then I can use this dll file in my project then the lecturer can’t see all the code.
I hope I explained it. It’s not an apk file. It’s a project and I want to hide some code as dll or whatever.
Edit: How do I create a JAR from an Android project?
You can export your class(es) to JAR file(s), then add them to the build path of your project that will be given to the lecturer.
However, when exporting, remember not to export the source of the classes. I don’t know which IDE you are using, but in
Eclipse, just right click the project, chooseExport, and check any files you want.EDIT: To answer your question in the comment below:
For example, you have
Operatorclass, which hasAdd, Subtract, Multiply, Dividestatic methods in it. Now, you want to callAdd(1, 3)in your project (which you will give away), and don’t want people know how theAddmethod works. So now, when exporting the JAR file, just check the namespace that contains Operator class. Consider the JAR file name isOperator.JAR.Copy the
Operator.JARfile into your project folder (anywhere will works, but I recommend \lib\Operator.jar). Right click the copied file, chooseBuild Path->Add to build path.Now in the project, you type in the code
Operator.Add(1, 3), Eclipse will tell you it doesn’t know whatOperatoris. PressCtrl + Shift + O, it will automically import the needed namespace.