exec function Execution error-app: Php extract apk icon image
Author: Wolinxuebin Wood
Reprint please retain: Http://blog.csdn.net/wolinxuebin
Today in the project, read the image icon information from the APK. Because there is a lot of data to read, and because now the processing of their own testing is the Windows environment, the data processing after the upload to the server, really high half a day.
The main thing is to do two things: 1, read the APK icon path and other information 2, extract the image under the path.
Directly on the code first:
The tools used are: 1, apktool This online quite a lot, there are installation tutorials, the only trouble is to run in the Java environment
2, unzip:http://download.csdn.net/detail/wolinxuebin/4464939 test winrar can not decompress apk, maybe because I have limited level
Here's another important point,exec run error
Today, my software was installed under E:/program files/gnuwin32/, so define was
Define ("UNZIP", "E:/program Files/gnuwin32/bin/unzip.exe");
But always running without results, this exec will not error
EXEC ("{$aapt} d badging {$apk _file}", $out, $return);
View $return is always 1 then it is not running successfully.
This command is fully operational at the command line.
Finally found that the directory in the Commod parameter in exec () cannot contain spaces , that is, program Files should become ProgramFiles, so I changed an installation directory.