5

To add AdMob to an Android application, the following is required in the manifest:

android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="YOUR_ADMOB_APP_ID"

Is there any way to protect YOUR_ADMOB_APP_ID from being visible as plain text here? It is exposed in the release apk-file with just a use of an archiver

Interkot
  • 697
  • 8
  • 10

2 Answers2

1

Good question. Yes AdMob app id can be easily visible to people with basic computer knowledge.

But why concern? It is only a key and not a password to steal your information in AdMob. Do you expect a hacker to use this key in his app, just for the purpose of increasing your AdMob income?

AIMIN PAN
  • 1,563
  • 1
  • 9
  • 13
  • 5
    What if they produce fake clicks on your AdMod AppId to make Google ban your account? – Liar Mar 15 '19 at 03:38
  • @Liar that is not easy. AppID is not the only information to produce an AdRequest, other information is not in manifest. – AIMIN PAN Mar 15 '19 at 05:48
  • 1
    I'm a bit concern about this, since they can make invalid clicks resulting to account suspension. You can read more from https://support.google.com/admob/answer/6213019?hl=en – NJY404 Apr 18 '20 at 04:15
0

Try encrypting your Id string using Cipher.

Check this answer for detailed implemetation.

When someone decompiles your code, they only see encrypted string. There is a private key that you must keep for yourself only.

Liar
  • 1,235
  • 1
  • 9
  • 19
  • 1
    You should not encrypt it. It is read by AdMob, not by your app -- you don't write code to read this information from manifest. – AIMIN PAN Mar 15 '19 at 05:38