apptentive / apptentive-android

Apptentive Android SDK
http://www.apptentive.com
BSD 3-Clause "New" or "Revised" License
65 stars 64 forks source link

Unable to remove implicite permission of Read SD Card permission after targeting Android O ie api level 27 #160

Closed vinayakkumar closed 6 years ago

vinayakkumar commented 6 years ago

After Targetting to Android target SDK version 27 we are getting the issue . Unwanted permission request coming from the AppTentive Can you please remove this code from the aar code .Which is causing problem

I am using arr in dependencies of gradle.

Manifest merger log ADDED from [com.apptentive:apptentive-android:5.0.2] C:\Users\310165193.gradle\caches\transforms-1\files-1.1\apptentive-android-5.0.2.aar\352959199fd811f76957c3e2c16a3cc9\AndroidManifest.xml:34:13-81 uses-permission#android.permission.READ_EXTERNAL_STORAGE IMPLIED from C:\Users\310165193\Documents\DMBuild\DMBuildFroBugFix\Development\DreamMapper\app\src\chinaprod\AndroidManifest.xml:2:1-114:12 reason: com.apptentive.android.sdk requested WRITE_EXTERNAL_STORAGE

weeeBox commented 6 years ago

Hi @vinayakkumar,

Sorry for the issue. Would you be able to provide your build.gradle file?

vinayakkumar commented 6 years ago

Build.gradle

apply plugin: 'com.android.application'

android { compileSdkVersion 27 buildToolsVersion '27.0.3' useLibrary 'org.apache.http.legacy'

defaultConfig {
    applicationId "com.philips.sleepmapper.root"
    targetSdkVersion 27
    minSdkVersion 21
    versionCode 93
    versionName "2.15 (Alpha June 14)"
}

signingConfigs {
    release {

    }
}

buildTypes {
    release {
        debuggable true
        minifyEnabled true
        testCoverageEnabled false
        signingConfig signingConfigs.release
        proguardFiles 'proguard-project.txt'

        applicationVariants.all { variant ->
            variant.outputs.all {
                def SEP = "-"
                def flavor = variant.productFlavors[0].name
                def buildType = variant.variantData.variantConfiguration.buildType.name
                def newName = "DreamMapper${SEP}${flavor}${SEP}${buildType}.apk"
                outputFileName = newName;
            }
        }
    }
}

flavorDimensions "default"

productFlavors {
    /**
     * For Prod dev security build for non china build should have com.philips.sleepmapper.root
     * If changes it will not go as update on existing app with same app package.
     * For app update only we have to keep this package on all other countries.
     * Appname is DreamMapper
     */
    prod {
        applicationId "com.philips.sleepmapper.root"
        resValue "string", "application_name", "@string/app_name_default"
        dimension "default"
    }
    dev {
        applicationId "com.philips.sleepmapper.root"
        resValue "string", "application_name", "@string/app_name_default"
        dimension "default"
    }
    security {
        applicationId "com.philips.sleepmapper.root"
        resValue "string", "application_name", "@string/app_name_default"
        dimension "default"
    }
    /**
     * For Chinadev and Chinaprod app package name should be  com.philips.dreammapper.Which
     * made due to china stores requirements so don't alter or combine package names of app.
     * AppName is 睡眠管家
     */
    chinadev {
        applicationId 'com.philips.dreammapper'
        resValue "string", "application_name", "@string/app_name_china"
        sourceSets {
            main {
                manifest.srcFile 'src/chinadev/AndroidManifest.xml'
            }
        }
        dimension "default"
    }
    chinaprod {
        applicationId 'com.philips.dreammapper'
        resValue "string", "application_name", "@string/app_name_china"
        sourceSets {
            main {
                manifest.srcFile 'src/chinaprod/AndroidManifest.xml'
            }
        }
        dimension "default"
    }
}

lintOptions {
    checkReleaseBuilds false
    abortOnError false
}

}

repositories { jcenter() }

dependencies { implementation 'com.android.volley:volley:1.1.0' implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.google.android.gms:play-services-gcm:11.8.0' implementation 'com.apptentive:apptentive-android:5.0.2' implementation 'com.google.code.gson:gson:2.8.2' implementation ('com.android.support:design:27.1.0'){ exclude group: 'com.android.support', module:'cardview-v7' } implementation 'joda-time:joda-time:2.9.9' implementation 'com.android.support:cardview-v7:27.1.0' implementation 'com.android.support:support-v4:27.1.0' implementation project(':dreammapperres') }

/**/ apply plugin: 'com.android.library'

android { /**

dependencies { implementation 'com.android.support:design:27.1.0' implementation 'com.android.support:support-v4:27.1.0' }

/****Root build***/ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { google() jcenter() } }

task clean(type: Delete) { delete rootProject.buildDir }

/***Settings.gardle****/ include ':app', ':dreammapperres'

/*Manifest / <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove" />

we are using but it is not removing it will remove wite permission but read permission is not removed .. even though we mention alss similar to this to for read permission

vinayakkumar commented 6 years ago

Refer https://github.com/bitstadium/HockeySDK-Android they have done this fix

weeeBox commented 6 years ago

Thanks for the info, @vinayakkumar!

weeeBox commented 6 years ago

Fixed in the upcoming 1.5.4 release.