/** * Checks whether check is a visible class in view of the from class. It assumes that protected and private classes do not * exit. If they exist and check is either protected or private, the check will return false. */ public boolean isVisible(SootClass from, SootClass check) { if (check.isPublic()) { return true; } if (check.isProtected() || check.isPrivate()) { return false; } // package visibility return from.getJavaPackageName().equals(check.getJavaPackageName()); }
/** * Returns true if the given method is visible to client code. */ private static boolean visible(SootMethod mPrime) { SootClass cPrime = mPrime.getDeclaringClass(); return (cPrime.isPublic() || cPrime.isProtected() || (!cPrime.isPrivate() && !ASSUME_PACKAGES_SEALED)) && (mPrime.isPublic() || mPrime.isProtected() || (!mPrime.isPrivate() && !ASSUME_PACKAGES_SEALED)); } }