java - 我可以使用 com.android.internal.Itelephony 吗?
问题描述
我问我是否可以使用 com.android.internal.Itelephony 并使用这个包的方法。我可以通过 exoloit 这个包中包含的方法来实现这个接口。
解决方案
I dont think so. The ITelephony
package is internal so you cannot get reference it in the standard format else you use reflection to access the methods. e.g
TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
Method m1 = tm.getClass().getDeclaredMethod("getITelephony");
m1.setAccessible(true);
Object iTelephony = m1.invoke(tm);
Method m3 = iTelephony.getClass().getDeclaredMethod("endCall");
m2.invoke(iTelephony);
You will need the following permissions to make it work
READ_PHONE_STATE
CALL_PHONE
Note in some cases it might not work until you add the permission MODIFY_PHONE_STATE
which is granted to system apps only
推荐阅读
- asp.net-web-api - 在 ASP.NET CORE 3.1 Web API 中配置 Autofac DI 容器和来自控制器的消费者服务
- python - 使用numpy从二维数组的行之和中找到数组的最大值
- python - 如何从 django 模型返回项目总数?
- jsx - 在jsx中获取智能对象层的文件目录源
- three.js - 在 Cannon.js 中创建一个“地垫”类型的对象,当踩到时会做出反应
- c - 为什么 gcc 会引发隐式失败警告?
- vue.js - 直接改变一个可变道具,计算集处理程序没有被调用
- javascript - 如何修复 429(请求过多)?
- corda - 运行几周后,corda CENM 网络地图服务器开始无法连接数据库
- cassandra - 启动第二个节点后的 Cassandra 断言错误