05/15/2024 15:19:45

Problem description

Description of EXTERNAL_STORAGE related permissions in MSDKCore

Solution

The following is SD card. It has an external storage permission, which is a sensitive permission and requires dynamic application. MSDK declares this permission here but does not use it directly, and only uses it for models compatible with API Level 19 (Android 4.4) and below. This may cause confusion to the accessing party. If you need to deal with it, the suggestions for you are as follows:

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

Method 1:

Delete the above permission declaration, and ensure that minSdkVersion, a configuration about the minimum SDK, in the main AndroidManifest is 19 or above. Example:

<uses-sdk
        android:minSdkVersion="19"
        android:targetSdkVersion="28" />

If it is a gradle build, please make sure to make the following changes in the main project's build.gradle:

android{
    ...
    defaultConfig{
        ...
        minSdkVersion 19
    }
}

Method 2:

Modify the permission declaration below and add maxSdkVersion to make the application of the permission more accurate.

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

The reason why MSDK does not directly add maxSdkVersion is because the configuration can directly affect the final packaging, and the accessing party may not perceive it.
If you need to deal with the above situation, please do it based on the actual framework of your own project.



Copyright © 2024 MSDK.
All rights reserved.

results matching ""

    No results matching ""