Java Code Examples for com.android.reverse.util.RefInvoke#findMethodExact()

The following examples show how to use com.android.reverse.util.RefInvoke#findMethodExact() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ActivityThreadHook.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	// TODO Auto-generated method stub
	try {
		Class receiverDataClass = Class.forName("android.app.ActivityThread$ReceiverData");
		if (receiverDataClass != null) {
			Method handleReceiverMethod = RefInvoke.findMethodExact("android.app.ActivityThread", ClassLoader.getSystemClassLoader(),
					"handleReceiver", receiverDataClass);
			hookhelper.hookMethod(handleReceiverMethod, new AbstractBahaviorHookCallBack() {

				@Override
				public void descParam(HookParam param) {
					Logger.log_behavior("The Receiver Information:");
					Object data = param.args[0];
					Logger.log_behavior(data.toString());
					
				}
			});
		}
	} catch (ClassNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
Example 2
Source File: ActivityThreadHook.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	// TODO Auto-generated method stub
	try {
		Class receiverDataClass = Class.forName("android.app.ActivityThread$ReceiverData");
		if (receiverDataClass != null) {
			Method handleReceiverMethod = RefInvoke.findMethodExact("android.app.ActivityThread", ClassLoader.getSystemClassLoader(),
					"handleReceiver", receiverDataClass);
			hookhelper.hookMethod(handleReceiverMethod, new AbstractBahaviorHookCallBack() {

				@Override
				public void descParam(HookParam param) {
					Logger.log_behavior("The Receiver Information:");
					Object data = param.args[0];
					Logger.log_behavior(data.toString());
					
				}
			});
		}
	} catch (ClassNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
Example 3
Source File: ConnectivityManagerHook.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	
	Method setMobileDataEnabledmethod = RefInvoke.findMethodExact(
			"android.net.ConnectivityManager", ClassLoader.getSystemClassLoader(),
			"setMobileDataEnabled",boolean.class);
	hookhelper.hookMethod(setMobileDataEnabledmethod, new AbstractBahaviorHookCallBack() {
		
		@Override
		public void descParam(HookParam param) {
			boolean status = (Boolean) param.args[0];
			Logger.log("Set MobileDataEnabled = "+status);
		}
	});
	
}
 
Example 4
Source File: ConnectivityManagerHook.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	
	Method setMobileDataEnabledmethod = RefInvoke.findMethodExact(
			"android.net.ConnectivityManager", ClassLoader.getSystemClassLoader(),
			"setMobileDataEnabled",boolean.class);
	hookhelper.hookMethod(setMobileDataEnabledmethod, new AbstractBahaviorHookCallBack() {
		
		@Override
		public void descParam(HookParam param) {
			boolean status = (Boolean) param.args[0];
			Logger.log("Set MobileDataEnabled = "+status);
		}
	});
	
}
 
Example 5
Source File: ContextImplHook.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	// TODO Auto-generated method stub
	Method registerReceivermethod = RefInvoke.findMethodExact(
			"android.app.ContextImpl", ClassLoader.getSystemClassLoader(),
			"registerReceiver", BroadcastReceiver.class,IntentFilter.class);
	hookhelper.hookMethod(registerReceivermethod, new AbstractBahaviorHookCallBack() {
		
		@Override
		public void descParam(HookParam param) {
			// TODO Auto-generated method stub				
			Logger.log_behavior("Register BroatcastReceiver");
			Logger.log_behavior("The BroatcastReceiver ClassName = "+param.args[0].getClass().toString());
			if(param.args[1] != null){
			   String intentstr = descIntentFilter((IntentFilter) param.args[1]);
			   Logger.log_behavior("Intent Action = ["+intentstr+"]");
			}
		}
	});
}
 
Example 6
Source File: AudioRecordHook.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	// TODO Auto-generated method stub
	Method startRecordingMethod = RefInvoke.findMethodExact(
			"android.media.AudioRecord", ClassLoader.getSystemClassLoader(),
			"startRecording");
	hookhelper.hookMethod(startRecordingMethod, new AbstractBahaviorHookCallBack() {
		
		@Override
		public void descParam(HookParam param) {
			// TODO Auto-generated method stub
			Logger.log_behavior("Audio Recording ->");
		}
	});
	
}
 
Example 7
Source File: ProcessBuilderHook.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	// TODO Auto-generated method stub
	Method execmethod = RefInvoke.findMethodExact(
			"java.lang.ProcessBuilder", ClassLoader.getSystemClassLoader(),
			"start");
	hookhelper.hookMethod(execmethod, new AbstractBahaviorHookCallBack() {			
		@Override
		public void descParam(HookParam param) {
			// TODO Auto-generated method stub
			Logger.log_behavior("Create New Process ->");
			ProcessBuilder pb = (ProcessBuilder) param.thisObject;
			List<String> cmds = pb.command();
			StringBuilder sb = new StringBuilder();
			for(int i=0 ;i <cmds.size(); i++){
			   sb.append("CMD"+i+":"+cmds.get(i)+" ");
			}
			Logger.log_behavior("Command" + sb.toString());
		}
	});
}
 
Example 8
Source File: ActivityThreadHook.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	try {
		Class receiverDataClass = Class.forName("android.app.ActivityThread$ReceiverData");
		if (receiverDataClass != null) {
			Method handleReceiverMethod = RefInvoke.findMethodExact("android.app.ActivityThread", ClassLoader.getSystemClassLoader(),
					"handleReceiver", receiverDataClass);
			hookhelper.hookMethod(handleReceiverMethod, new AbstractBahaviorHookCallBack() {

				@Override
				public void descParam(HookParam param) {
					Logger.log_behavior("The Receiver Information:");
					Object data = param.args[0];
					Logger.log_behavior(data.toString());
					
				}
			});
		}
	} catch (ClassNotFoundException e) {
		e.printStackTrace();
	}
}
 
Example 9
Source File: AudioRecordHook.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	// TODO Auto-generated method stub
	Method startRecordingMethod = RefInvoke.findMethodExact(
			"android.media.AudioRecord", ClassLoader.getSystemClassLoader(),
			"startRecording");
	hookhelper.hookMethod(startRecordingMethod, new AbstractBahaviorHookCallBack() {
		
		@Override
		public void descParam(HookParam param) {
			// TODO Auto-generated method stub
			Logger.log_behavior("Audio Recording ->");
		}
	});
	
}
 
Example 10
Source File: AlarmManagerHook.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	
	Method setImplmethod = RefInvoke.findMethodExact(
			"android.app.AlarmManager", ClassLoader.getSystemClassLoader(),
			"setImpl",int.class,long.class,long.class,long.class,PendingIntent.class,WorkSource.class);
	hookhelper.hookMethod(setImplmethod, new AbstractBahaviorHookCallBack() {
		
		@Override
		public void descParam(HookParam param) {
			Logger.log_behavior("The Alarm Information:");
			PendingIntent intent = (PendingIntent) param.args[4];
			if(intent != null)
			   descPendingIntent(intent);
			Logger.log_behavior("TriggerAtMillis = "+param.args[1]);
			Logger.log_behavior("windowMillis = "+param.args[2]);
			Logger.log_behavior("intervalMillis = "+param.args[3]);

		}
	});
	
}
 
Example 11
Source File: ConnectivityManagerHook.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {

    if (Build.VERSION.SDK_INT <= 19) {

        Method setMobileDataEnabledmethod = RefInvoke.findMethodExact(
                "android.net.ConnectivityManager", ClassLoader.getSystemClassLoader(),
                "setMobileDataEnabled", boolean.class);
        hookhelper.hookMethod(setMobileDataEnabledmethod, new AbstractBahaviorHookCallBack() {

            @Override
            public void descParam(HookParam param) {
                boolean status = (Boolean) param.args[0];
                Logger.log("Set MobileDataEnabled = " + status);
            }
        });

    }

    
}
 
Example 12
Source File: NetWorkHook.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	// HttpURLConnection
	Method openConnectionMethod = RefInvoke.findMethodExact("java.net.URL", ClassLoader.getSystemClassLoader(), "openConnection");
	hookhelper.hookMethod(openConnectionMethod, new AbstractBahaviorHookCallBack() {
		@Override
		public void descParam(HookParam param) {
			URL url = (URL) param.thisObject;
			Logger.log_behavior("Connect to URL ->");
			Logger.log_behavior("The URL = " + url.toString());
		}
	});

	if(Build.VERSION.SDK_INT < 23){
		httpHook = new ApacheHttpHook();

		httpHook.startHook();

	}



}
 
Example 13
Source File: AlarmManagerHook.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	
	Method setImplmethod = RefInvoke.findMethodExact(
			"android.app.AlarmManager", ClassLoader.getSystemClassLoader(),
			"setImpl",int.class,long.class,long.class,long.class,PendingIntent.class,WorkSource.class);
	hookhelper.hookMethod(setImplmethod, new AbstractBahaviorHookCallBack() {
		
		@Override
		public void descParam(HookParam param) {
			Logger.log_behavior("The Alarm Information:");
			PendingIntent intent = (PendingIntent) param.args[4];
			descPendingIntent(intent);
			Logger.log_behavior("TriggerAtMillis = "+param.args[1]);
			Logger.log_behavior("windowMillis = "+param.args[2]);
			Logger.log_behavior("intervalMillis = "+param.args[3]);

		}
	});
	
}
 
Example 14
Source File: ProcessBuilderHook.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	Method execmethod = RefInvoke.findMethodExact(
			"java.lang.ProcessBuilder", ClassLoader.getSystemClassLoader(),
			"start");
	hookhelper.hookMethod(execmethod, new AbstractBahaviorHookCallBack() {			
		@Override
		public void descParam(HookParam param) {
			Logger.log_behavior("Create New Process ->");
			ProcessBuilder pb = (ProcessBuilder) param.thisObject;
			List<String> cmds = pb.command();
			StringBuilder sb = new StringBuilder();
			for(int i=0 ;i <cmds.size(); i++){
			   sb.append("CMD"+i+":"+cmds.get(i)+" ");
			}
			Logger.log_behavior("Command" + sb.toString());
		}
	});
}
 
Example 15
Source File: ActivityThreadHook.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Override
public void startHook() {
	// TODO Auto-generated method stub
	try {
		Class receiverDataClass = Class.forName("android.app.ActivityThread$ReceiverData");
		if (receiverDataClass != null) {
			Method handleReceiverMethod = RefInvoke.findMethodExact("android.app.ActivityThread", ClassLoader.getSystemClassLoader(),
					"handleReceiver", receiverDataClass);
			hookhelper.hookMethod(handleReceiverMethod, new AbstractBahaviorHookCallBack() {

				@Override
				public void descParam(HookParam param) {
					Logger.log_behavior("The Receiver Information:");
					Object data = param.args[0];
					Logger.log_behavior(data.toString());
					
				}
			});
		}
	} catch (ClassNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
Example 16
Source File: NotificationManagerHook.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
@Override
public void startHook() {
	// TODO Auto-generated method stub
	Method notifyMethod = RefInvoke.findMethodExact("android.app.NotificationManager", ClassLoader.getSystemClassLoader(), "notify",int.class,Notification.class);
	hookhelper.hookMethod(notifyMethod, new AbstractBahaviorHookCallBack() {
		@Override
		public void descParam(HookParam param) {
			// TODO Auto-generated method stub
			Notification notification = (Notification) param.args[1];
			Logger.log_behavior("Send Notification ->"); 
			Logger.log_behavior(notification.toString()); 
		}
	});
}
 
Example 17
Source File: NotificationManagerHook.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
@Override
public void startHook() {
	// TODO Auto-generated method stub
	Method notifyMethod = RefInvoke.findMethodExact("android.app.NotificationManager", ClassLoader.getSystemClassLoader(), "notify",int.class,Notification.class);
	hookhelper.hookMethod(notifyMethod, new AbstractBahaviorHookCallBack() {
		@Override
		public void descParam(HookParam param) {
			// TODO Auto-generated method stub
			Notification notification = (Notification) param.args[1];
			Logger.log_behavior("Send Notification ->"); 
			Logger.log_behavior(notification.toString()); 
		}
	});
}
 
Example 18
Source File: NotificationManagerHook.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
@Override
public void startHook() {
	// TODO Auto-generated method stub
	Method notifyMethod = RefInvoke.findMethodExact("android.app.NotificationManager", ClassLoader.getSystemClassLoader(), "notify",int.class,Notification.class);
	hookhelper.hookMethod(notifyMethod, new AbstractBahaviorHookCallBack() {
		@Override
		public void descParam(HookParam param) {
			// TODO Auto-generated method stub
			Notification notification = (Notification) param.args[1];
			Logger.log_behavior("Send Notification ->"); 
			Logger.log_behavior(notification.toString()); 
		}
	});
}
 
Example 19
Source File: NotificationManagerHook.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
@Override
public void startHook() {
	Method notifyMethod = RefInvoke.findMethodExact("android.app.NotificationManager", ClassLoader.getSystemClassLoader(), "notify",int.class,Notification.class);
	hookhelper.hookMethod(notifyMethod, new AbstractBahaviorHookCallBack() {
		@Override
		public void descParam(HookParam param) {
			Notification notification = (Notification) param.args[1];
			Logger.log_behavior("Send Notification ->"); 
			Logger.log_behavior(notification.toString()); 
		}
	});
}
 
Example 20
Source File: AudioRecordHook.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
@Override
public void startHook() {
	Method startRecordingMethod = RefInvoke.findMethodExact(
			"android.media.AudioRecord", ClassLoader.getSystemClassLoader(),
			"startRecording");
	hookhelper.hookMethod(startRecordingMethod, new AbstractBahaviorHookCallBack() {
		
		@Override
		public void descParam(HookParam param) {
			Logger.log_behavior("Audio Recording ->");
		}
	});
	
}