我想要一个为 Androidphp
生成的脚本,通过创建和分配.apk
keystore
jarasigner
此任务的命令:
- 蚂蚁
- 钥匙工具
- 罐头人
此命令在本地 PC 中执行,并在 php 脚本中安装了 Java 和 Android。那么在托管服务器上托管此脚本时如何在 Web 服务器上运行此命令?
function generate_apk($apk_data = array()) {
global $log_txt;
$apk_cmd = "ant -f \"{$apk_data['project_path']}/build.xml\" release\n";
$keystore_cmd = "keytool -genkey -dname 'cn=kamlesh jadeja, ou=JavaSoft, o=Sun, c=US' -storepass {$apk_data['password']}";
$keystore_cmd .= " -alias business -keypass {$apk_data['password']} -keystore {$apk_data['keystore_path']}{$apk_data['keystore']} -validity 36500 \n";
$jarassign = "jarsigner -verbose -digestalg SHA1";
$jarassign .= " -storepass {$apk_data['password']} -keypass {$apk_data['password']} -keystore {$apk_data['keystore_path']}{$apk_data['keystore']}";
$jarassign .= " {$apk_data['project_path']}bin/{$apk_data['apk_name']}-release-unsigned.apk business\n";
exec($apk_cmd);
exec($keystore_cmd);
exec($jarassign);
}