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