Status Update
Comments
ag...@google.com <ag...@google.com>
sp...@google.com <sp...@google.com> #2
Does adb shell command pm list packages
succeed when insured from a Cmd window?
sa...@google.com <sa...@google.com> #3
I am seeing an exception in idea.log
.
2023-01-16 15:52:07,076 [ 51985] SEVERE - C.kt - Error executing shell command pm list packages
com.android.tools.idea.adb.AdbShellCommandException: Error executing shell command pm list packages
at com.android.tools.idea.adb.AdbShellCommandException.create(AdbShellCommandException.java:26)
at com.android.tools.idea.adb.AdbShellCommandResult.throwIfError(AdbShellCommandResult.java:53)
at com.android.tools.idea.file.explorer.toolwindow.adbimpl.AdbFileOperations$listPackages$2.invokeSuspend(AdbFileOperations.kt:81)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)
The exception originated from adblib
because no output was generated by pm list packages
besides the errorCode.
ch...@google.com <ch...@google.com> #4
I'm guessing this bug is related:
du...@google.com <du...@google.com> #5
Can you try running pm list packages
in the shell and see if it outputs a security exception, like stated in the bug pointed to by #4?
ha...@gmail.com <ha...@gmail.com> #6
java.lang.SecurityException: Shell does not have permission to access user 150 com.android.server.am.ActivityManagerService.handleIncomingUser:14872 android.app.ActivityManager.handleIncomingUser:4802 com.android.server.pm.PackageManagerShellCommand.translateUserId:3499 at com.android.server.am.UserController.handleIncomingUser(UserController.java:2672) at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:14872) at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:4802) at com.android.server.pm.PackageManagerShellCommand.translateUserId(PackageManagerShellCommand.java:3499) at com.android.server.pm.PackageManagerShellCommand.runListPackages(PackageManagerShellCommand.java:965) at com.android.server.pm.PackageManagerShellCommand.runListPackages(PackageManagerShellCommand.java:861) at com.android.server.pm.PackageManagerShellCommand.runList(PackageManagerShellCommand.java:720) at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:222) at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97) at android.os.ShellCommand.exec(ShellCommand.java:38) at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:6940) at android.os.Binder.shellCommand(Binder.java:1085) at android.os.Binder.onTransact(Binder.java:903) at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4909) at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6924) at android.os.Binder.execTransactInternal(Binder.java:1321) at android.os.Binder.execTransact(Binder.java:1280)
adb shell command pm list packages
it doesn't work and throw an exception. Running the command adb shell command pm list packages --user 0
works.
If I can help you, in my samsung device i have installed secure folder and i use it. The exception it creates with the adb shell pm list package
command says it uses user 150 (secure folder user). Also before sending the adb shell pm list package
command, I run adb shell am get-current-user
and it returns 0 (root).
sa...@google.com <sa...@google.com> #7
It looks like secure folder
created a new user. Can you run this command adb shell pm list users
and append the result here?
ta...@gmail.com <ta...@gmail.com> #8
ha...@gmail.com <ha...@gmail.com> #9
Users: UserInfo{0:Proprietario:c13} running UserInfo{150:Secure Folder:10061030} running
sa...@google.com <sa...@google.com> #10
sp...@google.com <sp...@google.com> #11
Chrys, please contact me for how you can test with a Samsung API 33 device.
jb...@google.com <jb...@google.com> #12
Testing on my own samsung api 33 phone, pm list packages throws the exception above when a secure folder has been created, and doesn't when it's deleted again.
ha...@gmail.com <ha...@gmail.com> #13
So if we have Secure Folder installed we will never be able to see the internal folders through Device File Explorer if we don't uninstall Secure Folder? Is there another way otherwise?
Description
Now to export the db file I have to enter the device via adb shell on the terminal and run the command: run-as com.example.polls and copy the file to the internal folder.
my device is: Samsung SM-G998B android 13, One UI 5.0
Android Studio Flamingo | 2022.2.1 Canary 11
Build #AI-222.4459.24.2221.9445173, built on December 30, 2022
Runtime version: 17.0.4.1+0-b2043.56-9127311 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
Jenkins Plugin 0.13.15-2022.2
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 12
Registry:
editor.focus.mode.color.light=777777
ide.editor.tab.selection.animation=true
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
ide.instant.shutdown=false
ide.new.editor.tabs.vertical.borders=true
ide.balloon.shadow.size=0
editor.focus.mode.color.dark=777777
gradle.version.catalogs.dynamic.support=true
Non-Bundled Plugins:
nb-mind-map-idea (1.6.1)
idea.plugin.protoeditor (222.4459.16)
com.symbol.emdk.wizardex (11.0.2)
com.intellij.marketplace (222.4459.28)
com.intellij.ideolog (203.0.30.0)
com.godwin.json.parser (1.4.2)
com.andrey4623.rainbowcsv (2.0.2)
String Manipulation (9.6.1)
Jenkins Control Plugin (0.13.15-2022.2)
GsonFormatPlus (1.6.1)
net.seesharpsoft.intellij.plugins.csv (3.0.2-222)
Dart (222.4533)
DBN (3.3.5889.0)
com.mallowigi (80.1.0)
com.developerphil.adbidea (1.6.8)
izhangzhihao.rainbow.brackets (2023.1.1-ij)
com.squareup.sqldelight (1.5.3)
com.chrisrm.idea.MaterialThemeUI (7.14.2)
org.intellij.scala (2022.2.19)