public final String toString() { return getString(); }
public synchronized NumberedString findOrAdd(String s) { NumberedString ret = stringToNumbered.get(s); if (ret == null) { ret = new NumberedString(s); stringToNumbered.put(s, ret); add(ret); } return ret; }
/** * @return yes, if this is a class initializer or main function. */ public boolean isEntryMethod() { if (isStatic() && subsignature.equals(VirtualCalls.v().sigClinit)) { return true; } return isMain(); }
@Override public int hashCode() { final int prime = 31; int result = 1; NumberedString subsig = getSubSignature(); result = prime * result + ((declaringClass == null) ? 0 : declaringClass.hashCode()); result = prime * result + (isStatic ? 1231 : 1237); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((parameterTypes == null) ? 0 : parameterTypes.hashCode()); result = prime * result + ((returnType == null) ? 0 : returnType.hashCode()); result = prime * result + ((subsig == null) ? 0 : subsig.hashCode()); return result; }
String[] split = subSig.getString().replaceAll("(.*) (.*)\\((.*)\\)", "$1;$2;$3").split(";");
public NumberedString find( String s ) { NumberedString ret = stringToNumbered.get( s ); if( ret == null ) { stringToNumbered.put( s, ret = new NumberedString(s) ); add( ret ); } return ret; } public NumberedString findOrAdd( String s ) {
return false; } else if (!subsig.equals(other.getSubSignature())) { return false;
switch (methodRef.declaringClass().getName()) { case "java.lang.reflect.Method": if (methodRef.getSubSignature().getString() .equals("java.lang.Object invoke(java.lang.Object,java.lang.Object[])")) { reflectionModel.methodInvoke(source, s); if (methodRef.getSubSignature().getString().equals("java.lang.Object newInstance()")) { reflectionModel.classNewInstance(source, s); if (methodRef.getSubSignature().getString().equals("java.lang.Object newInstance(java.lang.Object[])")) { reflectionModel.contructorNewInstance(source, s);
public NumberedString findOrAdd( String s ) { NumberedString ret = stringToNumbered.get( s ); if( ret == null ) { stringToNumbered.put( s, ret = new NumberedString(s) ); add( ret ); } return ret; } }
/** * * @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; }
SootMethodRef smr = sie.getMethodRef(); if (sie.getBase().equivTo(thisLocal) && smr.declaringClass().getName().equals(originalSuperclass.getName()) && smr.getSubSignature().getString().startsWith("void " + constructorName)) { SootMethod newSuperInit; if (!mediatingClass.declaresMethod(constructorName, smr.parameterTypes())) {
public NumberedString find( String s ) { NumberedString ret = stringToNumbered.get( s ); if( ret == null ) { stringToNumbered.put( s, ret = new NumberedString(s) ); add( ret ); } return ret; } public NumberedString findOrAdd( String s ) {
public final String toString() { return getString(); } public final String getString() {
public NumberedString findOrAdd( String s ) { NumberedString ret = stringToNumbered.get( s ); if( ret == null ) { stringToNumbered.put( s, ret = new NumberedString(s) ); add( ret ); } return ret; } }
if (callee.getNumberedSubSignature().equals(subsigStartActivityForResult)) { InstanceInvokeExpr iiexpr = (InstanceInvokeExpr) fromStmt.getInvokeExpr(); args.add(iiexpr.getBase());
public final String toString() { return getString(); } public final String getString() {
/** * Checks whether this invocation calls Android's Activity.setContentView method * * @param inv * The invocaton to check * @return True if this invocation calls setContentView, otherwise false */ protected boolean invokesSetContentView(InvokeExpr inv) { String methodName = SootMethodRepresentationParser.v() .getMethodNameFromSubSignature(inv.getMethodRef().getSubSignature().getString()); if (!methodName.equals("setContentView")) return false; // In some cases, the bytecode points the invocation to the current // class even though it does not implement setContentView, instead // of using the superclass signature SootClass curClass = inv.getMethod().getDeclaringClass(); while (curClass != null) { if (curClass.getName().equals("android.app.Activity") || curClass.getName().equals("android.support.v7.app.ActionBarActivity") || curClass.getName().equals("android.support.v7.app.AppCompatActivity")) return true; if (curClass.declaresMethod("void setContentView(int)")) return false; curClass = curClass.hasSuperclass() ? curClass.getSuperclass() : null; } return false; }
/** * Checks whether this invocation calls Android's LayoutInflater.inflate method * * @param inv * The invocaton to check * @return True if this invocation calls inflate, otherwise false */ protected boolean invokesInflate(InvokeExpr inv) { String methodName = SootMethodRepresentationParser.v() .getMethodNameFromSubSignature(inv.getMethodRef().getSubSignature().getString()); if (!methodName.equals("inflate")) return false; // In some cases, the bytecode points the invocation to the current // class even though it does not implement setContentView, instead // of using the superclass signature SootClass curClass = inv.getMethod().getDeclaringClass(); while (curClass != null) { if (curClass.getName().equals("android.app.Fragment")) return true; if (curClass.declaresMethod("android.view.View inflate(int,android.view.ViewGroup,boolean)")) return false; curClass = curClass.hasSuperclass() ? curClass.getSuperclass() : null; } return false; }
final String subSig = stmt.getInvokeExpr().getMethodRef().getSubSignature().getString(); boolean taintEqualsHashCode = alwaysModelEqualsHashCode && (subSig.equals("boolean equals(java.lang.Object)") || subSig.equals("int hashCode()"));