Closed connglli closed 6 years ago
First let me answer your questions:
#128
is device-specific as it checks a device-specific context.
if(Build.DEVICE.equalsIgnoreCase("saga")) {
If you check the API guide you will find that this is an identifier for the device model.
0x00040000 is the value of FLAG_EXTERNAL_STORAGE
You may get many problems when using Soot. It seems to me that using the trunk is better for Android analysis. (But still, I seems to find some bugs of Soot when analysing apk files)
@frankFic
@@ -43,11 +43,17 @@
private static final String EXTRA_CALL_LOG_URI = "uri";
// Provider name
public static final String EXTRA_SIP_PROVIDER = "provider";
+ private static final String THIS_FILE = "CallLogHelper";
public static void addCallLog(Context context, ContentValues values, ContentValues extraValues) {
ContentResolver contentResolver = context.getContentResolver();
- Uri result = contentResolver.insert(CallLog.Calls.CONTENT_URI, values);
+ Uri result = null;
+ try {
+ result = contentResolver.insert(CallLog.Calls.CONTENT_URI, values);
+ }catch(IllegalArgumentException e) {
+ Log.w(THIS_FILE, "Cannot insert call log entry. Probably not a phone", e);
+ }
if(result != null) {
// Announce that to other apps
FLAG_EXTERNAL_STORAGE
, but I have no idea that, since FLAG_EXTERNAL_STORAGE
is supported since API level 8, why the original codes use 0x00040000 the constant itself rather that the constant variable FLAG_EXTERNAL_STORAGE
?I see. I checked the revision. I categorized it as device-specific because of the commit log and the exception information. It indicated that "Protect call log helper from device that doesn't have call log db" which suggests an implicit context that the device does not have the call log database.
0x00040000 is exactly the same as FLAG_EXTERNAL_STORAGE so actually it is equivalent to use them. (I found sometimes compiler will directly replace FLAG_EXTERNAL_STORAGE with the constant value at compilation time) The FIC issue here is that on devices lower than API 8, even using the constant value, the app will still not work properly.
Alright, I see! Thanks!
By the way, I may made mistakes when analyzing the data set. Feel free to point them out if you find any
周报
Soot
安装和配置
本周的第一个任务就是对
Soot
进行了快速的了解和学习。虽然只是下一个jar
包而已,但其间也是遇到了一个小坑,这里记录一下。根据官方Wiki的讲解,由于
Soot
有自己的classpath
,因此我们在使用命令行工具的时候需要手动添加$CLASSPATH
或$JAVA_HOME
来解决类似java.lang.Object
无法加载的问题:然而,即使这样也可能会遇到:
查询后发现是 java 版本的问题,在 java 8 下会报这样的错误,解决方案:
Soot
的 nightly build 版本(链接)虽然是个小小的
jar
包,但也是历经一番辛苦才搞好。调研与使用
看了文档后,了解到
Soot
是一个经常用来分析和优化 java/android 应用的工具,提供了诸如等能力,同时提供了四种主要的中间代码表示形式:
详细的使用将在开发阶段进行,这不作为本周的重点。
Issues 的提取
按照上周计划,本打算根据 Lili 学姐论文中提到的数据收集和分析的方法自己进行 issue 的提取,但当打开
CSipSimple
项目对第一个关键词device
进行搜索并欲进行整理和分析的时候,发现搜到的结果竟有 43 次 Commit 和 8 个 issue,考虑到还有14个关键词和4个项目,数量有点大而且不易仔细分析,于是便暂时先放弃了自己进行搜索和分析的想法,暂时先使用学姐给出的 191 个 issue 来优先进行 Model 的提取。可等开发完成后再回头考虑如何能好又快的进行 Issue 的提取。这里暂时先给自己留个坑出来以后填。Model 的提取 - 1.1.1
根据学姐项目主页的数据表,对其中每一个 Issue 都进行了查找和分析,并初步(仅对原因进行了分析,还未进行进一步抽象与提取)得到了以下的 Model(限于时间,目前仅对 CSipSimple 进行了小部分分析,下周会继续):
疑问!!!
为什么 #61 是 Device-Specific 的?其代码修改如下(代码中未体现设备相关性):
#128 代码为什么使用 0x00040000 而非
ApplicationInfo.FLAG_EXTERNAL_STORAGE
既然兼容 API level 8下周计划
心声
FicFinder
的实现也会继续合理安排时间进行,目前进度偏慢,希望后续能有时间和能力加速。