Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Proguard obfuscation is not working

 
Ranch Hand
Posts: 251
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why proguard won't obfuscate my code?

Initially, there were few rules in proguard file but now I have removed everything from proguard rules but still proguard is not obfuscating any of the code. I have checked it by decompiling the apk by dex2jar.  

How can I deal with it ?

 minifyEnabled true
 shrinkResources true
 useProguard true
 android.enableR8=false

What else can I do ?? any suggestions?
 
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have checked it by decompiling the apk by dex2jar.


How is that a check that obfuscation did not happen? What did you see that leads you to believe it didn't happen?
 
priyanshi bhardwaj
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:

I have checked it by decompiling the apk by dex2jar.



I wanted to make my android app more secured from reverse engineering so I have added proguard to it. I have used dex2jar and Jd-gui for checking whether proguard is working or not. I can still see my entire source code but few files are missing also. I am actually unable to understand whether it is working properly or not.


Tim Moores wrote:

How is that a check that obfuscation did not happen? What did you see that leads you to believe it didn't happen?


lasses and class members which are visible to me are also not renamed i.e. obfuscated


Just Fyi was following this articles :
 
Tim Moores
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post both the proguard-rules.pro and build.gradle files (put CODE tags around their respective contents when posting).
 
priyanshi bhardwaj
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote: build.gradle files (put CODE tags around their respective contents when posting).



 
priyanshi bhardwaj
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:

Post both the proguard-rules.pro



 
Tim Moores
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If we can't see the full build file, we don't know whether the ProGuard directive is in a place where they will be used.
 
Tim Moores
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which class names do you see unobfuscated? I note that the rules contain various duplications - that would not cause obfuscation to fail, but is obviously not a good thing.
 
priyanshi bhardwaj
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:Which class names do you see unobfuscated? I note that the rules contain various duplications - that would not cause obfuscation to fail, but is obviously not a good thing.



Can you point out the duplicate rules in it?. And my code is inside com-->example-->app -->otherPackagesName(package name according to structure of app )

Classes which are inside app are not obfuscated properly can see the entire source code in original form as in my code with same name also.



 
Tim Moores
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at the ProGuard rules carefully - you can spot duplicate rules easily.

If we don't know the class and package names that you think should be obfuscated we can't tell whether they would be covered by the rules.

If we can't see the full build file, we don't know whether the ProGuard directive is in a place where they will be used.



Also: Do you actually see during build time that ProGuard is being run? It produces quite a bit of output. Post that here.
 
priyanshi bhardwaj
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:
Also: Do you actually see during build time that ProGuard is being run? It produces quite a bit of output. Post that here.



Proguard is running I am debugging it since yesterday removing -donotskipnonpublicclassmembers. ended up that my dex.classes is getting obfuscated but apk is still not getting renamed. It's like if I am using dex2jar on classes.dex then I cannot see the actual source code but if use dex2jar on apk then I can see the full app source code.
Where I am going wrong here now ?
 
It's just a flesh wound! Or a tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic