Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test apk not getting shrinked (obfuscated) #27

Open
rokos opened this issue Oct 11, 2017 · 3 comments
Open

Test apk not getting shrinked (obfuscated) #27

rokos opened this issue Oct 11, 2017 · 3 comments

Comments

@rokos
Copy link

rokos commented Oct 11, 2017

If you try to minify (proguard) debug build by un-commenting :

 debug {
            // Run code coverage reports by default on debug builds.
            testCoverageEnabled = true

            // Uncomment this to run test against a minified version of the production APK
           
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            testProguardFile 'proguard-test-rules.pro'
           
        }

in app's build.gradle, *-androidTest.apk doesnt get obfuscated and method count is not reduced.

@TWiStErRob
Copy link

TWiStErRob commented Dec 20, 2017

I tried 2.2.1 (what this repo has right now) and 3.0.1 (upgraded the repo) and it both works.

For me it didn't work though, and the reason seems to be because I was trying to apply it to a library module (https://issuetracker.google.com/issues/70901453).

@tir38
Copy link

tir38 commented Mar 31, 2018

I had the same issue as @rokos. It wasn't limited to library module though as was the case for @TWiStErRob . I filed a bug for it:
https://issuetracker.google.com/issues/37134017

A google engineer responded:

Regarding the current issue: We do run Proguard but do not shrink code for test APKs. We use Proguard only to apply the mapping of the obfuscation of the tested app. This is a decision we made a few years ago.

Related bug: https://code.google.com/p/android/issues/detail?id=77475
Change: https://android-review.googlesource.com/#/c/119684/

So it looks like the documentation in this repo is actually wrong.

@gebitang
Copy link

@tir38 Thanks.

I googled around the whole day, and found your question on SO.

I think you are right. Proguad doesn't work for test app. both your reported bug and this one say the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants