Tabnine Logo
SootClass.isLibraryClass
Code IndexAdd Tabnine to your IDE (free)

How to use
isLibraryClass
method
in
soot.SootClass

Best Java code snippets using soot.SootClass.isLibraryClass (Showing top 20 results out of 315)

origin: Sable/soot

private Set<SootClass> getApplicationParents(SootClass applicationClass) {
 return getParents(applicationClass).stream().filter(parent -> !parent.isLibraryClass()).collect(toSet());
}
origin: Sable/soot

private void updateType(Type type) {
 if (type instanceof RefType) {
  RefType rt = (RefType) type;
  if (!rt.getSootClass().isLibraryClass() && oldToNewClassNames.containsKey(rt.getClassName())) {
   rt.setSootClass(newNameToClass.get(oldToNewClassNames.get(rt.getClassName())));
   rt.setClassName(oldToNewClassNames.get(rt.getClassName()));
  }
 } else if (type instanceof ArrayType) {
  ArrayType at = (ArrayType) type;
  if (at.baseType instanceof RefType) {
   RefType rt = (RefType) at.baseType;
   if (!rt.getSootClass().isLibraryClass() && oldToNewClassNames.containsKey(rt.getClassName())) {
    rt.setSootClass(newNameToClass.get(oldToNewClassNames.get(rt.getClassName())));
   }
  }
 }
}
origin: Sable/soot

