3

Even after exporting my app with proguard enabled, Admob debug messages are still showing up on LogCat

It looks something like this

10-25 10:13:22.913: I/Ads(13399): adRequestUrlHtml: AFMA_buildAdURL({"preqs":12,"session_id":"6802423233789","u_sd":2,"seq_num":"13","slotname":"MY PRIVATE KEY!!","u_w":384,"msid":"com.mypackage","js":"afma-sdk-a-v6.1.0","toar":0,"mv":"80230011.com.android.vending","isu":"25C96A854AB7982C962ED93D02871DA89","cipa":1,"format":"320x50_mb","net":"ed","app_name":"41.android.com.my.package","hl":"en","u_h":592,"carrier":"23430","ptime":1112155,"u_audio":3});

How can I disable these messages?

edit:

This how my proguard config looks like

-dontwarn com.androidquery.auth.*

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

#-keepparameternames
-renamesourcefileattribute SourceFile
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
                SourceFile,LineNumberTable,*Annotation*,EnclosingMethod

#-keep public class com.androidquery.*,com.androidquery.callback.*,com.androidquery.util.AQUtility,com.androidquery.util.Constants {
-keep public class *{
    public protected *;
}

-keepclassmembernames class * {
    java.lang.Class class$(java.lang.String);
    java.lang.Class class$(java.lang.String, boolean);
}

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}
# Remove log messages
-assumenosideeffects class android.util.Log {
    public static *** d(...);
    public static *** v(...);
    public static *** i(...);
}
124697
  • 22,097
  • 68
  • 188
  • 315

2 Answers2

1

Check the following answer where debug and verbose logs are disabled in the proguard.cfg file using:

-assumenosideeffects class android.util.Log {
    public static *** d(...);
    public static *** v(...);
}

You can use this to also block INFO log message by using:

-assumenosideeffects class android.util.Log {
    public static *** d(...);
    public static *** v(...);
    public static *** i(...);
}

Edit: Note that although the messages won't be logged, the strings are still in the generated bytecode. See this answer for more info.

Community
  • 1
  • 1
Jeffrey Klardie
  • 3,020
  • 1
  • 18
  • 23
0

That message is an INFO level message from the Admob library. It's not your concern.

What's your concern, that is shows your AdUnitId? Are you worried that someone else is going to use it and give you credit for their traffic too?

I wouldn't worry about it.

William
  • 20,150
  • 8
  • 49
  • 91
  • well true but its very annoying because everytime an ad refreshes, my logcat is spammed – 124697 Oct 26 '13 at 19:14
  • That's why we have logcat filters – William Oct 27 '13 at 21:51
  • 1
    You have to apply the filter Everytime you load eclipse. Also if you want to filter for something else you'd have to remove the Admob filter and reapply it again – 124697 Oct 28 '13 at 19:26
  • You should be filtering for those messages that are of interest to you. I typically filter for only those messages from *my* app or even a particular component within that app. Adding removing filters is a single click, at least on a decent IDE, hardly taxing. – William Oct 29 '13 at 12:20