StringCare / AndroidLibrary

Android library to reveal or obfuscate strings and assets at runtime
Apache License 2.0
244 stars 44 forks source link

Resource not found #76

Closed jimlyas closed 4 years ago

jimlyas commented 4 years ago

This is the log image

And this is my build.gradle (app) : image

I am using version 4.0.0, please help @efraespada

efraespada commented 4 years ago

@jimlyas What resource is not found? The strings.xml is detected with your current SC config (the default).

The sourceSets config also seems to be the default, so you can remove it.

So you only need this:

stringcare {
    debug true
    assetsFiles = ["*.json"]
}

If you want to add more files:

stringcare {
    debug true
    assetsFiles = ["*.json"]
    stringFiles = ["strings.xml", "other_strings.xml"]
}
efraespada commented 4 years ago

Also, I recommend you to use the FileInputStream as a separate field and close() the stream after load it in the Properties object.

apply plugin: StringCare

def apiKeyProperties = new Properties()
def apiFile = file('./apiKey.properties')
def inputStream = new FileInputStream(apiFile)
apiKeyProperties.load(inputStream)
inputStream.close()

stringcare {
    debug true
    assetsFiles = ["*.json"]
}
jimlyas commented 4 years ago

thanks, it worked... :)