Apply code review suggestions

This commit is contained in:
Tony Torralba
2022-01-19 15:48:56 +01:00
parent 57ff13dd19
commit 6a4d2ee850
2 changed files with 6 additions and 3 deletions

View File

@@ -271,7 +271,7 @@ class ExportedAndroidContentProviderInput extends RemoteFlowSource, AndroidConte
* calls `startActivityForResult` with an implicit Intent.
*/
class OnActivityResultIntentSource extends OnActivityResultIncomingIntent, RemoteFlowSource {
OnActivityResultIntentSource() { isRemoteSource() }
OnActivityResultIntentSource() { this.isRemoteSource() }
override string getSourceType() { result = "Android onActivityResult incoming Intent" }
}

View File

@@ -42,11 +42,14 @@ class OnActivityResultIncomingIntent extends DataFlow::Node {
// and the activity it belongs to defines `onActivityResult`.
exists(MethodAccess ma |
ma.getMethod().hasName(["add", "attach", "replace"]) and
ma.getMethod().getDeclaringType().hasName("FragmentTransaction") and
ma.getMethod().getDeclaringType().hasQualifiedName("android.app", "FragmentTransaction") and
any(Argument arg | arg = ma.getAnArgument()).getType() = startingType
or
ma.getMethod().hasName("show") and
ma.getMethod().getDeclaringType().getASupertype*().hasName("DialogFragment") and
ma.getMethod()
.getDeclaringType()
.getASupertype*()
.hasQualifiedName("android.app", "DialogFragment") and
startingType = ma.getQualifier().getType()
|
ma.getEnclosingCallable().getDeclaringType() =