简体   繁体   中英

How to protect the AdMob App ID in Android manifest?

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM