eclipse / paho.mqtt.android

MQTT Android
Other
2.92k stars 883 forks source link

java.lang.SecurityException: Permission Denial: getIntentForIntentSender() #472

Open Swordce opened 2 years ago

Swordce commented 2 years ago

Please fill out the form below before submitting, thank you!

__Android API Version Bug Seen on: API 30

__Android Version Bug Seen on: Android 7

Please also check that if you have found the bug in the Release version (1.1.1) that you check that it also exists in the Snapshot (1.1.2-SNAPSHOT) before raising a bug.

Console Log output (if available):

Process: cn.wtbiz.suqian.ctuav, PID: 7904 java.lang.SecurityException: Permission Denial: getIntentForIntentSender() from pid=7904, uid=10060 requires android.permission.GET_INTENT_SENDER_INTENT at android.os.Parcel.readException(Parcel.java:1684) at android.os.Parcel.readException(Parcel.java:1637) at android.app.IAlarmManager$Stub$Proxy.set(IAlarmManager.java:245) at android.app.AlarmManager.setImpl(AlarmManager.java:668) at android.app.AlarmManager.setExactAndAllowWhileIdle(AlarmManager.java:874) at org.eclipse.paho.android.service.AlarmPingSender.schedule(AlarmPingSender.java:115) at org.eclipse.paho.android.service.AlarmPingSender.start(AlarmPingSender.java:79) at org.eclipse.paho.client.mqttv3.internal.ClientState.connected(ClientState.java:1214) at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:1050) at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:151) at java.lang.Thread.run(Thread.java:761)

bingerz commented 2 years ago

My app was forced to upgrade to Target 31. I encountered this problem and couldn't wait for the new version. I just forked and repackaged the version myself. implementation 'cn.bingerz.android:org.eclipse.paho.android.service:1.1.2-SNAPSHOT'

Update content: Support AndroidX. Upgrade Gradle to 7.x. Fix PendingIntent flag FLAG_IMMUTABLE issue. Avoid Permission Denial: getIntentForIntentSender() issue.

For specific modifications, please see: https://github.com/bingerz/flip-mqtt-android