Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strings are not obfuscated on build time #15

Closed
d-moreira opened this issue Dec 10, 2017 · 6 comments
Closed

Strings are not obfuscated on build time #15

d-moreira opened this issue Dec 10, 2017 · 6 comments

Comments

@d-moreira
Copy link
Contributor

Hello,

I'm following https://github.com/efraespada/AndroidStringObfuscator/blob/master/README.md#gradle-implementation but the string resources are no longer obfuscated during build time (everything was working fine with these instructions https://github.com/efraespada/AndroidStringObfuscator/blob/3451745f18fdc97ca58b271d238eef60511b348b/README.md).

My root_project/build.gradle looks like:

...

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.2'
        classpath "com.efraespada:stringobfuscatorplugin:0.4.1"
        ...
    }
}
apply plugin: com.efraespada.stringobfuscatorplugin.StringObfuscatorPlugin

and my root_project/app/build.gradle looks like:

repositories {
    jcenter()
} 
 
dependencies {
    compile "efraespada:androidstringobfuscator:0.4.1"
}

Am I missing something? How are the strings supposed to be obfuscated during build time after removing the AndroidStringObfuscator.jar and the code to use it?

@efraespada
Copy link
Member

@d-moreira the new plugin replaces the JARfile. It should find in res folder every strings.xml file and encrypt every string value with hidden attribute as true.

What is printing your Gradle console?

@d-moreira
Copy link
Contributor Author

Ok, it's working now :) I was trying to obfuscate some strings on a res/values/secrets.xml file, which worked previously.

So the plugin only looks for strings on strings.xml files? Can you consider extending the functionality to look for string resources on any .xml file under res/values at least? And also update the documentation to reflect this limitation.

Thanks!

@efraespada
Copy link
Member

I was thinking something like this on module's build.gradle:

stringobfuscator {
    srcFolder = ["src/main/res"]
    stringFiles = ["strings.xml", "secrets.xml"]
}

Of course, I'll update the documentation. Thanks for your patient.

@d-moreira
Copy link
Contributor Author

That would be even better. Thank you!

@efraespada
Copy link
Member

@d-moreira hope it helps you! v.0.5.0.

@d-moreira
Copy link
Contributor Author

Tested and working!

Thanks for your work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants