3

I get "Exported receiver does not require permission" warning for Branch Metrics install listener.

<receiver android:name="io.branch.referral.InstallListener" android:exported="true">
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
</receiver>

enter image description here

Above install listener is fully functional, but I am not sure if I can safely ignore this warning message.

What permission should I add to remove that warning and still have functional install listener?

Dalija Prasnikar
  • 27,212
  • 44
  • 82
  • 159
  • Presumably, add `android:permission="..."` to the `` element, but you would need to research what exactly the permission name is. – CommonsWare Mar 03 '16 at 15:29
  • @CommonsWare Exact permission name is the unknown part here... so far my research didn't give me any clues... – Dalija Prasnikar Mar 03 '16 at 15:32
  • I was able to get Branch's InstallListener to work as you attempted without any error. I used compileSDKVersion 23, buildToolsVersion "21.1.2" and SDK version (latest): compile 'io.branch.sdk.android:library:1.+'. Here's an example of the proper InstallListener declaration from a Branch testbed app: https://github.com/BranchMetrics/Android-Deferred-Deep-Linking-SDK/blob/master/Branch-SDK-TestBed/AndroidManifest.xml – Evan Mar 07 '16 at 19:24
  • @Evan Thanks, but that is not the issue. My listener works, it just shows the warning message. I get same warning for Branch TestBed app. – Dalija Prasnikar Mar 07 '16 at 20:17
  • Ah, I see! Sorry for the misinterpretation. There are tips here for how to remove the warning: http://stackoverflow.com/questions/16112470/android-exported-receiver-does-not-require-permission-on-receivers-meant-to – Evan Mar 08 '16 at 00:34
  • @Evan No problem, thanks for the link. Obviously setting exported to false is not a solution, maybe using `android:protectionLevel="signatureOrSystem"` would be way to go, but I am worried that it might mess up things and testing installer listeners under real conditions is not easy. Adding something I don't fully understand and hoping for the best might not be the best idea. – Dalija Prasnikar Mar 08 '16 at 13:43

1 Answers1

1

Permission in AndroidManifest.xml file should be set to android in this case:

...
android:permission="android.permission.INSTALL_PACKAGES"
...

Google Analytics document with sample is here.

crea7or
  • 4,421
  • 2
  • 26
  • 37