0

How I can apply a network_security_config.xml on specific variants and not in re...

 2 years ago
source link: https://dev.to/pcmagas/how-i-can-apply-a-networksecurityconfigxml-on-specific-variants-and-not-in-release-one-2gn3
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How I can apply a network_security_config.xml on specific variants and not in release one?

I want self-signed certificates to be applied in a specific variant and NOT in release or staging ones. Is there a way to do so?

More Info on:

In my build.gradle I have the follwing buildTypes:

buildTypes {
        release {
            //debuggable true
            minifyEnabled false
            signingConfig signingConfigs.config
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField "String", "SERVER_DOMAIN", "\"api.example.com\""
        }
        debug {
            minifyEnabled false
            buildConfigField "String", "SERVER_DOMAIN", "\"api.local\""
        }

        staging {
            initWith debug
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField "String", "SERVER_DOMAIN", "\"https://api.staging.example.com\""
        }

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK