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

Use Keystore Hash for Encryption #89

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant