小编col*_*nip的帖子

为什么Android在通过蓝牙OPP接收时严格限制可接受的文件类型?

问候stackoverflow.

最近,我正在跟踪Android框架中的蓝牙操作机制.我注意到这个补丁在通过OPP接收文件时会产生一些文件类型限制.

在包中com.android.bluetooth.opp,Constants.java中有一个固定的白名单

/**
 * The MIME type(s) of we could accept from other device.
 * This is in essence a "white list" of acceptable types.
 * Today, restricted to images, audio, video and certain text types.
 */
public static final String[] ACCEPTABLE_SHARE_INBOUND_TYPES = new String[] {
    /* ... some types such as images and music ... */
};
Run Code Online (Sandbox Code Playgroud)

这限制了BluetoothOppObexServerSession.java中可接受的文件类型

        // Reject policy: anything outside the "white list" plus unspecified
        // MIME Types.
        if (!pre_reject
            && …
Run Code Online (Sandbox Code Playgroud)

security android bluetooth obex

8
推荐指数
1
解决办法
2518
查看次数

标签 统计

android ×1

bluetooth ×1

obex ×1

security ×1