权限拒绝:启动Intent需要<package name =“”> </package>

时间:2013-11-14 11:51:48

标签: android permissions remote-access permission-denied openvpn

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

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.

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

1 个答案:

答案 0 :(得分: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">

请注意该许可之前的评论......