@Deprecated public static boolean isApplicationClass(IClass clazz) { // we need the additional check as framework classes from the support package are loaded via the Application classloader return clazz.getClassHierarchy().getScope().isApplicationLoader(clazz.getClassLoader()) && !clazz.getName().toString().startsWith("Landroid"); // strip android.v4 / android.v7 support packages as they are considered part of the framework // TODO necessary? support packages are loaded via Primordial! }
private boolean isRelevantMethod(IMethod target) { return !target.isAbstract() && (!applicationOnly || cha.getScope().isApplicationLoader(target.getDeclaringClass().getClassLoader())); }
private boolean isRelevantMethod(IMethod target) { return !target.isAbstract() && (!applicationOnly || cha.getScope().isApplicationLoader(target.getDeclaringClass().getClassLoader())); }
public static boolean isAppClass(IClass clazz) { // Normalization: // filter empty dummy classes // possibly related too: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4295934 boolean isEmptyInnerClass = WalaUtils.isInnerClass(clazz) && isAnonymousInnerClass(clazz) && (clazz.getDeclaredMethods().isEmpty() || (clazz.getDeclaredMethods().size() == 1 && clazz.getDeclaredMethods().iterator().next().isClinit()) && clazz.getDeclaredInstanceFields().isEmpty() && clazz.getDeclaredStaticFields().isEmpty() && clazz.getDirectInterfaces().isEmpty()); return clazz.getClassHierarchy().getScope().isApplicationLoader(clazz.getClassLoader()) && !isAndroidResourceClass(clazz) && !isEmptyInnerClass && !clazz.isSynthetic(); }
public static int countApplicationNormals(Collection<Statement> slice) { int count = 0; for (Statement s : slice) { if (s.getKind().equals(Statement.Kind.NORMAL)) { AnalysisScope scope = s.getNode().getClassHierarchy().getScope(); if (scope.isApplicationLoader(s.getNode().getMethod().getDeclaringClass().getClassLoader())) { count++; } } } return count; } public static int countConditionals(Collection<Statement> slice) {
public static int countApplicationAllocations(Collection<Statement> slice) { int count = 0; for (Statement s : slice) { if (s.getKind().equals(Statement.Kind.NORMAL)) { NormalStatement ns = (NormalStatement) s; if (ns.getInstruction() instanceof SSANewInstruction) { AnalysisScope scope = s.getNode().getClassHierarchy().getScope(); if (scope.isApplicationLoader(s.getNode().getMethod().getDeclaringClass().getClassLoader())) { count++; } } } } return count; }