@@ -320,46 +320,31 @@ class AndroidIntentInput extends DataFlow::Node {
320320 }
321321}
322322
323- /** Method access to external inputs of `android.content.Intent` object. */
323+ /** Method access to external inputs of `android.content.Intent` or `android.os.BaseBundle` object. */
324324class IntentGetExtraMethodAccess extends MethodAccess {
325325 IntentGetExtraMethodAccess ( ) {
326326 exists ( AndroidComponent ac |
327- this .getEnclosingCallable ( ) .getDeclaringType ( ) = ac and ac .isExported ( )
328- ) and
329- (
327+ this .getEnclosingCallable ( ) .getDeclaringType ( ) = ac and
328+ ac .isExported ( ) and
330329 this .getMethod ( ) .getName ( ) .regexpMatch ( "get\\w+Extra" ) and
331330 this .getMethod ( ) .getDeclaringType ( ) instanceof TypeIntent
332- or
333- this .getMethod ( ) .getName ( ) .regexpMatch ( "get\\w+" ) and
334- this .getQualifier ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "getExtras" ) and
335- this .getQualifier ( ) .( MethodAccess ) .getMethod ( ) .getDeclaringType ( ) instanceof TypeIntent
336331 )
332+ or
333+ this .getMethod ( ) .getName ( ) .regexpMatch ( "get\\w+" ) and
334+ this
335+ .getMethod ( )
336+ .getDeclaringType ( )
337+ .getASupertype * ( )
338+ .hasQualifiedName ( "android.os" , "BaseBundle" )
337339 }
338340}
339341
340342/** Android intent extra source. */
341343private class AndroidIntentExtraSource extends RemoteFlowSource {
342344 AndroidIntentExtraSource ( ) {
343- exists ( MethodAccess ma |
344- ma instanceof IntentGetExtraMethodAccess and
345- this .asExpr ( ) = ma and
346- exists ( AndroidIntentInput inode |
347- (
348- ma .getQualifier ( ) = inode .asExpr ( ) or // extra from intent
349- ma .getQualifier ( ) = inode .asParameter ( ) .getAnAccess ( )
350- )
351- or
352- exists (
353- MethodAccess ema // extra from extras bundle of intent
354- |
355- ema .getMethod ( ) .hasName ( "getExtras" ) and
356- ma .getQualifier ( ) = ema and
357- (
358- ema .getQualifier ( ) = inode .asExpr ( ) or
359- ema .getQualifier ( ) = inode .asParameter ( ) .getAnAccess ( )
360- )
361- )
362- )
345+ exists ( AndroidIntentInput inode |
346+ this .asExpr ( ) = inode .asExpr ( ) or
347+ this .asExpr ( ) = inode .asParameter ( ) .getAnAccess ( )
363348 )
364349 }
365350
0 commit comments