react-native-fetch-blob icon indicating copy to clipboard operation
react-native-fetch-blob copied to clipboard

Bug Fix Branch 0.11.0 - Solve Android security exposed app error

Open Moreno97 opened this issue 7 years ago • 9 comments

This PR is addressed to #358 . It solves the exposed security exception on Android devices with API version >= 24. In older API's the code hasn't changed, still uses file://....

Moreno97 avatar Nov 29 '17 11:11 Moreno97

Great work, @Moreno97 👍 Hope to see this merged soon and 0.11.0 released.

Jacse avatar Dec 03 '17 13:12 Jacse

I am getting the following error quite often, though. Don't know if I'm missing something?

* What went wrong:
Execution failed for task ':app:installRelease'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/com.jacoblauritzen.myapp-2: Can't install because provider name com.RNFetchBlob.provider (in package com.jacoblauritzen.myapp) is already used by com.jacoblauritzen.myapp.debug

Jacse avatar Jan 03 '18 15:01 Jacse

Hi @Jacse , maybe you have installed another app that is using the same provider. A quick fix is changing the provider on manifest of react-native-fetch-blob to get the provider of the package name (also remember to change the reference on the code). I will work on it. Thanks!

Moreno97 avatar Jan 04 '18 14:01 Moreno97

After some investigation I resolve the error. It's necessary to change the references on the library and add a provider in your app manifest like this:

        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
        </provider>

As soon as I can I'll update the PR.

Moreno97 avatar Jan 09 '18 10:01 Moreno97

Great! Yes, my release and debug versions are two different apps so I can tell the difference 😄

Jacse avatar Jan 11 '18 11:01 Jacse

FYI

react-native-fetch-blob has a new maintained location. Check out the README.

Please consider submitting your PR there, this repository is unmaintained.

lll000111 avatar Mar 25 '18 08:03 lll000111

@lll000111 Ok! As soon as we can we'll submit the PR there. Thanks!

Moreno97 avatar Apr 10 '18 16:04 Moreno97

Are you guys going to merge it?

pavermakov avatar Sep 27 '18 08:09 pavermakov

@pavermakov Of course not! Read the README.

lll000111 avatar Sep 27 '18 08:09 lll000111