I plan to execute a jar command using a jar that is included in another jar.
The command will automatically obfuscate a Java jar file using code similar to:
public void obfuscate()
{
try
{
String jre = "\"" + System.getProperty("java.home") + "\\bin\\javaw.exe" + "\"";
String jar = " -jar";
Runtime.getRuntime().exec(new String[] { jre, jar.trim(), "/lib/allatori.jar /lib/config.xml" });
}
catch (Exception e)
{
e.printStackTrace();
}
}
allatori.jar
file is included in my main.jar
file as a resource. config.xml
file is also included.
How can I run my command so that it executes the included jar file?
Folder structure of main.jar:
- main.jar
|
|- main_class.class
|- lib/
|- allatori.jar
|- config.xml
|- jarToObfuscate.jar
You will certainly have to unpack it outside the jar before running it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With