1

我通过 AIDL 从另一个应用程序(我在 Eclipse 中有两个应用程序项目)运行服务时遇到问题。每次当我使用接口中的方法时,我都会得到:

java.lang.SecurityException: Permission Denial: starting Intent
{cmp=de.blinkt.openvpn/.api.GrantPermissionsActivity } from ProcessRecord{42cfd9c0 
22519:com.xxx/u0a10093} (pid=22519, uid=10093) requires de.blinkt.openvpn.REMOTE_API.

我到处寻找,但没有找到任何可行的答案。如何解决?

4

1 回答 1

2

要使用 API,您首先需要调用:

/** This permission framework is used  to avoid confused deputy style attack to the VPN
     * calling this will give null if the app is allowed to use the external API and an Intent
     * that can be launched to request permissions otherwise */
    Intent prepare (String packagename);

你需要在你的清单中有:

<!-- Copy the <permission> block to your app when using the REMOTE API. Otherwise OpenVPN for
    Android needs to be installed first -->
<permission
    android:name="de.blinkt.openvpn.REMOTE_API"
    android:description="@string/permission_description"
    android:label="Control OpenVPN"
    android:permissionGroup="android.permission-group.NETWORK"
    android:protectionLevel="dangerous" />

<uses-permission android:name="de.blinkt.openvpn.REMOTE_API">

请注意该权限之前的评论...

于 2013-11-14T22:47:53.620 回答