Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused log #694

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,12 @@ private boolean isBypassHookClass(String className) {
}

public boolean isFunctionEnabled(int classId, int methodId) {
String key = classId + "-" + methodId;
Set<String> types = hookTypes.get(key);


if (switchConfig == null || switchConfig.isEmpty()) {
return true;
}
String key = classId + "-" + methodId;
Set<String> types = hookTypes.get(key);

if (types != null) {
for (String type : types) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ public boolean checkReflectEvil(String classname, String fieldname, boolean isMe

JsRuleResult result = SmithProbeObj.getJsRuleEngine().detect(2, argsX);
if (result != null) {
SmithLogger.logger.info("classname = " + classname + ", fieldname = " + fieldname + ", result = " + result.rulename);
SmithLogger.logger.info("classname = " + classname + ", fieldname = " + fieldname + ", result = " + result.ruleid);
// SmithLogger.logger.info("classname = " + classname + ", fieldname = " + fieldname + ", result = " + result.rulename);
// SmithLogger.logger.info("classname = " + classname + ", fieldname = " + fieldname + ", result = " + result.ruleid);
return true;
}
} catch (Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static void loggerProberUnInit() {

if (logger != null) {
logger.removeHandler(fileHandler);
logger = null;
}
fileHandler.close();
fileHandler = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public boolean isMatched(Integer ruleId, boolean isWhite) {
needClearStack = true;
formatStack();
}
SmithLogger.logger.info("isWhite: " + isWhite + " ruleId: " + ruleId);
// SmithLogger.logger.info("isWhite: " + isWhite + " ruleId: " + ruleId);

try {
StackRule stackRule = stackRuleMaps.get(ruleId);
Expand All @@ -223,7 +223,7 @@ public boolean isMatched(Integer ruleId, boolean isWhite) {
for (Map.Entry<Long, String> entry : curStack.entrySet()) {
String value = entry.getValue();
if (value.contains(stack.substring(0, stack.length() - 1))) {
SmithLogger.logger.info("find the match, string: " + value + " hashcode: " + entry.getKey());
// SmithLogger.logger.info("find the match, string: " + value + " hashcode: " + entry.getKey());
return true;
}
}
Expand All @@ -234,7 +234,7 @@ public boolean isMatched(Integer ruleId, boolean isWhite) {
} else {
try {
if (curStack.containsKey(item.getHashcode())) {
SmithLogger.logger.info("find the match, string: " + curStack.get(item.getHashcode()) + " hashcode: " + item.getHashcode());
// SmithLogger.logger.info("find the match, string: " + curStack.get(item.getHashcode()) + " hashcode: " + item.getHashcode());
return true;
}
} catch (Exception e) {
Expand All @@ -253,7 +253,7 @@ public boolean isMatched(Integer ruleId, boolean isWhite) {
}
}

SmithLogger.logger.info("not find the match");
// SmithLogger.logger.info("not find the match");
} catch (Exception e) {
SmithLogger.exception(e);
}
Expand All @@ -266,8 +266,8 @@ public void formatStack() {
}
try {
Map<Long, String> cur1Stack = currentStack.get();
SmithLogger.logger.info("curStack size: " + cur1Stack.size());
SmithLogger.logger.info("now to get current stack");
// SmithLogger.logger.info("curStack size: " + cur1Stack.size());
//SmithLogger.logger.info("now to get current stack");
StackTraceElement[] stack_str = Thread.currentThread().getStackTrace();
String[] stackTraceStrings = new String[stack_str.length];
Map<Long, String> curStack = new HashMap<>();
Expand All @@ -293,9 +293,9 @@ public void clearStack() {
}
try {
Map<Long, String> curStack = currentStack.get();
SmithLogger.logger.info("curStack size: " + curStack.size());
//SmithLogger.logger.info("curStack size: " + curStack.size());
curStack.clear();
SmithLogger.logger.info("clear currentStack");
//SmithLogger.logger.info("clear currentStack");
} catch (Exception e) {
SmithLogger.exception(e);
}
Expand Down
Loading