Add unit tests + make some fixes

This commit is contained in:
Joe Farebrother
2024-01-23 09:38:48 +00:00
parent 8582093e65
commit 6081f18089
10 changed files with 169 additions and 3 deletions

View File

@@ -46,9 +46,9 @@ private class SetTextCall extends MethodCall {
/** A call to a method indicating that the contents of a UI element are safely masked. */
private class MaskCall extends MethodCall {
MaskCall() {
this.getMethod().hasQualifiedName("android.widget", "TextView", "setInputType")
this.getMethod().getAnOverride*().hasQualifiedName("android.widget", "TextView", "setInputType")
or
this.getMethod().hasQualifiedName("android.widget", "view", "setVisibility")
this.getMethod().getAnOverride*().hasQualifiedName("android.view", "View", "setVisibility")
}
}
@@ -66,6 +66,8 @@ private module TextFieldTrackingConfig implements DataFlow::ConfigSig {
predicate isBarrier(DataFlow::Node node) {
node.getType() instanceof PrimitiveType or node.getType() instanceof BoxedType
}
predicate isBarrierIn(DataFlow::Node node) { isSource(node) }
}
/** Holds if the given may be masked. */