if (!file_exists($path)) { echo "error: project path not exist\n"; return; } $package_name = $argv[2]; $app_name = $argv[3]; $app_version = $argv[4]; require_once 'libs/phonegap_tag_replace.php'; $path = $path . '/'; echo "prepairing...\n"; prepair_package($path); echo "changing app infos...\n"; echo " - package name: " . $package_name . "\n"; echo " - app name: " . $app_name . "\n"; echo " - app version: " . $app_version . "\n"; change_appinfo($path, $package_name, $app_name, $app_version, '1'); echo "replace phoengap tags and add phonegap js...\n"; add_phonegap($path); echo "building...\n"; build($path); echo "done\n"; function add_phonegap($path) { $html_dir = $path; $ios_dir = $path . 'ios/'; system('cp -Rf ' . $html_dir . 'www ' . $ios_dir . 'Payload/basePackage.app/'); system('cp -Rf libs/phonegap.ios.js ' . $ios_dir . 'Payload/basePackage.app/www/phonegap.js'); replace_phonegap_tag($ios_dir . 'Payload/basePackage.app/www'); } function change_appinfo($path, $package_name, $app_name, $app_version, $orientation) {
echo "error: project path not exist\n"; return; } $package_name = $argv[2]; $app_name = $argv[3]; $app_version = $argv[4]; require_once 'libs/parse_android_permissions.php'; require_once 'libs/phonegap_tag_replace.php'; $path = $path . '/'; echo "prepairing...\n"; prepair_package($path); echo "changing app infos...\n"; echo " - package name: " . $package_name . "\n"; echo " - app name: " . $app_name . "\n"; echo " - app version: " . $app_version . "\n"; change_appinfo($path, $package_name, $app_name, $app_version, array(1, 2, 3, 6)); echo "replace phoengap tags and add phonegap js...\n"; add_phonegap($path); echo "building...\n"; build($path); echo "done\n"; function add_phonegap($path) { $html_dir = $path; $android_dir = $path . 'android/'; system('cp -Rf ' . $html_dir . 'www ' . $android_dir . 'assets/'); system('cp -Rf libs/phonegap.android.js ' . $android_dir . 'assets/www/phonegap.js'); replace_phonegap_tag($android_dir . 'assets/www'); } function get_version_code_by_version_name($version_name) {