Android APP合规检查工具介绍

一个通过拦截java方法调用用以检测应用是否合规的工具
一、android studio中引用插件miit-rule-checker
1.添加mavencentral
allprojects { repositories { google() jcenter() mavencentral() }}  
2.添加gradle依赖
dependencies { implementation filetree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support27.1.1' implementation 'com.android.support.constraint1.1.2' testimplementation 'junit4.12' androidtestimplementation 'com.android.support.test1.0.2' androidtestimplementation 'com.android.support.test.espresso3.0.2' implementation 'com.jakewharton8.8.1' annotationprocessor 'com.jakewharton8.8.1' implementation 'com.alibaba2.0.23' implementation(org.greenrobot3.3.1) implementation 'com.appsflyer6.9.0' implementation com.android.installreferrer2.2 implementation(org.greenrobot3.3.1) implementation 'com.squareup.okhttp35.0.0-alpha.10' implementation 'io.github.loper70.2.0'}
二、使用方法
1.检查app内是否存在不合规的方法调用
检查miitrulechecker内置的不合规的方法
miitrulechecker.checkdefaults()
  如果内置的方法不满足当前需求,可自定义方法添加到list中进行检查;
比如新增一个 mainactivity 的 oncreate 方法的调用检查;val list = miitmethods.getdefaultmethods()list.add(mainactivity::class.java.getdeclaredmethod(oncreate , bundle::class.java))miitrulechecker.check(list)
如果想检查多个内置方法外的方法,只需要创建一个新的集合,往集合里放你想检查的方法member,然后传入miitrulechecker.check()内即可。
2.检查指定方法调用并查看调用栈堆
//查看 wifiinfo class 内 getmacaddress 的调用栈堆miitrulechecker.check(miitmethods.wifiinfo.getmacaddress)
3.检查一定时间内指定方法调用次数统计 //多个方法统计 (deadline 为从方法调用开始到多少毫秒后截至统计) val list = mutablelistof().apply { add(miitmethods.locationmanager.getlastknownlocation) add(miitmethods.locationmanager.requestlocationupdates) add(miitmethods.secure.getstring) }miitmethodcountchecker.startcount( 20 * 1000,list)//单个方法统计(deadline 为从方法调用开始到多少毫秒后截至统计)miitmethodcountchecker.startcount(20 * 1000,miitmethods.locationmanager.getlastknownlocation)‍    
特别注意:
检查完成并完成整改后务必移除方法miit-rule-checker库内的所有方法调用,将库一起移除最好
三、内置方法表


基于定点DSP处理器TMS320LF2407芯片实现多路数据采集系统的设计
苏宁推出极物摄像机安防套装 家用商用两相宜
共享项目的关闭潮,从单车行业开始
低成本用电设备完整方案含12V buck转换器、PD供电电路
三星被曝部分应用程序必须在更新操作系统后单独更新
Android APP合规检查工具介绍
Intel:Intel PC处理器降价的新闻为不实消息
信息安全基础:什么是Public Key
中国将是全球最大的机器人市场预计2022年占全球总量的38%以上
HTCU12+体验 对不起你是个好人
arm11处理器特点
未来机器人也可以像人一样进行学习?
韩媒:宁德时代再次获得现代汽车电动汽车电池订单
京东家电全渠道称霸 预计整体销售数量将突破1000万台
数据库应用系统的作用
寄存器操作方法_对寄存器操作的通用方法总结
易华录2021第三届数据湖大会圆满举行
风光互补供电系统维护方式
TCL推出首款搭载QD Vision Color IQ 量子点技术65寸电视机
关于优必选阿尔法智能人形机器人的性能分析和简介