Skip to content

Commit 6096080

Browse files
committed
Use all possible packages for Fragment classes
Also fix stub
1 parent 3c9fac0 commit 6096080

File tree

2 files changed

+6
-1973
lines changed

2 files changed

+6
-1973
lines changed

java/ql/lib/semmle/code/java/frameworks/android/OnActivityResultSource.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,18 @@ class OnActivityResultIncomingIntent extends DataFlow::Node {
4242
// and the activity it belongs to defines `onActivityResult`.
4343
exists(MethodAccess ma |
4444
ma.getMethod().hasName(["add", "attach", "replace"]) and
45-
ma.getMethod().getDeclaringType().hasQualifiedName("android.app", "FragmentTransaction") and
45+
ma.getMethod()
46+
.getDeclaringType()
47+
.hasQualifiedName(["android.app", "android.support.v4.app", "androidx.fragment.app"],
48+
"FragmentTransaction") and
4649
any(Argument arg | arg = ma.getAnArgument()).getType() = startingType
4750
or
4851
ma.getMethod().hasName("show") and
4952
ma.getMethod()
5053
.getDeclaringType()
5154
.getASupertype*()
52-
.hasQualifiedName("android.app", "DialogFragment") and
55+
.hasQualifiedName(["android.app", "android.support.v4.app", "androidx.fragment.app"],
56+
"DialogFragment") and
5357
startingType = ma.getQualifier().getType()
5458
|
5559
ma.getEnclosingCallable().getDeclaringType() =

0 commit comments

Comments
 (0)