I’m using the SDK 3.0 with Windows with latest updates.
I wanted to enable the ‘obfuscate’ option during the build.
However, there is a path, that doesn’t expand correctly:
[java]ProGuard, version 4.7
Reading program directory [C:\Dokumente und Einstellungen\Pilot\Eigene Dateien\jME3_SDK_Stable_Projects\BasicGame\dist\lib] (filtered)
Reading program jar [C:\Dokumente und Einstellungen\Pilot\Eigene Dateien\jME3_SDK_Stable_Projects\BasicGame\dist\MyGame.jar]
Reading library jar [C:\Dokumente und Einstellungen\Pilot\Eigene Dateien\jME3_SDK_Stable_Projects\BasicGame${platform.home}\jre\lib\rt.jar]
C:\Dokumente und Einstellungen\Pilot\Eigene Dateien\jME3_SDK_Stable_Projects\BasicGame\nbproject\obfuscate-impl.xml:7: Can’t read [C:\Dokumente und Einstellungen\Pilot\Eigene Dateien\jME3_SDK_Stable_Projects\BasicGame${platform.home}\jre\lib\rt.jar] (No such file or directory)
BUILD FAILED (total time: 6 seconds)
[/java]
Seems like it wants to find the path to the local JRE, but is looking in the wrong place.
I don’t know how to solve this issue, I’m not good at configuring build systems.
Can someone help me?
I cannot preview or edit my posts in the new forum.
This is the important line:
Can’t read [C:\Dokumente und Einstellungen\Pilot\Eigene Dateien\jME3_SDK_Stable_Projects\BasicGame${platform.home}\jre\lib\rt.jar] (No such file or directory)
I liked the old forum back in the jME2 times (2006). It had everything: preview, edit, search function, etc.
When I try to search this forum for words I get “Service Unavailable” very often.
But that’s off topic I think.
If I would know a lot about the SDK build scripts and the tools they use, I would fix this myself.
At the moment it is more like a black box to me, the build script is very long and I know so little.
It is not highest prio, because my project is just getting started, not rolled out to customers yet.
Hacked around in the script about 2 hours now, but still getting warnings for not found classes and native code, and Build quits with error.
Can anybody try to replicate this?
->
Just set in Project-Properties > Build > Obfuscation > Obfuscate Build [x]
And then do a ‘Clean and Build’ or ‘Build’ in the SDK.
I am maybe wrong, but it seems hard (impossible?) to have obfuscation with libs like nifty which use reflection.
(For the network part it seems ok, as they use an integer to identify the class through network. However, i am event not sure about this part, as they need to use reflection to access the fields of the object. For exemple, if the obfuscation is randomized each time you compile, a server will likely not be compatible with a client if you recompile it, even if you don’t modify the network part.)
However, as i just woke up, i am maybe completly wrong.
Normally when using this tools (not necessarly excatly true for proguard) manually you can specify wich class names not to touch, or alternatively to always change them and every reflection access that uses Class.forName to use the new name.
i wasn’t thinking about the creation of the controller, more about the “interact” part, where a method is specified in the xml code. But if you can protect some class, it doens’t sound impossible to use nifty with obfuscation, mea culpa.
@bubuche is right. It tells me about this replication error and I can’t proceed. When I do it outside of Jmonkey it works though. I kind of don’t know why.
@normen said:
Maybe go back to the way the script worked before:
<property name="proguard.library.path" value="${java.home}/lib/rt.jar"/>
Works for me, thanks! I did not check the obfuscation, but with the script it builds.
I’m concerned about what bubuche said, maybe I will try to pack my special code in an own library and obfuscate its guts there.
Maybe this isn’t a solution when I make heavy use of networking code for multiplayer functionality.