Filter out Session ID on new log pipe

This commit is contained in:
Duy Tran Khanh 2021-06-22 09:47:16 +07:00 committed by GitHub
parent ab8c1e74e4
commit 9e4d4de70d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,11 +4,18 @@ import java.util.Map;
public abstract class LoggableActivity extends BaseActivity { public abstract class LoggableActivity extends BaseActivity {
public Map<String, String> jreReleaseList; public Map<String, String> jreReleaseList;
public boolean filteredSessionID = false;
public void appendToLog(String text) { public void appendToLog(String text) {
appendToLog(text, true); appendToLog(text, true);
} }
public void appendlnToLog(String text) { public void appendlnToLog(String text) {
// Filter out Session ID here
if (!filteredSessionID && (index = text.indexOf("(Session ID is ")) != -1) {
text = text.substring(0, index) + "(Session ID is <censored>)";
filteredSessionID = true;
}
appendlnToLog(text, true); appendlnToLog(text, true);
} }