安卓的检测与反检测
先来看一段检通过包管理器PackageManager测代码包名检测:
PackageManager packageManager=getApplicationContext().getPackageManager();
List<ApplicationInfo> appliacationInfoList=packageManager.getInstalledApplications(PackageManager.GET_META_DATA);
for(ApplicationInfo item:appliacationInfoList ){
if(item.packageName.equals("xxx.xxxx.xxxxr")){
Log.wtf("Hookfonund","Hook is fonund on device");
}
}
不难看出最终通过getInstalledApplications方法获取到列表,打开Android·源码地址如下。
frameworks\base\core\java\android\app\ApplicationPackageManager.java
很容易找到getInstalledApplications方法
@SuppressWarnings("unchecked")
@Override
public List<ApplicationInfo> getInstalledApplications(int flags) {
return getInstalledApplicationsAsUser(flags, mContext.getUserId());
}
getInstalledApplications调用的getInstalledApplicationsAsUser
/** @hide */
@SuppressWarnings("unchecked")
@Override
public List<ApplicationInfo> getInstalledApplicationsAsUser(int flags, int userId) {
try { ParceledListSlice<ApplicationInfo> parceledList = mPM.getInstalledApplications(flags, userId);
if (parceledList == null) {
return Collections.emptyList();
}
return parceledList.getList(); }
catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
分析到这里足够用了HOOK方式注入方式点找到了你想干啥就干啥呗。但是要记住这只是其中的一项,还有几种方式能扫描到。
其它地方思路也是一样的。有问题可进群543281872开门密码test
本文地址:https://blog.csdn.net/u012571756/article/details/107431343
下一篇: 利用js实现简单开关灯代码