• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Proguard obfuscation is not working

 
Ranch Hand
Posts: 235
  • Likes 2
  • Mark post as helpful
  • send pies
  • 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?
 
Saloon Keeper
Posts: 6704
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • 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: 235
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Posts: 6704
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • 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: 235
  • Mark post as helpful
  • send pies
  • 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: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:

Post both the proguard-rules.pro



 
Tim Moores
Saloon Keeper
Posts: 6704
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Posts: 6704
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • 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: 235
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Posts: 6704
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • 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: 235
  • Mark post as helpful
  • send pies
  • 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 ?
 
First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic