vidstige / jadb

ADB Client in pure Java.
Apache License 2.0
640 stars 178 forks source link

SELinux is blocking apk install from /sdcard/* #132

Closed veN1337 closed 4 years ago

veN1337 commented 4 years ago

Trying to install an apk with se.vidstige.jadb.managers.PackageManager#install(java.io.File) on any of my Android 10 devices causes following issue:

Caused by: se.vidstige.jadb.JadbException: Could not install testapp-1.0-debug.apk: avc: denied { read } for scontext=u:r:system_server:s0 tcontext=u:object_r:fuse:s0 tclass=file permissive=0 System server has no access to read file context u:object_r:fuse:s0 (from path /sdcard/tmp/testapp-1.0-debug.apk, context u:r:system_server:s0) Error: Unable to open file: /sdcard/tmp/testapp-1.0-debug.apk Consider using a file under /data/local/tmp/ Error: Can't open file: /sdcard/tmp/testapp-1.0-debug.apk

This is probably due to SELinux.

Nevertheless, the problem is also solved by pushing the apk not to /sdcard/tmp/ but to /data/local/tmp.

Please consider changing the default path /sdcard/tmp/ in se.vidstige.jadb.managers.PackageManager#install(java.io.File) to /data/local/tmp or providing a method with a parameter to specify the push path.

Thanks for the good work so far :)

veN1337 commented 4 years ago

Just noticed commit 163fa7f already fixes this. Last release was build just a day before that commit 😞