user1677237
user1677237

Reputation: 81

How to Obfuscate java code - android

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.

Upvotes: 0

Views: 549

Answers (3)

Nicklas Jensen
Nicklas Jensen

Reputation: 1474

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.

Upvotes: 0

Concordance
Concordance

Reputation: 47

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

Upvotes: 1

Ori Lentz
Ori Lentz

Reputation: 3688

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.

Upvotes: 0

Related Questions