Exploring the Android Apk decryption Project (5)-advertisement and pop-up window

Source: Internet
Author: User

In many Apk applications on the Internet, the author adds ads to free versions, and a large number of de-advertising versions appear on the Internet. In addition, there are some software that will pop up at startup, either useless prompts or suggestions for registration. Android enthusiasts are keen to download these Android software without ad-free pop-up windows. The reason is also very simple and looks comfortable to use. In this section, we will briefly study how these advertisements and pop-up windows are removed. Of course, all the modifications here are based on the decompilation of apktool. As mentioned in the previous article, let's talk about the core part. The object of the experiment is also a simple self-written apk. The following figure shows the simplest way to ad images: Modify the width and height attributes of ImageView in layout to 0 dip. In this way, the part length and width of the displayed ad are changed to zero. The advantage of this operation is that it is simple. The disadvantage is that the image still exists and occupies resources. If it is an online advertisement, it will be downloaded from the Internet. Of course, downloading images consumes a certain amount of traffic. Relatively thorough ad Removal Methods: Taking ImageView as an example, the methods for loading images (or animations) in ImageView include setImageBitmap, setAnimation, setBackgroundDrawable, and draw. Find these functions in smali, then use # To comment out the part. Then, set the width and height of the ImageView in layout to 0dip. (to avoid program errors, it is not recommended to delete them.) if it is a network image, there will be a network download step. You can comment out all the corresponding steps. You can set the Url to null by simply modifying the vertex. In this example, I changed const-string v6, "http://www.baidu.com/img/logo-yy.gif" to const-string v6, "" so that apk could not be downloaded to the image from the specified address. In this example, the pop-up window is from AlertDialog. you can comment out the Code related to the entire Builder and AlertDialog, and simply modify it to annotate the show event. As follows:

Finally, let's test it!

Related Article

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.