ThanosFisherman / WifiUtils

Easily Connect to WiFi Networks
Apache License 2.0
734 stars 188 forks source link

android:allowBackup is forced to true - security impact #62

Closed anctsys closed 4 years ago

anctsys commented 4 years ago

Hi

Why did you put android:allowBackup in this file at true
WifiUtils/sample/src/main/AndroidManifest.xml at sample/src/main/AndroidManifest.xml Because when i install another library ( https://github.com/JuanSeBestia/react-native-wifi-reborn#readme) who use Wifiutils I have conflict with my manifest and yours. And that force me to pass my manifest parameters allowBackup to true.

<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.thanosfisherman.wifiutils.sample"
          xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>

</manifest>

Can you help me to found a solution

ThanosFisherman commented 4 years ago

Hi,

I'm not sure I understand what you're trying to do. Why would you want to use the sample project with this react native library?

Could you please post the error message if you get any?

anctsys commented 4 years ago

Hi

I try to install https://github.com/JuanSeBestia/react-native-wifi-reborn library

$ npm install react-native-wifi-reborn --save $ npx react-native run-android --verbose

After this command the build start and stop with this error message

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/home/mycoco/web/DevMob/myapp/mydev/mobile/android/app/src/debug/AndroidManifest.xml:12:7-34 Error:
    Attribute application@allowBackup value=(false) from AndroidManifest.xml:12:7-34
    is also present at [com.thanosfisherman.wifiutils:wifiutils:1.5.1] AndroidManifest.xml:18:9-35 value=(true).
    Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:7:5-117 to override.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:12:7-34
    is also present at [com.thanosfisherman.wifiutils:wifiutils:1.5.1] AndroidManifest.xml:18:9-35 value=(true).
    Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:7:5-117 to override.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s

Thank you for help me

eliaslecomte commented 4 years ago

This is already merged here: https://github.com/ThanosFisherman/WifiUtils/pull/57

anctsys commented 4 years ago

Thanks , Very Good