Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proguard Google Analytics

Does anyone know the keep statement that needs to be added to Proguard for Google Analytics?

I have this line right now but for some reason nothing is being reported...

 # google analytics, uncomment if using:
-keep class com.google.android.apps.analytics.PipelinedRequester$Callbacks
like image 312
coder_For_Life22 Avatar asked Oct 25 '12 15:10

coder_For_Life22


People also ask

What is difference between R8 and ProGuard?

R8 is having a faster processing time than Proguard which reduces build time. R8 gives better output results than Proguard. R8 reduces the app size by 10 % whereas Proguard reduces app size by 8.5 %. The android app having a Gradle plugin above 3.4.

What is ProGuard used for?

ProGuard is a tool to help minify, obfuscate, and optimize your code. It is not only especially useful for reducing the overall size of your Android application as well as removing unused classes and methods that contribute towards the intrinsic 64k method limit of Android applications.

Does R8 use ProGuard?

However, you can disable certain tasks or customize R8's behavior through ProGuard rules files. In fact, R8 works with all of your existing ProGuard rules files, so updating the Android Gradle plugin to use R8 should not require you to change your existing rules.

Should I use ProGuard?

Android apps are quite easy to reverse engineer, so if you want to prevent this from happening, you should use Proguard for its main function: Obfuscation. The other two important functions of Proguard are Shrinking and Optimization. Shrinking eliminates unused codes and it is highly useful.


1 Answers

I have a generic

-keep public class com.google.** {*;}

in my proguard.cfg and Google Analytics works fine.

Try this. If this does not solve the problem, then your problem is not Proguard but rather a Google Analytics configuration or connectivity issue.

like image 200
Sébastien Avatar answered Sep 20 '22 22:09

Sébastien