Exec function execution exception -- Application: PHP extracts the icon image of apk

Source: Internet
Author: User
Exec function execution error -- Application: PHP extract apk icon image by Lin Zimu wolinxuebin reprinted please keep: invalid exec function execution error -- Application: PHP extract apk icon image

Author: Lin Zimu wolinxuebin

Reprinted please keep: http://blog.csdn.net/wolinxuebin


I am working on a project today to read the image icon information from the apk. Because there is a large amount of data to be read, and now all the data that I tested is processed in the windows environment, the data is uploaded to the server after the data is processed. it has really been a long time.

I mainly did two things: 1. read the apk icon path and other information; 2. decompress the image under the path.

Directly go to the Code First:

 

The tools used are: 1. there are many apktool tools on the Internet, as well as installation tutorials. The only trouble is that the tool can only run in the java environment.

2. unzip: the http://download.csdn.net/detail/wolinxuebin/4464939 tested winrar and could not uncompress the apk, maybe because of my limited level


Here we will talk about a very important point,Exec running error

Today, my software was originally installed in E:/Program Files/GnuWin32/, so when I define it

define("UNZIP","E:/Program Files/GnuWin32/bin/unzip.exe");
However, if no result is returned during running, the exec will not report an error.

exec("{$aapt} d badging {$apk_file}",$out,$return);
Check that $ return is always 1.

This command can be fully run in the command line.

Finally, we found the directory in the commod parameter in exec,Cannot contain spaces, That is, the Program Files should be changed to ProgramFiles, so I changed the installation directory.

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.