Java 类soot.jimple.infoflow.entryPointCreators.AndroidEntryPointConstants 实例源码

项目:soot-infoflow-android-iccta    文件:Component.java   
public static ComponentType getComponentType(SootClass currentClass) 
   {
    ComponentType type = ComponentType.Plain;
    List<SootClass> extendedClasses = Scene.v().getActiveHierarchy().getSuperclassesOf(currentClass);
    for(SootClass sc : extendedClasses) {
        if(sc.getName().equals(AndroidEntryPointConstants.APPLICATIONCLASS))
            type = ComponentType.Application;
        else if(sc.getName().equals(AndroidEntryPointConstants.ACTIVITYCLASS))
            type = ComponentType.Activity;
        else if(sc.getName().equals(AndroidEntryPointConstants.SERVICECLASS))
            type = ComponentType.Service;
        else if(sc.getName().equals(AndroidEntryPointConstants.BROADCASTRECEIVERCLASS))
            type = ComponentType.BroadcastReceiver;
        else if(sc.getName().equals(AndroidEntryPointConstants.CONTENTPROVIDERCLASS))
            type = ComponentType.ContentProvider;
    }

    return type;
}
项目:ic3-dialdroid    文件:EntryPointMappingSceneTransformer.java   
private boolean addLifecycleMethods(SootClass entryPointClass,
    List<MethodOrMethodContext> callbacks) {
  boolean result = true;
  Hierarchy hierarchy = Scene.v().getActiveHierarchy();

  if (hierarchy.isClassSubclassOf(entryPointClass, activityClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getActivityLifecycleMethods(), callbacks);
  } else if (hierarchy.isClassSubclassOf(entryPointClass, gcmBaseIntentServiceClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getGCMIntentServiceMethods(), callbacks);
  } else if (hierarchy.isClassSubclassOf(entryPointClass, serviceClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getServiceLifecycleMethods(), callbacks);
  } else if (hierarchy.isClassSubclassOf(entryPointClass, receiverClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getBroadcastLifecycleMethods(), callbacks);
  } else if (hierarchy.isClassSubclassOf(entryPointClass, providerClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getContentproviderLifecycleMethods(), callbacks);
  } else if (hierarchy.isClassSubclassOf(entryPointClass, applicationClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getApplicationLifecycleMethods(), callbacks);
  } else {
    System.err.println("Unknown entry point type: " + entryPointClass);
    result = false;
  }

  return result;
}
项目:ic3    文件:EntryPointMappingSceneTransformer.java   
private boolean addLifecycleMethods(SootClass entryPointClass,
    List<MethodOrMethodContext> callbacks) {
  boolean result = true;
  Hierarchy hierarchy = Scene.v().getActiveHierarchy();

  if (hierarchy.isClassSubclassOf(entryPointClass, activityClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getActivityLifecycleMethods(), callbacks);
  } else if (hierarchy.isClassSubclassOf(entryPointClass, gcmBaseIntentServiceClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getGCMIntentServiceMethods(), callbacks);
  } else if (hierarchy.isClassSubclassOf(entryPointClass, serviceClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getServiceLifecycleMethods(), callbacks);
  } else if (hierarchy.isClassSubclassOf(entryPointClass, receiverClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getBroadcastLifecycleMethods(), callbacks);
  } else if (hierarchy.isClassSubclassOf(entryPointClass, providerClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getContentproviderLifecycleMethods(), callbacks);
  } else if (hierarchy.isClassSubclassOf(entryPointClass, applicationClass)) {
    addLifecycleMethodsHelper(entryPointClass,
        AndroidEntryPointConstants.getApplicationLifecycleMethods(), callbacks);
  } else {
    System.err.println("Unknown entry point type: " + entryPointClass);
    result = false;
  }

  return result;
}
项目:soot-infoflow-android-iccta    文件:ICCDummyMainCreator.java   
private List<String> getCallbackFunctions(SootClass sc)
{
    List<String> callbacks = new ArrayList<String>();

    for (SootMethod sm : sc.getMethods())
    {
        //<init> and <cinit>
        if (sm.getName().contains("init>"))
        {
            continue;
        }

        ComponentType compType = Component.getComponentType(sc);
        switch (compType)
        {
        case Activity:
            if (AndroidEntryPointConstants.getActivityLifecycleMethods().contains(sm.getName()))
            {
                continue;
            }

            break;
        case Service:
            if (AndroidEntryPointConstants.getServiceLifecycleMethods().contains(sm.getName()))
            {
                continue;
            }
            break;
        case BroadcastReceiver:
            if (AndroidEntryPointConstants.getBroadcastLifecycleMethods().contains(sm.getName()))
            {
                continue;
            }
            break;
        case ContentProvider:
            if (AndroidEntryPointConstants.getContentproviderLifecycleMethods().contains(sm.getName()))
            {
                continue;
            }
            break;
        default:
            break;
        }

        if (! isPotentialCallbackMethod(sc, sm.getName()))
        {
            continue;
        }

        callbacks.add(sm.getSignature());
    }

    callbacks.addAll(getAnonymousCallbacks(sc));

    return callbacks;
}