klaxit / hidden-secrets-gradle-plugin

🔒 Deeply hide secrets on Android
MIT License
395 stars 40 forks source link

Not returning correct key #48

Closed DatL4g closed 2 years ago

DatL4g commented 2 years ago

I created a test key like this

./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-1.11.0-openjdk-amd64 hideSecret -Pkey=test -PkeyName=Test -Ppackage=de.datlag.burningseries

The code got generated and I can call Secrets().getTest(packageName) However it doesn't return test, instead the output is :-v

When I call the obfuscate method like this

./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-1.11.0-openjdk-amd64 obfuscate -Pkey=test -Ppackage=de.datlag.burningseries

The output in terminal is

> Task :app:obfuscate
### SECRET ###
test

### PACKAGE NAME ###
de.datlag.burningseries

### OBFUSCATED SECRET ###
{ 0x41, 0x3, 0x4b, 0x47 }

The same value appears in the secrets.cpp file inside the getTest method char obfuscatedSecret[] = { 0x41, 0x3, 0x4b, 0x47 }; I have no additional customDecode method (so the provided method is default)

I'm not sure if I use it correctly but I think so. If you can't reproduce you can look in my code https://github.com/DATL4G/BurningSeries-Android (The repo does not contain this plugin, however it's not modified further yet so all you have to do is add it (I used the legacy method))

DatL4g commented 2 years ago

OK I finally found the issue. In my build.gradle.kts the specified applicationId was de.datlag.burning_series, however everywhere else the packageName was set to de.datlag.burningseries