简体   繁体   中英

How can I prevent copying/pirating native compiled files (.so file) from my Android APK?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM