private static void computeClassPath(AnalysisScope scope) { StringBuilder buf = new StringBuilder(); ClassLoaderReference cl = scope.getApplicationLoader(); while (cl != null) { List<Module> modules = scope.getModules(cl); for (Module m : modules) { if (buf.length() > 0) buf.append(File.pathSeparator); if (m instanceof JarFileModule) { JarFileModule jarFileModule = (JarFileModule) m; buf.append(jarFileModule.getAbsolutePath()); } else if (m instanceof DirectoryTreeModule) { DirectoryTreeModule directoryTreeModule = (DirectoryTreeModule) m; buf.append(directoryTreeModule.getPath()); } else Assertions.UNREACHABLE("Module entry is neither jar file nor directory"); } cl = cl.getParent(); } }
JarFileModule jarFileModule = (JarFileModule) m; libs.add(jarFileModule.getAbsolutePath()); } else if (m instanceof JarStreamModule) { try {
public static String getJavaJar(AnalysisScope javaScope) throws IOException { Module javaJar = javaScope.getModules(javaScope.getApplicationLoader()).iterator().next(); if (javaJar instanceof JarFileModule) { String javaJarPath = ((JarFileModule)javaJar).getAbsolutePath(); return javaJarPath; } else { assert javaJar instanceof NestedJarFileModule : javaJar; File F = File.createTempFile("android", ".jar"); //F.deleteOnExit(); System.err.println(F.getAbsolutePath()); TemporaryFile.streamToFile(F, ((NestedJarFileModule)javaJar).getNestedContents()); return F.getAbsolutePath(); } }
if (m instanceof JarFileModule) { moduleType = "jarFile"; modulePath = ((JarFileModule) m).getAbsolutePath(); } else if (m instanceof BinaryDirectoryTreeModule) { moduleType = "binaryDir";
if (m instanceof JarFileModule) { moduleType = "jarFile"; modulePath = ((JarFileModule) m).getAbsolutePath(); } else if (m instanceof BinaryDirectoryTreeModule) { moduleType = "binaryDir";