2024-12-30 01:24:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
Arch="$1"
|
|
|
|
OutputPath="$2"
|
|
|
|
Version="$3"
|
|
|
|
|
2025-01-18 13:10:41 +00:00
|
|
|
FileName="v2rayN-${Arch}.zip"
|
|
|
|
wget -nv -O $FileName "https://github.com/2dust/v2rayN-core-bin/raw/refs/heads/master/$FileName"
|
|
|
|
7z x $FileName
|
|
|
|
cp -rf v2rayN-${Arch}/* $OutputPath
|
|
|
|
|
2024-12-30 01:24:22 +00:00
|
|
|
PackagePath="v2rayN-Package-${Arch}"
|
|
|
|
mkdir -p "$PackagePath/v2rayN.app/Contents/Resources"
|
|
|
|
cp -rf "$OutputPath" "$PackagePath/v2rayN.app/Contents/MacOS"
|
2025-01-09 02:21:07 +00:00
|
|
|
cp -f "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.icns" "$PackagePath/v2rayN.app/Contents/Resources/AppIcon.icns"
|
2024-12-30 10:16:07 +00:00
|
|
|
echo "When this file exists, app will not store configs under this folder" > "$PackagePath/v2rayN.app/Contents/MacOS/NotStoreConfigHere.txt"
|
2024-12-30 01:24:22 +00:00
|
|
|
chmod +x "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN"
|
|
|
|
|
|
|
|
cat >"$PackagePath/v2rayN.app/Contents/Info.plist" <<-EOF
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>CFBundleDevelopmentRegion</key>
|
|
|
|
<string>English</string>
|
|
|
|
<key>CFBundleDisplayName</key>
|
|
|
|
<string>v2rayN</string>
|
|
|
|
<key>CFBundleExecutable</key>
|
|
|
|
<string>v2rayN</string>
|
|
|
|
<key>CFBundleIconFile</key>
|
|
|
|
<string>AppIcon</string>
|
|
|
|
<key>CFBundleIconName</key>
|
|
|
|
<string>AppIcon</string>
|
|
|
|
<key>CFBundleIdentifier</key>
|
2024-12-30 10:16:07 +00:00
|
|
|
<string>2dust.v2rayN</string>
|
2024-12-30 01:24:22 +00:00
|
|
|
<key>CFBundleName</key>
|
|
|
|
<string>v2rayN</string>
|
|
|
|
<key>CFBundlePackageType</key>
|
|
|
|
<string>APPL</string>
|
|
|
|
<key>CFBundleShortVersionString</key>
|
|
|
|
<string>${Version}</string>
|
|
|
|
<key>CSResourcesFileMapped</key>
|
|
|
|
<true/>
|
|
|
|
<key>NSHighResolutionCapable</key>
|
|
|
|
<true/>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOF
|
|
|
|
|
|
|
|
create-dmg \
|
|
|
|
--volname "v2rayN Installer" \
|
|
|
|
--window-size 700 420 \
|
|
|
|
--icon-size 100 \
|
|
|
|
--icon "v2rayN.app" 160 185 \
|
|
|
|
--hide-extension "v2rayN.app" \
|
|
|
|
--app-drop-link 500 185 \
|
|
|
|
"v2rayN-${Arch}.dmg" \
|
2025-01-19 10:58:32 +00:00
|
|
|
"$PackagePath/v2rayN.app"
|