important:string 当非空时,表示通知 ficfinder,当 important 对应的 context 的条件检测到时,不需要进行 validate,如果 detect 到,直接报告。
如:
{
"api": {
"@type": "method",
"pkg": "android.view",
"iface": "View",
"method": "setFocusableInTouchMode",
"ret": {
"pkg": "",
"iface": "void"
},
"paramList": [
{
"pkg": "",
"iface": "boolean"
}
]
},
"context": {
"min_api_level": 8,
"important": "min_api_level",
"message": "this api is recommended to be used together with `void setFocusable(boolean)` when your app is running on Froyo(2.2) or lower. Check https://issuetracker.google.com/issues/36908479 for more help"
}
},
{
"api": {
"@type": "method",
"pkg": "android.widget",
"iface": "RemoteViews",
"method": "setViewVisibility",
"ret": {
"pkg": "",
"iface": "void"
},
"paramList": [
{
"pkg": "",
"iface": "int"
},
{
"pkg": "",
"iface": "int"
}
]
},
"context": {
"min_api_level": 8,
"important": "min_api_level",
"message": "this api is not recommended to be used together with progress bar when your app is running on Froyo(2.2) or lower. If you have to use it on Froyo(2.2) or lower, try to wrap the progress bar in a LinearLayout or FrameLayout and use setViewVisibility() to make the Layout INVISIBLE/GONE instead of the progress bar. Check https://issuetracker.google.com/issues/36921090 for more help"
}
},
{
"api": {
"@type": "method",
"pkg": "android.content",
"iface": "ContentProvider",
"method": "query",
"ret": {
"pkg": "android.database",
"iface": "Cursor"
},
"paramList": [
{
"pkg": "android.net",
"iface": "Uri"
},
{
"pkg": "java.lang",
"iface": "String[]"
},
{
"pkg": "android.os",
"iface": "Bundle"
},
{
"pkg": "android.os",
"iface": "CancellationSignal"
}
]
},
"context": {
"max_api_level": 23,
"important": "max_api_level",
"message": "this api is recommended to be used together with the permission controll when your app is running on android 23 or higher. Check https://github.com/ankidroid/Anki-Android/commit/f5fab36ce309ce2d1e327cfc3fb59db85c609f96 for more help"
}
},
{
"api": {
"@type": "method",
"pkg": "android.content",
"iface": "ContentProvider",
"method": "update",
"ret": {
"pkg": "",
"iface": "int"
},
"paramList": [
{
"pkg": "android.net",
"iface": "Uri"
},
{
"pkg": "android.content",
"iface": "ContentValues"
},
{
"pkg": "java.lang",
"iface": "String"
},
{
"pkg": "java.lang",
"iface": "String[]"
}
]
},
"context": {
"max_api_level": 23,
"important": "max_api_level",
"message": "this api is recommended to be used together with the permission controll when your app is running on android 23 or higher. Check https://github.com/ankidroid/Anki-Android/commit/f5fab36ce309ce2d1e327cfc3fb59db85c609f96 for more help"
}
},
{
"api": {
"@type": "method",
"pkg": "android.content",
"iface": "ContentProvider",
"method": "insert",
"ret": {
"pkg": "android.net",
"iface": "Uri"
},
"paramList": [
{
"pkg": "android.net",
"iface": "Uri"
},
{
"pkg": "java.lang",
"iface": "String"
},
{
"pkg": "java.lang",
"iface": "String[]"
}
]
},
"context": {
"max_api_level": 23,
"important": "max_api_level",
"message": "this api is recommended to be used together with the permission controll when your app is running on android 23 or higher. Check https://github.com/ankidroid/Anki-Android/commit/f5fab36ce309ce2d1e327cfc3fb59db85c609f96 for more help"
}
},
{
"api": {
"@type": "method",
"pkg": "android.content",
"iface": "ContentProvider",
"method": "delete",
"ret": {
"pkg": "",
"iface": "int"
},
"paramList": [
{
"pkg": "android.net",
"iface": "Uri"
},
{
"pkg": "android.content",
"iface": "ContentValues"
},
]
},
"context": {
"max_api_level": 23,
"important": "max_api_level",
"message": "this api is recommended to be used together with the permission controll when your app is running on android 23 or higher. Check https://github.com/ankidroid/Anki-Android/commit/f5fab36ce309ce2d1e327cfc3fb59db85c609f96 for more help"
}
},
{
"api": {
"@type": "method",
"pkg": "android.content",
"iface": "ContentProvider",
"method": "bulkInsert",
"ret": {
"pkg": "",
"iface": "int"
},
"paramList": [
{
"pkg": "android.net",
"iface": "Uri"
},
{
"pkg": "android.content",
"iface": "ContentValues[]"
},
]
},
"context": {
"max_api_level": 23,
"important": "max_api_level",
"message": "this api is recommended to be used together with the permission controll when your app is running on android 23 or higher. Check https://github.com/ankidroid/Anki-Android/commit/f5fab36ce309ce2d1e327cfc3fb59db85c609f96 for more help"
}
},
{
"api": {
"@type": "method",
"pkg": "android.content",
"iface": "ContentValues",
"method": "put",
"ret": {
"pkg": "",
"iface": "void"
},
"paramList": [
{
"pkg": "java.lang",
"iface": "String"
},
{
"pkg": "java.lang",
"iface": "Short"
}
]
},
"context": {
"bad_devices": [
"saga"
],
"important": "bad_devices",
"message": "this api is recommended to be used together with cv.put(Data.RAW_CONTACT_ID, someId) when your app is running one HTC desire S series. Check https://github.com/r3gis3r/CSipSimple/blob/340eea18b5143d1ff0c33c5fab4b5be272689203/src/com/csipsimple/utils/CallLogHelper.java for more help"
}
},
:white_check_mark: AsyncTask.execute 对 empirical 分析不准确,以及对 android api doc 阅读不仔细,导致之前的 model.json 里没加入。android api doc 里显示这个 API 在 API level 1 就加入了,但同时也显示,从 API level 11 开始,这个 API 不提供真正的并行能力。
:white_check_mark: AlarmManager.set 对 empirical 分析不准确,以及对 android api doc 阅读不仔细,导致之前的 model.json 里没加入;findCallSites 方法错误地把其所在的类当成第三方库过滤掉了。android api doc 里显示这个 API 在 API level 19 后无法保证设置时间的准确性,在对时间准确性要求极高的 app 中不应该使用这个 API,应该考虑使用 setExact/setWindow。
:exclamation: support.v7.setSupportActionBar 对 empirical 分析不准确,这是一个 device specific 的 API,导致之前的 model.json 里没加入。这个 API 会使得部分三星手机挂掉。
周报
这周的工作就按照上周所说的:
因为这周的工作比较零碎,所以以单条列在下面,其中 :white_check_mark: 表示发现并已经完成的部分,:exclamation: 根据优先级(越多表示优先级越高)表示发现并且正在进行/还未进行的工作。
:white_check_mark: 需要在 ApiContext 的 context 里加入新的标记
message:string
用于打印一些针对该 acpair 想要输出的信息。important:string
当非空时,表示通知 ficfinder,当important
对应的 context 的条件检测到时,不需要进行 validate,如果 detect 到,直接报告。如:
其他的还有
setFocusable
/setFocusableInTouchMode
。:white_check_mark: 所有的
IssueHandle
改一下,统一放到一块儿,ApiContext
加一个report(Out)
方法,用于对 ApiContext 进行报告,IssueHandle
仅仅报告 Issue 相关的,而不报告 ApiContext 相关的。改成类似于::white_check_mark: 与 2 相关,需要加一个配置选项
—out
用于对 technique report 进行重定向输出。:white_check_mark: 与 2 相关,
PubSub
加入默认实现,即Tracker
的实现,放到utils
下,同时修改Tracker
仅继承自PubSub
而已,放到core.finder
下。:white_check_mark: 与 2 相关,加入一个默认的
Handle
类,在core.tracker
的tracker
中其中包含域PrintStream out
用于输出,把所有的IssueHandle
继承自它。:white_check_mark: 结构:
:white_check_mark: 根据 valgrind 的输出格式重新整理输出格式,方便开发者查阅,主要是进行 api 合并。
:exclamation: 加一个
max_version
选项,用于配置当前最大 android 版本环境。:exclamation::exclamation: program slicing 的时候还需要加入
<clinit>
(类的static
代码块) 的代码,有些开发者会利用这个特性检查是否可用。:exclamation::exclamation: 主要的问题:1. acpair 分析的还是少,不够。 2. program slicing 还是有问题。
:exclamation::exclamation::exclamation: ==任务== 注释掉
validate()
只用detect
和generate
先查看能报出多少 ,解决后再考虑validate
的问题。:exclamation:
PrintStream.close()
别忘了。:exclamation: 把测试代码放到
fic-finder/test
下,不要太分散。:exclamation: 加一个
verbose
选项,用于输出所有的调用链信息,如果没有verbose
仅输出最近一次的调用(即调用点,从而简化输出)。:exclamation::exclamation: 优化:
Issue
里存的调用链不要用链表了,用树表示,既方便 13,又省内存。:exclamation: 升级 Soot 到 3.0.0,FlowDroid 到 develop 版本,使用最新的日志系统,把 Soot 和 FlowDroid 输出的所有 debug 的东西都给关了。
:exclamation: 找一个可以移除第三方库代码的 jar 工具,用到
Soots.findCallSites
里。