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

How to use
declaresField
method
in
soot.SootClass

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

origin: Sable/soot

/**
 * Adds the given field to this class.
 */
public void addField(SootField f) {
 checkLevel(SIGNATURES);
 if (f.isDeclared()) {
  throw new RuntimeException("already declared: " + f.getName());
 }
 if (declaresField(f.getName(), f.getType())) {
  throw new RuntimeException("Field already exists : " + f.getName() + " of type " + f.getType());
 }
 if (fields == null) {
  fields = new HashChain<>();
 }
 fields.add(f);
 f.setDeclared(true);
 f.setDeclaringClass(this);
}
origin: Sable/soot

 soot.Local sootLocal = localsMap.get(new polyglot.util.IdentityKey(li));
 return sootLocal;
} else if (body.getMethod().getDeclaringClass().declaresField("val$" + li.name(), Util.getSootType(li.type()))) {
 soot.Local fieldLocal = generateLocal(li.type());
 soot.SootFieldRef field = soot.Scene.v().makeFieldRef(body.getMethod().getDeclaringClass(), "val$" + li.name(),
  if (outerClass.declaresField("val$" + li.name(), Util.getSootType(li.type()))) {
   fieldFound = true;
origin: Sable/soot

/**
 * Loads a single field from a dex file
 *
 * @param declaringClass
 *          The class that declares the method to load
 * @param annotations
 *          The worker object for handling annotations
 * @param field
 *          The field to load
 */
protected void loadField(SootClass declaringClass, DexAnnotation annotations, Field sf) {
 if (declaringClass.declaresField(sf.getName(), DexType.toSoot(sf.getType()))) {
  return;
 }
 SootField sootField = DexField.makeSootField(sf);
 sootField = declaringClass.getOrAddField(sootField);
 annotations.handleFieldAnnotation(sootField, sf);
}
origin: Sable/soot

while (it.hasNext()) {
 polyglot.types.LocalInstance li2 = (polyglot.types.LocalInstance) it.next().object();
 if (!sootClass.declaresField("val$" + li2.name(), Util.getSootType(li2.type()))) {
  if (!luc.getLocalDecls().contains(new polyglot.util.IdentityKey(li2))) {
   addFinals(li2, finalFields);
while (it.hasNext()) {
 polyglot.types.LocalInstance li2 = (polyglot.types.LocalInstance) it.next().object();
 if (!sootClass.declaresField("val$" + li2.name(), Util.getSootType(li2.type()))) {
  if (!luc.getLocalDecls().contains(new polyglot.util.IdentityKey(li2))) {
   addFinals(li2, finalFields);
origin: Sable/soot

if (!addToClass.declaresField(fieldName, fieldType)) {
 addToClass.addField(sootField);
 sootField.addTag(new soot.tagkit.SyntheticTag());
origin: Sable/soot

if (!sootClass.declaresField(fieldName, fieldType)) {
 soot.SootField assertionsDisabledField
   = Scene.v().makeSootField(fieldName, fieldType, soot.Modifier.STATIC | soot.Modifier.FINAL);
if (!addToClass.declaresField(fieldName, fieldType)) {
 soot.SootField classField = Scene.v().makeSootField(fieldName, fieldType, soot.Modifier.STATIC);
 addToClass.addField(classField);
origin: Sable/soot

public void checkAndSwitch(ValueBox valBox) {
 Value val = valBox.getValue();
 Object finalField = check(val);
 if (finalField != null) {
  // System.out.println("Final field with this value exists"+finalField);
  /*
   * If the final field belongs to the same class then we should supress declaring class
   */
  SootField field = (SootField) finalField;
  if (sootClass.declaresField(field.getName(), field.getType())) {
   // this field is of this class so supress the declaring class
   if (valBox.canContainValue(new DStaticFieldRef(field.makeRef(), true))) {
    valBox.setValue(new DStaticFieldRef(field.makeRef(), true));
   }
  } else {
   if (valBox.canContainValue(new DStaticFieldRef(field.makeRef(), true))) {
    valBox.setValue(new DStaticFieldRef(field.makeRef(), false));
   }
  }
 }
 // else
 // System.out.println("Final field not found");
}
origin: ibinti/bugvm

/**
  Adds the given field to this class.
*/
public void addField(SootField f) 
{
  checkLevel(SIGNATURES);
  if(f.isDeclared())
    throw new RuntimeException("already declared: "+f.getName());
if(declaresField(f.getName()))
    throw new RuntimeException("Field already exists : "+f.getName());
  fields.add(f);
  f.isDeclared = true;
  f.declaringClass = this;
  
}
origin: com.bugvm/bugvm-soot

/**
  Adds the given field to this class.
*/
public void addField(SootField f) 
{
  checkLevel(SIGNATURES);
  if(f.isDeclared())
    throw new RuntimeException("already declared: "+f.getName());
if(declaresField(f.getName()))
    throw new RuntimeException("Field already exists : "+f.getName());
  fields.add(f);
  f.isDeclared = true;
  f.declaringClass = this;
  
}
origin: secure-software-engineering/FlowDroid

public SootField getMessageForIPCField() {
  SootClass sc = iccLink.fromSM.getDeclaringClass();
  if (!sc.declaresField("message_for_ipc_static", RefType.v("android.os.Messenge"))) {
    fieldSendingMessage(iccLink.fromSM);
  }
  return sc.getFieldByName("message_for_ipc_static");
}
origin: com.bugvm/bugvm-soot

private SootField grabField(String fieldSignature)
{
  String cname = signatureToClass( fieldSignature );
  String fname = signatureToSubsignature( fieldSignature );
  if( !containsClass(cname) ) return null;
  SootClass c = getSootClass(cname);
  if( !c.declaresField( fname ) ) return null;
  return c.getField( fname );
}
origin: ibinti/bugvm

private SootField grabField(String fieldSignature)
{
  String cname = signatureToClass( fieldSignature );
  String fname = signatureToSubsignature( fieldSignature );
  if( !containsClass(cname) ) return null;
  SootClass c = getSootClass(cname);
  if( !c.declaresField( fname ) ) return null;
  return c.getField( fname );
}
origin: ibinti/bugvm

if(trace != null) trace.append(
    "Looking in "+cl+" which has fields "+cl.getFields()+"\n" );
if( cl.declaresField(name, type) ) {
  return checkStatic(cl.getField(name, type));
    if(trace != null) trace.append(
        "Looking in "+iface+" which has fields "+iface.getFields()+"\n" );
    if( iface.declaresField(name, type) ) {
      return checkStatic(iface.getField( name, type ));
origin: com.bugvm/bugvm-soot

if(trace != null) trace.append(
    "Looking in "+cl+" which has fields "+cl.getFields()+"\n" );
if( cl.declaresField(name, type) ) {
  return checkStatic(cl.getField(name, type));
    if(trace != null) trace.append(
        "Looking in "+iface+" which has fields "+iface.getFields()+"\n" );
    if( iface.declaresField(name, type) ) {
      return checkStatic(iface.getField( name, type ));
origin: jayhorn/jayhorn

if (sc.declaresField(s)) {
  sc.removeField(sc.getFieldByName(s));
origin: secure-software-engineering/FlowDroid

public void fieldSendingMessage(SootMethod fromSM) {
  SootClass fromC = fromSM.getDeclaringClass();
  if (fromC.declaresField("message_for_ipc_static", RefType.v("android.os.Message"))) {
    return;
  }
  int m = Modifier.PUBLIC | Modifier.STATIC;
  SootField sf = Scene.v().makeSootField("message_for_ipc_static", RefType.v("android.os.Message"), m);
  fromC.addField(sf);
  for (SootMethod sm : fromC.getMethods()) {
    if (sm.isConcrete()) {
      Body body = sm.retrieveActiveBody();
      PatchingChain<Unit> units = body.getUnits();
      for (Iterator<Unit> iter = units.snapshotIterator(); iter.hasNext();) {
        Stmt stmt = (Stmt) iter.next();
        if (stmt.containsInvokeExpr()) {
          SootMethod toBeCheckedMethod = stmt.getInvokeExpr().getMethod();
          if (toBeCheckedMethod.getName().equals("send")
              && equalsOrSubclassOf(toBeCheckedMethod.getDeclaringClass(),
                  Scene.v().getSootClass("android.os.Messenger"))) {
            Value arg0 = stmt.getInvokeExpr().getArg(0);
            Unit assignUnit = Jimple.v().newAssignStmt(Jimple.v().newStaticFieldRef(sf.makeRef()),
                arg0);
            units.insertBefore(assignUnit, stmt);
          }
        }
      }
    }
  }
}
sootSootClassdeclaresField

Javadoc

Does this class declare a field with the given subsignature?

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,
  • isLibraryClass,
  • addField,
  • isAbstract,
  • isPhantom,
  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Notification (javax.management)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Table (org.hibernate.mapping)
    A relational table
  • Option (scala)
  • 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