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

QUERY_ALL_PACKAGES not granted on Samsung (Android 14) #1015

Closed
dancorpse opened this issue Feb 15, 2024 · 16 comments · Fixed by #1033
Closed

QUERY_ALL_PACKAGES not granted on Samsung (Android 14) #1015

dancorpse opened this issue Feb 15, 2024 · 16 comments · Fixed by #1033
Labels
api: 34 A14 (Upside Down Cake) c: AppCleaner c: Setup Device specific A device specific issue or behavior. enhancement New feature, request, improvement or optimization

Comments

@dancorpse
Copy link

Describe the bug
Just install SD maid SE on my new Android 14 phone but once I click appcleaner the app stop and quit by itself right away. But it can work on my android 10 old phone. I noticed that there’s no grant access to android/data folder on Android 14.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'appcleaner'
  2. Click on 'appcleaner.'
  3. Scroll down to '....'
  4. See error

Expected behavior
Is that because of android’s restriction to android/data folder from Android 11 on?
Any way to solve?

Smartphone (please complete the following information):

  • Device: [Samsung Galaxy s24+]
  • OS: [ Android 14]
  • Root status [not Rooted -]
  • SD Maid 2/SE version [0.20.0 beta0]

Screenshots/Video
Not able to screen shot bcs the app quit at once

@dancorpse dancorpse added bug Something isn't working as expected triage This ticket needs to be sorted and labeled. labels Feb 15, 2024
@d4rken d4rken added needs info/repro 🤔 Needs more information (from OP?) to be acted upon c: AppCleaner Automation Accessibility service related api: 34 A14 (Upside Down Cake) and removed triage This ticket needs to be sorted and labeled. labels Feb 16, 2024
@dancorpse
Copy link
Author

dancorpse commented Feb 18, 2024

IMG_20240218_092328__01

@dancorpse
Copy link
Author

VID_20240218_092433_01.mp4

@d4rken
Copy link
Member

d4rken commented Feb 18, 2024

Please provide a debug log of this:
https://github.com/d4rken-org/sdmaid-se/wiki/Bugs#debug-log

@dancorpse
Copy link
Author

OK, I will try to post the debug log later.

@dancorpse
Copy link
Author

@dancorpse
Copy link
Author

Here is the debug log. I noticed that on android 14, there's no selection of grant access to android/data folder under manager storage, but on android 10, there is selection for grant access to android/data folder. I guess this is the reason why SD maid SE's app cleaner does not work on android 14, how can I grant access to android/data?

@dancorpse
Copy link
Author

Not only appcleaner, click appcontrol will also cause SD Maid SE to quit at once. I think the problem is because SD maide SE has not granted access to android/data.

@d4rken
Copy link
Member

d4rken commented Feb 20, 2024

The issue is with your systems package manager.

This is a "safety crash":

2024-02-19T05:12:14.805Z  E/SDMSE:App: UNCAUGHT EXCEPTION: eu.darken.sdmse.common.pkgs.pkgops.IllegalPkgDataException: No installed packages
	at eu.darken.sdmse.common.pkgs.sources.PackageManagerPkgSource.access$getCoreList(Unknown Source:232)
	at eu.darken.sdmse.common.pkgs.sources.PackageManagerPkgSource$getCoreList$1.invokeSuspend(Unknown Source:11)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8)
	at kotlinx.coroutines.DispatchedTask.run(Unknown Source:107)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(Unknown Source:93)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: 

There should never be 0 pkgs, as there are always some system apps installed:

D/SDMSE:PkgRepo: 0 pkgs from eu.darken.sdmse.common.pkgs.sources.SystemManifestPkgSource@1dee8be

Any idea why this would be? 🤔

@dancorpse
Copy link
Author

Oh, I'm so stupid that just noticed that I haven't given SD maid SE permission to app list, need to go to setting - app - SD Maid SE and allow permission to app list, the app itself do not pop up ask for permission to app list.

@d4rken
Copy link
Member

d4rken commented Feb 21, 2024

Is this a special Samsung only setting? Can you show me a screenshot? 🤔

@dancorpse
Copy link
Author

dancorpse commented Feb 22, 2024

Below 2 pictures are from oneplus 7T, Android 10 phone, there's no permmission for app list:
android-10
android-10-2

Below 2 pictures are from samsung galaxy 24+ phone, Android 14, there's permmission option named app list:
android 14
android 14-2

@d4rken
Copy link
Member

d4rken commented Feb 22, 2024

This should have been granted by default, did you manually disable it?

@dancorpse
Copy link
Author

I never disable it manually, the app did not ask me for allowing on installation, at first I just stuck with "android restricted access to android/data folder from android 11 on" issue, later when I came to app setting then realized the crash was casued by applist permission.

@d4rken d4rken removed bug Something isn't working as expected needs info/repro 🤔 Needs more information (from OP?) to be acted upon labels Feb 24, 2024
@d4rken
Copy link
Member

d4rken commented Feb 24, 2024

This is normally not a permission that can't be taken away. The S24+ is a popular device, if this is not granted by default, then I would expect to get more feedback about crashes 🤷.

I'm closing this for now as there is nothing to do here for me. If we later find out this is a special thing to request on Samsung device, then we reopen it.

Thanks for the report!

Below 2 pictures are from samsung galaxy 24+ phone, Android 14, there's permmission option named app list:

The permission is new, I think Android 12 or 13+, it's just unusual that it's visible and can be taken away. The permission has to be declared by developer and is automatically granted, but Google Play requires devs to provide an explanation on why the permission is requested.

@d4rken d4rken closed this as completed Feb 24, 2024
@d4rken
Copy link
Member

d4rken commented Feb 24, 2024

Actually, let's leave this open for now, I'll look into whether SD Maid can handle this without crash and show a setup card with instructions for Samsung devices...

@d4rken d4rken reopened this Feb 24, 2024
@d4rken d4rken added enhancement New feature, request, improvement or optimization c: Setup Device specific A device specific issue or behavior. and removed Automation Accessibility service related labels Feb 24, 2024
@d4rken d4rken changed the title Appcleaner function not working on Android 14 QUERY_ALL_PACKAGES not granted on Samsung (Android 14) Feb 24, 2024
@d4rken-org d4rken-org deleted a comment from Zego001 Feb 25, 2024
@d4rken-org d4rken-org deleted a comment from Zego001 Feb 25, 2024
d4rken added a commit that referenced this issue Feb 25, 2024
…e devices

Previous we always assumed that QUERY_ALL_PACKAGES was granted (which it should, by default),
but Samsung seems to be doing "Just Samsung things ™️" and this may not be the case on some of Samsungs Android 14 ROMs.
So let's treat it as potentially optional and catch the error, don't crash, and guide the user to the setup.

Closes #1015
@d4rken
Copy link
Member

d4rken commented Feb 25, 2024

Still don't get what Samsung is doing here except, but #1033 will make SD Maid not crash and handle this more gracefully, i.e. show a hint to the user about it.

Thanks for bringing this to my attention @dancorpse

d4rken added a commit that referenced this issue Feb 25, 2024
…e devices

Previous we always assumed that QUERY_ALL_PACKAGES was granted (which it should, by default),
but Samsung seems to be doing "Just Samsung things ™️" and this may not be the case on some of Samsungs Android 14 ROMs.
So let's treat it as potentially optional and catch the error, don't crash, and guide the user to the setup.

Closes #1015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: 34 A14 (Upside Down Cake) c: AppCleaner c: Setup Device specific A device specific issue or behavior. enhancement New feature, request, improvement or optimization
Projects
None yet
2 participants