[Android] completely removes Google AdMob ads

Source: Internet
Author: User

Applications that contain advertisements can be understood, but they often cause user errors or download traffic during ad switching, which is a bit uncomfortable.

The following uses Google AdMob as an example to describe how to completely remove it.

 

Analyze how Google AdMob works.

Google AdMob uses the method of registering and embedding it into the layout to avoid coupling with the application. As a result, the removal is the reverse processing.

 

1. The first thing we must do is decompile the apk. We all like to use apktool.

2. Remove Google AdMob registration. In AndroidManifest. xml in The Decompilation folder, the following code is usually found at the end of the application node and the two lines are removed.

 

3. Remove the Google AdMob layout. Search for all layout xml files in the res \ layout decompiled folder and search for files containing com. google. ads. AdView, for example:

 

Remove the entire com. google. ads. AdView node. Note that after removing the AdView node, if the application does not fill up the originally displayed ad location, you must modify the layout_width or layout_height of other nodes in the xml file to fill up the interface.

Also remove the xmlns: ads = "http://schemas.android.com/apk/lib/com.google.ads" attribute on the root node.

So far, the ad removal work has come to an end. But I still think it is not perfect, because even though the advertisement is not started and not displayed, security software can still find the advertisement contained in the application, because the application also contains the Google AdMob code, so we have to continue to remove him. This is complete.

4. Remove the Google AdMob package. This is simple. Simply delete the com \ google \ ads folder of the decompiled folder.

5. At last, use apktool to re-compile the code, then sign the Code, upload it to your mobile phone, and install and run the code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.