Dagger: 2.28 dagger-android(-support) adding AndroidManifest permissions

Created on 28 May 2020  路  1Comment  路  Source: google/dagger

Updating to 2.28 on either of the Android specific Dagger dependencies is adding the following permissions to the AndroidManifest file:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

The merge log in Android Studio reports these are coming from dagger.lint

Implied from the Dagger.app main manifest (this file), line 1; reason: dagger.lint has a targetSdkVersion < 4 
Implied from the Dagger.app main manifest (this file), line 1; reason: dagger.lint requested WRITE_EXTERNAL_STORAGE 

See here for a blank example project with just the dagger-android and dagger-android-support dependencies and here for an APK comparison output on a project after an update from 2.27 to 2.28

Most helpful comment

Thanks for reporting this, looks like implicit system permissions are being merged because we missed adding a minSdkVersion to the lint manifest. In the mean time you can prevent the permissions from being merged using the tools markers.

>All comments

Thanks for reporting this, looks like implicit system permissions are being merged because we missed adding a minSdkVersion to the lint manifest. In the mean time you can prevent the permissions from being merged using the tools markers.

Was this page helpful?
0 / 5 - 0 ratings