INFO5990 Week 5 Tutorial Summary

Part A — 7Cs of Communication

原句

“Hey, project’s late, not sure when it’ll be done. Will let you know.”

改写后

The project is currently behind schedule because some development issues are still being resolved. At this stage, we expect it to be completed by next Wednesday, although this may change depending on testing results. I will provide a confirmed update by Friday.

说明

这句话原本的问题是太随意,也不够清楚。改写以后,信息更完整,语气也更专业。新的表达说明了项目为什么延期、预计什么时候完成,以及下一次更新时间是什么时候。这样更符合 7Cs of Communication 的要求,也就是 clear、concise、complete 和 courteous。


Part B — Stakeholder Mapping

Read more »

漏洞 2:Session 创建时机——登录成功后才生成

代码证据

public void createSession() {
this.editor.putString(KEY_SESSION_TOKEN, generateSessionToken());
this.editor.apply();
}

出处:Login.java,第 174-177 行。


这段代码在做什么

  1. 调用 generateSessionToken() 生成一个 token
  2. putString(KEY_SESSION_TOKEN, token) 把它存进 SharedPreferences
  3. apply() 表示提交写入

关键:谁调用了这个方法

Login.java 的登录按钮点击事件里:

Read more »

漏洞 1:Session Token 角色定义

代码证据

private static final String KEY_SESSION_TOKEN = "sessionToken";
private static final String SESSION_PREF_NAME = "SessionPrefs";
private SharedPreferences.Editor editor;
private SharedPreferences sharedPreferences;

出处:Login.java,第 26-29 行。


逐行解释

代码 含义
KEY_SESSION_TOKEN = "sessionToken" 后面存入手机的 key 叫 "sessionToken"
SESSION_PREF_NAME = "SessionPrefs" 存储文件名是 "SessionPrefs"
SharedPreferences.Editor editor 写入数据的工具
SharedPreferences sharedPreferences 读取数据的工具

这个值是什么

这段代码定义了一个常量: - KEY(键)"sessionToken" - 存储位置SharedPreferences

Read more »