github / github/codeql

[Java] Some classes were not found in Android project

Aperta
#11,875 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.