Skip to content

Commit

Permalink
Merge pull request #16 from efraespada/develop
Browse files Browse the repository at this point in the history
Config extensions
  • Loading branch information
efraespada authored Dec 11, 2017
2 parents 0d02868 + dae9d51 commit bba1d1f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 14 deletions.
49 changes: 44 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ Hide strings easily with that lib and plugin! It uses AES/ECB/PKCS5Padding trans
Gradle implementation
------------

root_project/build.gradle
```groovy
// root_project/build.gradle

apply plugin: com.efraespada.stringobfuscatorplugin.StringObfuscatorPlugin

buildscript {

ext {
aso_sop_version = '0.4.1'
aso_sop_version = '0.5.0'
}

repositories {
Expand All @@ -23,12 +26,11 @@ buildscript {
}

}

apply plugin: com.efraespada.stringobfuscatorplugin.StringObfuscatorPlugin
```

root_project/app/build.gradle
```groovy
// root_project/your_module/build.gradle

repositories {
jcenter()
}
Expand Down Expand Up @@ -98,6 +100,43 @@ message += "\n\nFor Metal Gear lovers:\n\n\"Snake, the password is " +

<p align="center"><img width="40%" vspace="20" src="https://raw.githubusercontent.com/efraespada/AndroidStringObfuscator/master/sample.png"></p>


Configuration
-----------------------------
By default the plugin will encrypt every `strings.xml` file inside `src/main`folder but you can choose a different configuration.
```groovy
// root_folder/build.gradle
apply plugin: com.efraespada.stringobfuscatorplugin.StringObfuscatorPlugin

stringobfuscator {

modules {

sample {
stringFiles = ['strings.xml',"other_file.xml"]
srcFolders = ['src/main', "other_folder"]
}

// root_folder/sample/src/main/res/.../strings.xml
// root_folder/sample/src/main/res/.../other_file.xml
// root_folder/sample/other_folder/res/.../strings.xml
// root_folder/sample/other_folder/res/.../other_file.xml

other_module {
srcFolders = ['src/moduleB']
}

// root_folder/other_module/src/moduleB/res/.../strings.xml

other_module_ {} //

// root_folder/other_module_/src/main/res/.../strings.xml

}

}
```

Gradle Console Output Example
-----------------------------
```
Expand Down
6 changes: 3 additions & 3 deletions androidstringobfuscator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = "0.4.1"
version = "0.5.0"

android {
compileSdkVersion 25
Expand All @@ -12,7 +12,7 @@ android {
minSdkVersion 9
targetSdkVersion 25
versionCode 1
versionName "0.4.1"
versionName "0.5.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand All @@ -34,7 +34,7 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:appcompat-v7:25.4.0'
testCompile 'junit:junit:4.12'
}

Expand Down
17 changes: 11 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: com.efraespada.stringobfuscatorplugin.StringObfuscatorPlugin

buildscript {

Expand All @@ -17,8 +16,8 @@ buildscript {
}

dependencies {
// classpath files('../StringObfuscatorPlugin/build/libs/stringobfuscatorplugin-0.4.1.jar')
classpath "com.efraespada:stringobfuscatorplugin:$aso_sop_version"
classpath files('../StringObfuscatorPlugin/build/libs/stringobfuscatorplugin-0.5.0.jar')
// classpath "com.efraespada:stringobfuscatorplugin:$aso_sop_version"
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1"
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
Expand All @@ -37,5 +36,11 @@ task clean(type: Delete) {
delete rootProject.buildDir
}

apply plugin: com.efraespada.stringobfuscatorplugin.StringObfuscatorPlugin

stringobfuscator {
modules {
sample {
stringFiles = ['strings.xml']
srcFolders = ['src/main']
}
}
}

0 comments on commit bba1d1f

Please sign in to comment.