Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Use Keystore Hash for Encryption#89

Open
dylan-kwon wants to merge 5 commits intoklaxit:masterfrom
dylan-kwon:with-signature
Open

Use Keystore Hash for Encryption#89
dylan-kwon wants to merge 5 commits intoklaxit:masterfrom
dylan-kwon:with-signature

Conversation

@dylan-kwon
Copy link

Overview

I have changed the encryption process to use the app signing keystore hash along with the packageName.

Reason

By using this plugin, the secret key in the app has been moved to the native layer, making it much harder to access through decompilation. Although it is technically possible to decompile the .so file to uncover its contents, this process is extremely challenging. Nevertheless, after a significant amount of time and effort, I was able to import the .so file into another project and retrieve the secret key.

Of course, this plugin returns incorrect values if the package name doesn't match. However, since the package name is easily exposed, I believe it's not secure enough on its own, which is why I created this PR.

Method

I have added a mandatory -PkeyHash input. Users are required to enter the hash of the keystore they used to build their app here.

Additionally, I have modified the existing obfuscator generation method from SHA(packageName) to SHA(packageName + keyHash).

To prevent the keyHash from being exposed, it is only used during the creation of the obfuscator and is not stored in the native layer. During runtime, the keyHash is loaded by accessing the PackageManager API in signature.cpp.

In Conclusion

I agree with the statement, "Nothing on the client-side is unbreakable." This PR was created to enhance security. even if just slightly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant