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.
            Asked
            
        
        
            Active
            
        
            Viewed 505 times
        
    0
            
            
        - 
                    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 Mar 26 '15 at 19:24
- 
                    No i didnt use any server side codes. I just want to do it in native APK itself. – user1677237 Mar 27 '15 at 06:22
3 Answers
1
            
            
        I think you should research Polymorphic code. This is different from Polymorphism in type theory. This stack overflow post should also help.
 
    
    
        Community
        
- 1
- 1
 
    
    
        Concordance
        
- 47
- 1
- 10
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.
 
    
    
        Ori Lentz
        
- 3,668
- 6
- 22
- 28
- 
                    No i didnt use any server side codes. I just want to do it in native APK itself. – user1677237 Mar 27 '15 at 06:22
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.
 
    
    
        Nicklas Jensen
        
- 1,424
- 12
- 19
