Skip to content

Bug: library doesn't seem to obfuscate anymore, as the strings can be found, hard-coded... #61

@AndroidDeveloperLB

Description

@AndroidDeveloperLB
classpath 'io.michaelrocks:paranoid-gradle-plugin:0.3.7'

I've noticed that the strings I was sure that this library obfuscate actually appear as they are, not obfuscated at all.

Steps:

  1. Either import the attached project, or use this:
@Obfuscate
object Keys {
    //
    const val SECRET_KEY = "HelloParanoid"
}
class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        Toast.makeText(this, Keys.SECRET_KEY, Toast.LENGTH_LONG).show()
    }
}
  1. Create a release-version. You can use the keystore I've added here. Password and everything there is just "keystore".
  2. De-obfuscate using some tool. I used:

http://www.javadecompilers.com/apk

  1. Download the result (there is a button there of "Save"), and extract it.
  2. Search inside the extracted folder for the value of the obfuscated key. In this case search for "HelloParanoid".

The bug is that it's still there as it is, hard-coded:

...
Toast.makeText(this, "HelloParanoid", 1).show();
...

ParanoidTest.zip

For a moment I thought this is because I use Kotlin, but it happens on Java too....

How could it be? I remember it worked fine in the past, no?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions