概述 随着Android的更新,越新的版本收紧的权限越来越多,伴随着很多曾经可用的接口慢慢地出现了问题。 比如: TelephonyManager.getSubscriberId() public static void testGetSubId(Context ctx){ TelephonyManager telMgr = (TelephonyManager) ctx.getSystemService(TELEPHONY_SERVICE); @SuppressLint("MissingPermission") String subId = telMgr.getSubscriberId(); android.util.Log.d(TAG, "testGetSubId subId=" + subId); } 原因 在代码注释中已经写得很明白: The user 10125 does not meet the requirements to access device identifiers 要做的事情很简单, 找到权限检查的地方, 去掉它 权限检查的位置 public static...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with int
Contact int, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack