0
votes

In my android application, i want to generate a random number which follows some rules. I write that method in a class and I don't want the users to see my formula. I am obfuscating my application, but some how by reverse engineering, we can see the methods and classes. How to prevent that class from getting reverse engineered. Once it is obfuscated even i also don't want to open those file. I just call that method from my application.

3
As Ori Lentz stated you could have a server sided calculation, would this be acceptable solution for your program, or does it need offline support? - CodeCamper
No i didnt use any server side codes. I just want to do it in native APK itself. - user1677237

3 Answers

1
votes

I think you should research Polymorphic code. This is different from Polymorphism in type theory. This stack overflow post should also help.

0
votes

Best practice would be to have that calculation done server-side and sent to the client.

Otherwise, it is nearly impossible (mathematically speaking) to prevent reverse engineering no matter what.

0
votes

Use the Android NDK, put the calculation in a native library and call it through JNI. You'll have to compile your native code for all the targeted architectures, which shouldn't be a problem if your code already runs in Java.