Repackage anti apktool with different image magic words and extensions

Source: Internet
Author: User

I want to know the principle of an APK. Because the core function is in a jar package without source code, I want to use netbeans for debugging. You need to use apktool to re-package, but the following error persists:

650) This. width = 650; "src =" http://img.blog.csdn.net/20141009182330787? Watermark/2/text/character =/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma =/dissolve/70/gravity/center "style =" padding: 0px; margin: 0px; Vertical-align: Top; Border: none; "/>


If an error occurs, ic_share_music_thumb.png is not a PNG file.

So I found this file and used hiew to check the file header.

650) This. width = 650; "src =" http://img.blog.csdn.net/20141009182336185? Watermark/2/text/character =/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma =/dissolve/70/gravity/center "style =" padding: 0px; margin: 0px; Vertical-align: Top; Border: none; color: RGB (51,51, 51); font-family: Arial; line-Height: 26px; "/>


Find multiple other PNG files and compare them. The normal magic words should be as follows:

650) This. width = 650; "src =" http://img.blog.csdn.net/20141009182120109? Watermark/2/text/character =/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma =/dissolve/70/gravity/center "style =" padding: 0px; margin: 0px; Vertical-align: Top; Border: none; color: RGB (51,51, 51); font-family: Arial; line-Height: 26px; "/>


The magic word of ic_share_music_thumb.png should be the magic word of JPEG:

650) This. width = 650; "src =" http://img.blog.csdn.net/20141009182345763? Watermark/2/text/character =/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma =/dissolve/70/gravity/center "style =" padding: 0px; margin: 0px; Vertical-align: Top; Border: none; "/>


Ic_share_music_thumb.png is actually a jpeg file. The suffix is manually changed to PNG, but the display is compatible. If this file is compiled in the project, it is not recognized by apktool, so let it package and it will strike.

Change the suffix to JPEG. Everything is normal.

I guess this is what the author intentionally did. We can make a reference and change the suffix of a JPEG image in the project to PNG (Other inconsistent methods have not been tried). We can make a small decompilation.


This article from the "Empty altar" blog, please be sure to keep this http://chenjava.blog.51cto.com/374566/1571391

Repackage anti apktool with different image magic words and extensions

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.