1

I am using NDK/c++ to do complex calculations in my Android app. After the compilation, .so files are present in the lib folder. I am wondering whether anyone can copy those .so files and use my algorithm in their android app. If possible, how can I prevent that?

1 Answer 1

2

Yes it's possibile.

You can:

  • check Application's PackageName from your JNI/NDK code to check if it match YOUR specific PackageName
  • generate a MD5/SHA of main "classes.dex" file and verify this hash from your JNI code (this method is the most secure of them but the most long to be done) and trigger a JVM exit if them doesn't match
  • add a cyphed argument on most used JNI method that only your App can encrypt correctly, and then decrypt it from your JNI throwing a JVM exit if the decrypted value is not right
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.