求助大神。老板交代任务要写一个“权限和API函数调用结合的移动应用泄露用户隐私取证分析方法”,给了一段范例如下
//监控APP对麦克风硬件的使用
findAndHookMethod("android.media.AudioRecord", ClassLoader.getSystemClassLoader(),
"startRecording",
new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
XposedBridge.log("=========AUDIO====================");
if(context!=null){
Intent intent=new Intent();
intent.setAction("com.example.sec.BroadcastReceiverTest");
intent.setComponent( new ComponentName( "com.example.android_security" ,
"com.example.android_security.MyReceiver") );
intent.putExtra("name", getAppName(context));
intent.putExtra("permission","录音");
context.sendBroadcast(intent);
老板要求仿照上述代码对隐私数据(如通讯录、通话记录、位置、应用列表、短信、日历、设备ID等)关联的API函数进行Hook(申请权限和调用数据的API函数都Hook,可能有多个需要的都Hook),并按照范例的函数发送应用行为的记录。
因为是刚入门的小白,特向各位大神求助,不胜感谢!