github / github/codeql

[Java] Some classes were not found in Android project

Ouverte
#11,875 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
question
Langage dominant
CodeQL
Étoiles
10.1k
Forks
2.1k
Merge moyen
2 j 15 h
PR mergées (30 j)
141

Description

1.When we use CodeQL to audit our private project(A), we encountered such a issue: when we use the rule A to query all the methods in android.util.Log, there is no query result.
rule A:
```ql
import java

from Call call, Method method
where call.getCallee() = method and method.getDeclaringType().hasQualifiedName("android.util","Log")
select call.getLocation()
```
But when we use this rule to query other project, the query results are as expected,that is, there is no problem with the rule.

2.On the other hand, when we use the rule B to query all methods that in android.util.Slog in project A, all calling places can be queried.
rule B:
```ql
import java

from Call call, Method method
where call.getCallee() = method and method.getDeclaringType().hasQualifiedName("android.util","Slog")
select call.getLocation()
```

3.The following is the command we used to create the database, in this,we replaced the resource path and module name with xxx and yyy respectively:
`codeql database create --language="java" --source-root= xxx --command="`pwd`/build/soong/soong_ui.bash --make-mode -j128 yyy" -v --overwrite -M 4096 --no-cleanup -- codeql-database/tmp-database`

We don't know what is the difference between android.util.Log and android.util.Slog when building the database,have you ever dealt with such a problem?

There is a suspicious point, I don't know if it is related to this problem. When we use rule A to scan the code in project A, the generated query.csv contains the following information(File “frameworks/base/core/proto/android/util/log.proto” is also used in our project).
`out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars/android/util/Log.java`

Will "android.util.Log" be filtered out because of the use of log.proto? If yes, is there a way to fix this?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.