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

默认允许USB弹窗权限。 #65

Open
gotoded opened this issue Sep 30, 2024 · 2 comments
Open

默认允许USB弹窗权限。 #65

gotoded opened this issue Sep 30, 2024 · 2 comments

Comments

@gotoded
Copy link

gotoded commented Sep 30, 2024

佬能否增加一个USB默认允许连接的权限。
因为很多车阉割了USB授权弹窗,通过添加device_filter.xml可以自动USB连接。(当然能弹窗的在第一次授权后会自动。)

@gotoded
Copy link
Author

gotoded commented Sep 30, 2024

一:声明
<manifest ...>


...

<activity ...>
...







二:在res中新建xml文件夹,新建device_filter.xml

@star-o0O
Copy link

star-o0O commented Sep 30, 2024

    <activity
      android:name=".UsbActivity"
      android:directBootAware="true"
      android:exported="false">
      <intent-filter>
        <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
      </intent-filter>

      <meta-data
        android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
        android:resource="@xml/device_filter" />
    </activity>

应该是上面这一块,有个跟我同款车的朋友说易控可以USB,我试着从易控抄过来了
[AndroidManifest.xml]、[UsbActivity.java]、[device_filter.xml]这三个都改了
但是太菜了没抄明白,总之是没成功......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants