@Override public boolean isAccessible(SootMethod method) { return method.isPublic() || method.isProtected(); }
private boolean isRenamingAllowed(SootMethod method) { if (soot.jbco.Main.getWeight(MethodRenamer.name, method.getSignature()) == 0) { return false; } final String subSignature = method.getSubSignature(); if (MAIN_METHOD_SUB_SIGNATURE.equals(subSignature) && method.isPublic() && method.isStatic()) { if (isVerbose()) { logger.info("Skipping renaming \"{}\" method as it is main one.", subSignature); } return false; // skip the main method } if (method.getName().equals(SootMethod.constructorName) || method.getName().equals(SootMethod.staticInitializerName)) { if (isVerbose()) { logger.info("Skipping renaming \"{}\" method as it is constructor or static initializer.", subSignature); } return false; // skip constructors/initializers } return true; }
/** * * @return yes if this is the main method */ public boolean isMain() { if (isPublic() && isStatic()) { NumberedString main_sig = Scene.v().getSubSigNumberer().findOrAdd("void main(java.lang.String[])"); if (main_sig.equals(subsignature)) { return true; } } return false; }
/** * 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)); } }
/** Returns true if the method m is visible from code in the class from. */ private boolean isVisible(SootClass from, SootMethod m) { from.checkLevel(SootClass.HIERARCHY); if (m.isPublic()) { return true; } if (m.isPrivate()) { return from.equals(m.getDeclaringClass()); } if (m.isProtected()) { return canStoreClass(from, m.getDeclaringClass()); } // m is package return from.getJavaPackageName().equals(m.getDeclaringClass().getJavaPackageName()); // || canStoreClass( from, m.getDeclaringClass() ); }
while (methodIterator.hasNext()) { SootMethod n = methodIterator.next(); if (!n.isPublic()) { continue;
if (!constructor.isPublic()) { debug("Default constructor is not public."); return;
if (!inlinee.isPrivate() && !inlinee.isProtected() && !inlinee.isPublic()) { if (!inlineeClass.getPackageName().equals(containerClass.getPackageName())) { return true;
} else { SootMethod m = implMethod.getMethodRef().resolve(); if (!m.isPublic()) {
if (subSig.equals("void main(java.lang.String[])") && method.isPublic() && method.isStatic()) { continue; // skip the main method - it needs to be named 'main' } else if (subSig.indexOf("init>(") > 0) {
/** * * @return yes if this is the main method */ public boolean isMain() { if ( isPublic() && isStatic() ) { NumberedString main_sig = Scene.v().getSubSigNumberer().findOrAdd( "void main(java.lang.String[])" ); if ( main_sig.equals( subsignature ) ) return true; } return false; }
/** * * @return yes if this is the main method */ public boolean isMain() { if ( isPublic() && isStatic() ) { NumberedString main_sig = Scene.v().getSubSigNumberer().findOrAdd( "void main(java.lang.String[])" ); if ( main_sig.equals( subsignature ) ) return true; } return false; }
/** * Checks whether the given method shall be included in summary generation. If * so, it is added to the analysis task * * @param analysisTask The analysis task to which to add the method * @param sm The method to analyze * @return True if the method is to be analyzed, false otherwise */ private boolean checkAndAdd(ClassAnalysisTask analysisTask, SootMethod sm) { if (!sm.isConcrete()) return false; if (!sm.isPublic() && !sm.isProtected()) return false; // We normally don't analyze hashCode() and equals() final String sig = sm.getSignature(); if (!config.getSummarizeHashCodeEquals()) { if (sig.equals("int hashCode()") || sig.equals("boolean equals(java.lang.Object)")) return false; } analysisTask.addMethod(sig); return true; }
/** Returns true if the method m is visible from code in the class from. */ private boolean isVisible( SootClass from, SootMethod m ) { from.checkLevel(SootClass.HIERARCHY); if( m.isPublic() ) return true; if( m.isPrivate() ) { return from.equals( m.getDeclaringClass() ); } if( m.isProtected() ) { return canStoreClass( from, m.getDeclaringClass() ); } // m is package return from.getJavaPackageName().equals( m.getDeclaringClass().getJavaPackageName() ); //|| canStoreClass( from, m.getDeclaringClass() ); }
/** Returns true if the method m is visible from code in the class from. */ private boolean isVisible( SootClass from, SootMethod m ) { from.checkLevel(SootClass.HIERARCHY); if( m.isPublic() ) return true; if( m.isPrivate() ) { return from.equals( m.getDeclaringClass() ); } if( m.isProtected() ) { return canStoreClass( from, m.getDeclaringClass() ); } // m is package return from.getJavaPackageName().equals( m.getDeclaringClass().getJavaPackageName() ); //|| canStoreClass( from, m.getDeclaringClass() ); }
/** Returns true if the method m is visible from code in the class from. */ public boolean isVisible( SootClass from, SootMethod m ) { from.checkLevel(SootClass.HIERARCHY); m.getDeclaringClass().checkLevel(SootClass.HIERARCHY); if( m.isPublic() ) return true; if( m.isPrivate() ) { return from.equals( m.getDeclaringClass() ); } if( m.isProtected() ) { return isClassSubclassOfIncluding( from, m.getDeclaringClass() ); } // m is package return from.getJavaPackageName().equals( m.getDeclaringClass().getJavaPackageName() ); //|| isClassSubclassOfIncluding( from, m.getDeclaringClass() ); }
/** Returns true if the method m is visible from code in the class from. */ public boolean isVisible( SootClass from, SootMethod m ) { from.checkLevel(SootClass.HIERARCHY); m.getDeclaringClass().checkLevel(SootClass.HIERARCHY); if( m.isPublic() ) return true; if( m.isPrivate() ) { return from.equals( m.getDeclaringClass() ); } if( m.isProtected() ) { return isClassSubclassOfIncluding( from, m.getDeclaringClass() ); } // m is package return from.getJavaPackageName().equals( m.getDeclaringClass().getJavaPackageName() ); //|| isClassSubclassOfIncluding( from, m.getDeclaringClass() ); }