usb-with-serial-port icon indicating copy to clipboard operation
usb-with-serial-port copied to clipboard

how can i do with this problems

Open zhubinsheng opened this issue 5 years ago • 1 comments
trafficstars

07/23 16:55:04: Launching 'app' on Xiaomi Redmi Note 7. $ adb shell am start -n "com.hd/com.hd.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Connected to process 13447 on device 'xiaomi-redmi_note_7-63364e0f'. Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. I/com.hd: The ClassLoaderContext is a special shared library. I/Perf: Connecting to perf service. W/System.err: java.io.IOException: Cannot run program "/system/bin/su": error=2, No such file or directory W/System.err: at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050) at java.lang.Runtime.exec(Runtime.java:695) at java.lang.Runtime.exec(Runtime.java:525) at java.lang.Runtime.exec(Runtime.java:422) at com.hd.serialport.help.RootCmd.execRootCmdOrder(RootCmd.kt:28) at com.hd.serialport.help.RootCmd.execRootCmdOrder$default(RootCmd.kt:26) at com.hd.serialport.help.RequestUsbPermission$asyncRequestAllUsbDevicePermission$1.doInBackground(RequestUsbPermission.kt:65) at com.hd.serialport.help.RequestUsbPermission$asyncRequestAllUsbDevicePermission$1.doInBackground(RequestUsbPermission.kt:63) W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:333) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(UNIXProcess.java:133) W/System.err: at java.lang.ProcessImpl.start(ProcessImpl.java:132) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 13 more I/com.hd: The ClassLoaderContext is a special shared library. W/Binder:intercep: type=1400 audit(0.0:254820): avc: denied { getattr } for path="/data/data/com.miui.contentcatcher" dev="dm-2" ino=2359473 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:system_app_data_file:s0 tclass=dir permissive=0 D/ViewContentFactory: initViewContentFetcherClass getInterceptorPackageInfo W/com.hd: Accessing hidden method Landroid/app/AppGlobals;->getInitialApplication()Landroid/app/Application; (light greylist, linking) 在红米note7手机上 安卓9 无法使用 看上去是没有权限或者说没有那个文件

zhubinsheng avatar Jul 23 '20 08:07 zhubinsheng

你好,因为我没有在做相关业务的工作了,所以这个库就没再做相关测试。看到你提的问题,检索到源码 usbserialport/src/main/java/com/hd/serialport/help/RootCmd.kt, 这个类是通过shell的方式在请求usb权限,代码里面做过try/catch, 理论上库不会崩溃,除非定制系统处理不了这句话自己崩了。涉及到硬件及实际环境,这里只能做下推测,如果你时间充沛,可以尝试使用库源码去调试,当然最后的办法就是删除那句话,祝好运

HelloHuDi avatar Jul 24 '20 07:07 HelloHuDi