And*_*rew 2 android android-intent android-pendingintent
我们有一些可以长时间工作的旧代码:
public static Intent getIntent(PendingIntent pendingIntent) {
Intent intent = null;
try {
Method getIntent = PendingIntent.class.getDeclaredMethod("getIntent");
intent = (Intent) getIntent.invoke(pendingIntent);
} catch (Exception e) {
// Log line
}
return intent;
}
Run Code Online (Sandbox Code Playgroud)
我们现在收到一个安全异常:
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.company.util.IntentUtils.getIntent(IntentUtils.java:160)
Caused by: java.lang.SecurityException: Permission Denial: getIntentForIntentSender() from pid=28128, uid=10127 requires android.permission.GET_INTENT_SENDER_INTENT
at android.os.Parcel.readException(Parcel.java:1683)
at android.os.Parcel.readException(Parcel.java:1636)
at android.app.ActivityManagerProxy.getIntentForIntentSender(ActivityManagerNative.java:5924)
at android.app.PendingIntent.getIntent(PendingIntent.java:987)
... 17 more
Run Code Online (Sandbox Code Playgroud)
可能与AOSP更改有关:https ://android.googlesource.com/platform/frameworks/base/+/e5ad41b%5E! /
任何帮助的意图将不胜感激。
没有解决方法:根据错误消息和提交,隐藏的方法(从来都不是公共API的一部分)现在需要一个signature权限,只有使用系统签名签名的应用才可以保留。
| 归档时间: |
|
| 查看次数: |
1901 次 |
| 最近记录: |