chucker icon indicating copy to clipboard operation
chucker copied to clipboard

Crash when the client app is using the WAKE_LOCK permission

Open Oleur opened this issue 11 months ago • 2 comments

:writing_hand: Describe the bug

Chucker 4.0.0 is overriding the WAKE_LOCK permission on the app side.

:bomb: Steps to reproduce

  1. Add Chucker to your app that uses WAKE_LOCK permission
  2. If your app using the PowerManager wakelock at some and is API 25 or above -> crash
  3. See error

java.lang.SecurityException: Neither user 10349 nor current process has android.permission.WAKE_LOCK.

:wrench: Expected behavior

No crash.

:page_facing_up: Additional context

This crash might be avoided by overriding the permission in the manifest: <uses-permission android:name="android.permission.WAKE_LOCK" tools:node="replace"/>

What was the reasons to add a maxSDK requirement to the permission definition?

<uses-permission
        android:name="android.permission.WAKE_LOCK"
        android:maxSdkVersion="25" />

Oleur avatar Jul 13 '23 13:07 Oleur