soot.options.Options.classes()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中soot.options.Options.classes()方法的一些代码示例,展示了Options.classes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Options.classes()方法的具体详情如下:
包路径:soot.options.Options
类名称:Options
方法名:classes

Options.classes介绍

暂无

代码示例

代码示例来源:origin: Sable/soot

private void postCmdLineCheck() {
 if (Options.v().classes().isEmpty() && Options.v().process_dir().isEmpty()) {
  throw new CompilationDeathException(CompilationDeathException.COMPILATION_ABORTED, "No input classes specified!");
 }
}

代码示例来源:origin: Sable/soot

public void setMainClassFromOptions() {
 if (mainClass != null) {
  return;
 }
 if (Options.v().main_class() != null && Options.v().main_class().length() > 0) {
  setMainClass(getSootClass(Options.v().main_class()));
 } else {
  // try to infer a main class from the command line if none is given
  for (Iterator<String> classIter = Options.v().classes().iterator(); classIter.hasNext();) {
   SootClass c = getSootClass(classIter.next());
   if (c.declaresMethod("main", Collections.<Type>singletonList(ArrayType.v(RefType.v("java.lang.String"), 1)),
     VoidType.v())) {
    logger.debug("No main class given. Inferred '" + c.getName() + "' as main class.");
    setMainClass(c);
    return;
   }
  }
  // try to infer a main class from the usual classpath if none is
  // given
  for (Iterator<SootClass> classIter = getApplicationClasses().iterator(); classIter.hasNext();) {
   SootClass c = classIter.next();
   if (c.declaresMethod("main", Collections.<Type>singletonList(ArrayType.v(RefType.v("java.lang.String"), 1)),
     VoidType.v())) {
    logger.debug("No main class given. Inferred '" + c.getName() + "' as main class.");
    setMainClass(c);
    return;
   }
  }
 }
}

代码示例来源:origin: Sable/soot

/**
 * Load the set of classes that soot needs, including those specified on the command-line. This is the standard way of
 * initialising the list of classes soot should use.
 */
public void loadNecessaryClasses() {
 loadBasicClasses();
 for (String name : Options.v().classes()) {
  loadNecessaryClass(name);
 }
 loadDynamicClasses();
 if (Options.v().oaat()) {
  if (Options.v().process_dir().isEmpty()) {
   throw new IllegalArgumentException("If switch -oaat is used, then also -process-dir must be given.");
  }
 } else {
  for (final String path : Options.v().process_dir()) {
   for (String cl : SourceLocator.v().getClassesUnder(path)) {
    SootClass theClass = loadClassAndSupport(cl);
    if (!theClass.isPhantom) {
     theClass.setApplicationClass();
    }
   }
  }
 }
 prepareClasses();
 setDoneResolving();
}

代码示例来源:origin: Sable/soot

s.setApplicationClass();
if (Options.v().classes().contains(s.getName())) {
 s.setApplicationClass();
 continue;

代码示例来源:origin: com.bugvm/bugvm-soot

/** Load the set of classes that soot needs, including those specified on the
 *  command-line. This is the standard way of initialising the list of
 *  classes soot should use.
 */
public void loadNecessaryClasses() {
loadBasicClasses();
  Iterator<String> it = Options.v().classes().iterator();
  while (it.hasNext()) {
    String name = (String) it.next();
    loadNecessaryClass(name);
  }
  loadDynamicClasses();
  for( Iterator<String> pathIt = Options.v().process_dir().iterator(); pathIt.hasNext(); ) {
    final String path = (String) pathIt.next();
    for (String cl : SourceLocator.v().getClassesUnder(path)) {
      loadClassAndSupport(cl).setApplicationClass();
    }
  }
  prepareClasses();
  // RoboVM note: In RoboVM we're never done resolving
  //setDoneResolving();
}

代码示例来源:origin: ibinti/bugvm

/** Load the set of classes that soot needs, including those specified on the
 *  command-line. This is the standard way of initialising the list of
 *  classes soot should use.
 */
public void loadNecessaryClasses() {
loadBasicClasses();
  Iterator<String> it = Options.v().classes().iterator();
  while (it.hasNext()) {
    String name = (String) it.next();
    loadNecessaryClass(name);
  }
  loadDynamicClasses();
  for( Iterator<String> pathIt = Options.v().process_dir().iterator(); pathIt.hasNext(); ) {
    final String path = (String) pathIt.next();
    for (String cl : SourceLocator.v().getClassesUnder(path)) {
      loadClassAndSupport(cl).setApplicationClass();
    }
  }
  prepareClasses();
  // RoboVM note: In RoboVM we're never done resolving
  //setDoneResolving();
}

代码示例来源:origin: com.bugvm/bugvm-soot

s.setApplicationClass();
if (Options.v().classes().contains(s.getName())) {
  s.setApplicationClass();
  continue;

代码示例来源:origin: ibinti/bugvm

s.setApplicationClass();
if (Options.v().classes().contains(s.getName())) {
  s.setApplicationClass();
  continue;

代码示例来源:origin: ibinti/bugvm

public void setMainClassFromOptions() {
  if(mainClass != null) return;
  if( Options.v().main_class() != null
      && Options.v().main_class().length() > 0 ) {
    setMainClass(getSootClass(Options.v().main_class()));
  } else {             	
    // try to infer a main class from the command line if none is given 
    for (Iterator<String> classIter = Options.v().classes().iterator(); classIter.hasNext();) {
        SootClass c = getSootClass(classIter.next());
        if (c.declaresMethod ("main", new SingletonList( ArrayType.v(RefType.v("java.lang.String"), 1) ), VoidType.v()))
        {
          G.v().out.println("No main class given. Inferred '"+c.getName()+"' as main class.");					
          setMainClass(c);
          return;
        }
    }
    
    // try to infer a main class from the usual classpath if none is given 
    for (Iterator<SootClass> classIter = getApplicationClasses().iterator(); classIter.hasNext();) {
        SootClass c = (SootClass) classIter.next();
        if (c.declaresMethod ("main", new SingletonList( ArrayType.v(RefType.v("java.lang.String"), 1) ), VoidType.v()))
        {
          G.v().out.println("No main class given. Inferred '"+c.getName()+"' as main class.");					
          setMainClass(c);
          return;
        }
    }
  }
}

代码示例来源:origin: com.bugvm/bugvm-soot

public void setMainClassFromOptions() {
  if(mainClass != null) return;
  if( Options.v().main_class() != null
      && Options.v().main_class().length() > 0 ) {
    setMainClass(getSootClass(Options.v().main_class()));
  } else {             	
    // try to infer a main class from the command line if none is given 
    for (Iterator<String> classIter = Options.v().classes().iterator(); classIter.hasNext();) {
        SootClass c = getSootClass(classIter.next());
        if (c.declaresMethod ("main", new SingletonList( ArrayType.v(RefType.v("java.lang.String"), 1) ), VoidType.v()))
        {
          G.v().out.println("No main class given. Inferred '"+c.getName()+"' as main class.");					
          setMainClass(c);
          return;
        }
    }
    
    // try to infer a main class from the usual classpath if none is given 
    for (Iterator<SootClass> classIter = getApplicationClasses().iterator(); classIter.hasNext();) {
        SootClass c = (SootClass) classIter.next();
        if (c.declaresMethod ("main", new SingletonList( ArrayType.v(RefType.v("java.lang.String"), 1) ), VoidType.v()))
        {
          G.v().out.println("No main class given. Inferred '"+c.getName()+"' as main class.");					
          setMainClass(c);
          return;
        }
    }
  }
}

相关文章

微信公众号

最新文章

更多