Skip to content

Commit

Permalink
Merge pull request #617 from bytedance/fix-cloader
Browse files Browse the repository at this point in the history
Fix cloader
  • Loading branch information
yoloyyh committed May 22, 2024
2 parents 4e3f188 + 572fa71 commit 1ee508c
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public static Object getSmithProbeProxy() {
return SmithProberProxyObj;
}

public static Object getSmithProbe() {
return SmithProberObj;
}

public static void PreProxy(Object MethodNameObj,int classID, int methodID, Object[] args) {

if(SmithProberProxyObj != null) {
Expand Down Expand Up @@ -73,6 +77,17 @@ public static Object ExceptionProxy(Object MethodNameObj,int classID, int method
return null;
}

public static Object PassProxyToProbe(Object Obj,Object MethodNameObj,int functionID, Object[] args) {

if(Obj != null) {
String MethodName = (String)MethodNameObj;
Class<?>[] argType = new Class[]{int.class,int.class,Object[].class};
return Reflection.invokeMethod(Obj,MethodName,argType,functionID,args);
}

return null;
}

private static boolean loadSmithProber(String proberPath, Instrumentation inst) {
boolean bret = false;
boolean bexception = false;
Expand Down Expand Up @@ -268,13 +283,11 @@ public static void agentmain(String agentArgs, Instrumentation inst) {
SmithAgentLogger.logger.info("checksumStr:" + checksumStr);
SmithAgentLogger.logger.info("proberPath:" + proberPath);

/*
if (!JarUtil.checkJarFile(proberPath,checksumStr)) {
System.setProperty("smith.status", proberPath + " check fail");
SmithAgentLogger.logger.warning(proberPath + " check fail!");
return ;
}
*/

if(instrumentation == null) {
instrumentation = inst;
Expand Down

0 comments on commit 1ee508c

Please sign in to comment.