Skip to content

Configuration

Efra Espada edited this page Jun 19, 2019 · 9 revisions

By default, the plugin will encrypt every strings.xml file inside src/main folder but you can choose a different configuration.

Let's suppose we have this application project (app and library).

With this schema and no configuration defined, only two files will be encrypted at compilation time.

StringCare allows adding more resource folders and string file names to find strings to hide.

Additional Resource Folders

On root-level build.gradle file:

apply plugin: StringCare
stringcare {
    modules {
        app {
            stringFiles = ["strings.xml","more_strings.xml"]
            srcFolders = ["src/main", "src/other_variant_source"]
        }
        library {
            srcFolders = ['src/other_folder/main']
        }
    }
}

Module build.gradle files:

// app build.gradle
android {
    sourceSets {
        main.res.srcDirs = ['src/main/res', 'src/other_variant_source/res']
    }
}
// library build.gradle
android {
    sourceSets {
        main.res.srcDirs = ['src/other_folder/res']
    }
}

Main Module

On root-level build.gradle file:

The default value is app

apply plugin: StringCare
stringcare {
    main_module "base"
}

Debug Logs

On root-level build.gradle file:

apply plugin: StringCare
stringcare {
    debug true
}