Preliminary Exploration of 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 image is as follows:

Ad

The simplest method of AD removal:Modify the width and height attributes of imageview in layout to 0dip.

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. As follows:

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, and you can comment out all the corresponding steps. You can set the URL to null by simply modifying the vertex. In this example

Const-string V6, "http://www.baidu.com/img/logo-yy.gif"

Change

Const-string V6 ,""

In this way, the APK cannot be downloaded from the specified address to the image.

Pop-up window

In this example, the pop-up window in this example is from alertdialog. you can comment out the Code related to the entire builder and alertdialog, and simply modify the show event comment. 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.