github / github/codeql

[Java] Some classes were not found in Android project

未關閉
#11,875 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

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?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。