Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.SecurityException in the logcat #543

Open
CampelloManuel opened this issue Sep 11, 2024 · 0 comments
Open

java.lang.SecurityException in the logcat #543

CampelloManuel opened this issue Sep 11, 2024 · 0 comments
Assignees
Labels
bug A bug! Fixing it is a priority secondary Trivial or impactful, this feature is NOT a priority

Comments

@CampelloManuel
Copy link
Collaborator

CampelloManuel commented Sep 11, 2024

Describe the bug

importing a backup on a fresh installation of the app causes this message to appear in the logcat:

Caught a RuntimeException from the binder stub implementation.
java.lang.SecurityException: Permission Denial: reading 
com.nononsenseapps.notepad.database.MyContentProvider uri 
content://com.nononsenseapps.notepad.debug.MyContentAuthority/notification/with_task_info 
from pid=0, uid=1000 requires the provider be exported, or grantUriPermission()
at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:1023)
at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:818)
at android.content.ContentProvider$Transport.query(ContentProvider.java:256)
at android.content.ContentResolver.query(ContentResolver.java:1229)
at android.content.ContentResolver.query(ContentResolver.java:1161)
at android.content.ContentResolver.query(ContentResolver.java:1117)
at com.nononsenseapps.notepad.database.Notification.getNotificationsWithTasks(Notification.java:508)
at com.nononsenseapps.notepad.database.Notification.getNotificationsWithTime(Notification.java:496)
at com.nononsenseapps.helpers.NotificationHelper.notifyPast(NotificationHelper.java:228)
at com.nononsenseapps.helpers.NotificationHelper.-$$Nest$smnotifyPast(Unknown Source:0)
at com.nononsenseapps.helpers.NotificationHelper$ContextObserver.onChange(NotificationHelper.java:688)
at android.database.ContentObserver.onChange(ContentObserver.java:184)
at android.database.ContentObserver.onChange(ContentObserver.java:202)
at android.database.ContentObserver.onChange(ContentObserver.java:238)
at android.database.ContentObserver.dispatchChange(ContentObserver.java:335)
at android.database.ContentObserver$Transport.onChangeEtc(ContentObserver.java:357)
at android.database.IContentObserver$Stub.onTransact(IContentObserver.java:120)
at android.os.Binder.execTransactInternal(Binder.java:1505)
at android.os.Binder.execTransact(Binder.java:1444)

...but the app still works fine.
The problem is in the constructor of com.nononsenseapps.helpers.NotificationHelper.ContextObserver, which is an useless class marked for removal.
See https://stackoverflow.com/questions/36694212/getting-a-permission-denial-when-querying-my-own-contentprovider-from-my-own-app who experienced the same problem.
In our case, removing ContextObserver is the best solution to explore, since it's a useless class.

how To Reproduce

  1. Install the app
  2. Import a backup from a json file
  3. See the message in the logcat

Technical information

  • Device: Google Pixel 8a
  • OS: Android 14
  • app version: 7.1.8
@CampelloManuel CampelloManuel added bug A bug! Fixing it is a priority secondary Trivial or impactful, this feature is NOT a priority labels Sep 11, 2024
@CampelloManuel CampelloManuel changed the title java.lang.SecurityException when importing a backup on Pixel 8a java.lang.SecurityException in the logcat Sep 11, 2024
@CampelloManuel CampelloManuel self-assigned this Sep 12, 2024
@CampelloManuel CampelloManuel pinned this issue Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug! Fixing it is a priority secondary Trivial or impactful, this feature is NOT a priority
Projects
None yet
Development

No branches or pull requests

1 participant