0

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.

2
  • 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? Commented Mar 26, 2015 at 19:24
  • No i didnt use any server side codes. I just want to do it in native APK itself. Commented Mar 27, 2015 at 6:22

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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.

1 Comment

No i didnt use any server side codes. I just want to do it in native APK itself.
0

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.

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.