cuplv / TraceRunner

Tool for generating dynamic traces of android applications.
3 stars 0 forks source link

OpenJDK issue with soot #3

Open ftc opened 7 years ago

ftc commented 7 years ago

Soot hard codes the path of the rt.jar and classes.jar on OSx which breaks if you are using the openJDK.

In [sootpath]/src/soot/Scene.java these paths are hardcoded, we should probably open up an issue with soot.

 354         if(System.getProperty("os.name").equals("Mac OS X")) {
 355                 //in older Mac OS X versions, rt.jar was split into classes.jar and ui.jar
 356                 sb.append(System.getProperty("java.home"));
 357                 sb.append(File.separator);
 358                 sb.append("..");
 359                 sb.append(File.separator);
 360                 sb.append("Classes");
 361                 sb.append(File.separator);
 362                 sb.append("classes.jar");
 363
 364                 sb.append(File.pathSeparator);
 365                 sb.append(System.getProperty("java.home"));
 366                 sb.append(File.separator);
 367                 sb.append("..");
 368                 sb.append(File.separator);
 369                 sb.append("Classes");
 370                 sb.append(File.separator);
 371                 sb.append("ui.jar");
 372                 sb.append(File.pathSeparator);
 373         }

Temporary fix:

          if(System.getProperty("os.name").equals("Mac OS X")){
            Scene.v().setSootClassPath(sys.env("JAVA_HOME") + "/jre/lib/rt.jar")

          }
ftc commented 7 years ago

Note: temporary fix added to TraceRunner main.