github / github/codeql

[Java] Some classes were not found in Android project

Đang mở
#11,875 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
question
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

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?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.