private void findMultiCalledMethodsIntra(Set<SootMethod> multiCalledMethods, CallGraph callGraph) {
 Iterator<Unit> it = multiRunStatements.iterator();
 while (it.hasNext()) {
  Stmt stmt = (Stmt) it.next();
  if (stmt.containsInvokeExpr()) {
   InvokeExpr invokeExpr = stmt.getInvokeExpr();
   List<SootMethod> targetList = new ArrayList<SootMethod>();
   SootMethod method = invokeExpr.getMethod();
   if (invokeExpr instanceof StaticInvokeExpr) {
    targetList.add(method);
   } else if (invokeExpr instanceof InstanceInvokeExpr) {
    if (method.isConcrete() && !method.getDeclaringClass().isLibraryClass()) {
     TargetMethodsFinder tmd = new TargetMethodsFinder();
     targetList = tmd.find(stmt, callGraph, true, true);
    }
   }
   if (targetList != null) {
    Iterator<SootMethod> iterator = targetList.iterator();
    while (iterator.hasNext()) {
     SootMethod obj = iterator.next();
     if (!obj.isNative()) {
      multiCalledMethods.add(obj);
     }
    }
   }
  }
 }
}
origin: Sable/soot

 private Optional<SootMethod> findAccessibleInSuperClassesBySubSig(SootClass base, String subSig) {
  Hierarchy hierarchy = Scene.v().getActiveHierarchy();
  for (SootClass superClass : hierarchy.getSuperclassesOfIncluding(base.getSuperclass())) {
   if (superClass.isLibraryClass() && superClass.declaresMethod(subSig)) {
    SootMethod method = superClass.getMethod(subSig);
    if (hierarchy.isVisible(base, method)) {
     return Optional.of(method);
    }
   }
  }
  return Optional.empty();
 }
}
origin: Sable/soot

} else {
 if (method.isConcrete() && !method.getDeclaringClass().isLibraryClass()) {
  Iterator it = cg.edgesOutOf(stmt);
  TargetMethodsFinder tmd = new TargetMethodsFinder();
origin: Sable/soot

private static SootMethod getMethodSafely(InvokeExpr invokeExpr) {
 try {
  final SootMethod invokedMethod = invokeExpr.getMethod();
  if (invokedMethod == null) {
   return null;
  }
  if (SootMethod.constructorName.equals(invokedMethod.getName())
    || SootMethod.staticInitializerName.equals(invokedMethod.getName())) {
   logger.debug("Skipping wrapping method {} as it is constructor/initializer.", invokedMethod);
   return null;
  }
  final SootClass invokedMethodClass = invokedMethod.getDeclaringClass();
  if (!invokedMethodClass.isLibraryClass()) {
   logger.debug("Skipping wrapping method {} as it is not library one.", invokedMethod);
   return null;
  }
  if (invokeExpr.getMethodRef().declaringClass().isInterface() && !invokedMethodClass.isInterface()) {
   logger.debug(
     "Skipping wrapping method {} as original code suppose to execute it on interface {}"
       + " but resolved code trying to execute it on class {}",
     invokedMethod, invokeExpr.getMethodRef().declaringClass(), invokedMethodClass);
   return null;
  }
  return invokedMethod;
 } catch (RuntimeException exception) {
  logger.debug("Cannot resolve method of InvokeExpr: " + invokeExpr.toString(), exception);
  return null;
 }
}
origin: Sable/soot

Chain<SootClass> getContainingChain(SootClass c) {
 if (c.isApplicationClass()) {
  return getApplicationClasses();
 } else if (c.isLibraryClass()) {
  return getLibraryClasses();
 } else if (c.isPhantomClass()) {
  return getPhantomClasses();
 }
 return null;
}
origin: Sable/soot

private ArrayList<MethInfo> getSrcMethods(SootMethod method, boolean recurse) {
 // logger.debug("meth for srcs: "+method);
 ArrayList<MethInfo> list = new ArrayList<MethInfo>();
 for (Iterator momcIt = methodToContexts.get(method).iterator(); momcIt.hasNext();) {
  final MethodOrMethodContext momc = (MethodOrMethodContext) momcIt.next();
  Iterator callerEdges = cg.edgesInto(momc);
  while (callerEdges.hasNext()) {
   Edge callEdge = (Edge) callerEdges.next();
   SootMethod methodCaller = callEdge.src();
   if (methodCaller.getDeclaringClass().isLibraryClass()) {
    if (isShowLibMeths()) {
     if (recurse) {
      list.add(
        new MethInfo(methodCaller, hasTgtMethods(methodCaller) | hasSrcMethods(methodCaller), callEdge.kind()));
     } else {
      list.add(new MethInfo(methodCaller, true, callEdge.kind()));
     }
    }
   } else {
    if (recurse) {
     list.add(new MethInfo(methodCaller, hasTgtMethods(methodCaller) | hasSrcMethods(methodCaller), callEdge.kind()));
    } else {
     list.add(new MethInfo(methodCaller, true, callEdge.kind()));
    }
   }
  }
 }
 return list;
}
origin: Sable/soot

/** Makes this class a library class. */
public void setLibraryClass() {
 if (isLibraryClass()) {
  return;
 }
 Chain<SootClass> c = Scene.v().getContainingChain(this);
 if (c != null) {
  c.remove(this);
 }
 Scene.v().getLibraryClasses().add(this);
 isPhantom = false;
}
origin: Sable/soot

if (sm.getDeclaringClass().isLibraryClass()) {
 if (isShowLibMeths()) {
  if (recurse) {
origin: Sable/soot

if (method.isConcrete() && !method.getDeclaringClass().isLibraryClass()) {
origin: Sable/soot

public void removeClass(SootClass c) {
 if (!c.isInScene()) {
  throw new RuntimeException();
 }
 classes.remove(c);
 if (c.isLibraryClass()) {
  libraryClasses.remove(c);
 } else if (c.isPhantomClass()) {
  phantomClasses.remove(c);
 } else if (c.isApplicationClass()) {
  applicationClasses.remove(c);
 }
 c.getType().setSootClass(null);
 c.setInScene(false);
 modifyHierarchy();
}
origin: Sable/soot

for (SootMethod method : methods) {
 if (!method.isConcrete() || method.getDeclaringClass().isLibraryClass()) {
  continue;
origin: Sable/soot

final FieldRef fieldRef = (FieldRef) value;
SootFieldRef sootFieldRef = fieldRef.getFieldRef();
if (sootFieldRef.declaringClass().isLibraryClass()) {
 continue;
origin: Sable/soot

public SootMethod resolveNonSpecial(RefType t, NumberedString subSig, boolean appOnly) {
 SmallNumberedMap<SootMethod> vtbl = typeToVtbl.get(t);
 if (vtbl == null) {
  typeToVtbl.put(t, vtbl = new SmallNumberedMap<SootMethod>());
 }
 SootMethod ret = vtbl.get(subSig);
 if (ret != null) {
  return ret;
 }
 SootClass cls = t.getSootClass();
 if (appOnly && cls.isLibraryClass()) {
  return null;
 }
 SootMethod m = cls.getMethodUnsafe(subSig);
 if (m != null) {
  if (!m.isAbstract()) {
   ret = m;
  }
 } else {
  SootClass c = cls.getSuperclassUnsafe();
  if (c != null) {
   ret = resolveNonSpecial(c.getType(), subSig);
  }
 }
 vtbl.put(subSig, ret);
 return ret;
}
origin: Sable/soot

Chain<Unit> containerUnits = containerB.getUnits();
if (!(inlinee.getDeclaringClass().isApplicationClass() || inlinee.getDeclaringClass().isLibraryClass())) {
 return null;
origin: ibinti/bugvm

Chain<SootClass> getContainingChain(SootClass c)
{
  if (c.isApplicationClass())
    return getApplicationClasses();
  else if (c.isLibraryClass())
    return getLibraryClasses();
  else if (c.isPhantomClass())
    return getPhantomClasses();
  return null;
}
origin: com.bugvm/bugvm-soot

Chain<SootClass> getContainingChain(SootClass c)
{
  if (c.isApplicationClass())
    return getApplicationClasses();
  else if (c.isLibraryClass())
    return getLibraryClasses();
  else if (c.isPhantomClass())
    return getPhantomClasses();
  return null;
}
origin: ibinti/bugvm

public void removeClass(SootClass c)
{
  if(!c.isInScene())
    throw new RuntimeException();
  classes.remove(c);
  
  if(c.isLibraryClass()) {
    libraryClasses.remove(c);
  } else if(c.isPhantomClass()) {
    phantomClasses.remove(c);
  } else if(c.isApplicationClass()) {
    applicationClasses.remove(c);
  }
  
  c.getType().setSootClass(null);
  c.setInScene(false);
  modifyHierarchy();
}
origin: com.bugvm/bugvm-soot

public void removeClass(SootClass c)
{
  if(!c.isInScene())
    throw new RuntimeException();
  classes.remove(c);
  
  if(c.isLibraryClass()) {
    libraryClasses.remove(c);
  } else if(c.isPhantomClass()) {
    phantomClasses.remove(c);
  } else if(c.isApplicationClass()) {
    applicationClasses.remove(c);
  }
  
  c.getType().setSootClass(null);
  c.setInScene(false);
  modifyHierarchy();
}
sootSootClassisLibraryClass

Javadoc

Convenience method returning true if this class is a library class.

Popular methods of SootClass

  • isInterface
    Convenience method; returns true if this class is an interface.
  • getMethods
  • getName
    Returns the name of this class.
  • setApplicationClass
    Makes this class an application class.
  • getFields
    Returns a backed Chain of fields.
  • getInterfaces
    Returns a backed Chain of the interfaces that are directly implemented by this class. (see getInterf
  • getSuperclass
    WARNING: interfaces are subclasses of the java.lang.Object class! Returns the superclass of this cla
  • hasSuperclass
    WARNING: interfaces are subclasses of the java.lang.Object class! Does this class have a superclass?
  • resolvingLevel
  • addMethod
    Adds the given method to this class.
  • declaresMethod
    Does this class declare a method with the given subsignature?
  • getMethod
  • declaresMethod,
  • getMethod,
  • getType,
  • isApplicationClass,
  • addField,
  • isAbstract,
  • isPhantom,
  • <init>,
  • declaresField

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Collectors (java.util.stream)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now