mirror of
https://github.com/yanue/V2rayU.git
synced 2026-01-07 22:09:48 +00:00
update version: 2.0.0
This commit is contained in:
parent
381be18d84
commit
dee21f5df1
BIN
Build/V2rayU.icns
Normal file
BIN
Build/V2rayU.icns
Normal file
Binary file not shown.
26
Build/appdmg.json
Normal file
26
Build/appdmg.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"title": "V2rayU Installer",
|
||||
"icon": "V2rayU.icns",
|
||||
"icon-size": 80,
|
||||
"background": "V2rayU-dmg@2x.png",
|
||||
"window": {
|
||||
"size": {
|
||||
"width": 500,
|
||||
"height": 292
|
||||
}
|
||||
},
|
||||
"contents": [
|
||||
{
|
||||
"x": 380,
|
||||
"y": 120,
|
||||
"type": "link",
|
||||
"path": "/Applications"
|
||||
},
|
||||
{
|
||||
"x": 120,
|
||||
"y": 120,
|
||||
"type": "file",
|
||||
"path": "V2rayU.app"
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB |
0
Build/pac/abp.js
Normal file → Executable file
0
Build/pac/abp.js
Normal file → Executable file
0
Build/pac/gfwlist.txt
Normal file → Executable file
0
Build/pac/gfwlist.txt
Normal file → Executable file
0
Build/pac/user-rule.txt
Normal file → Executable file
0
Build/pac/user-rule.txt
Normal file → Executable file
@ -178,6 +178,22 @@ function downloadV2ray() {
|
||||
rm -fr v2ray-macos.zip
|
||||
}
|
||||
|
||||
function createDmgByAppdmg() {
|
||||
umount "/Volumes/${APP_NAME}"
|
||||
|
||||
rm -rf ${BUILD_DIR}/${APP_NAME}.app ${BUILD_DIR}/${DMG_FINAL}
|
||||
\cp -Rf "${V2rayU_RELEASE}/${APP_NAME}.app" "${BUILD_DIR}/${APP_NAME}.app"
|
||||
|
||||
# https://github.com/LinusU/node-appdmg
|
||||
# npm install -g appdmg
|
||||
echo ${BUILD_DIR}/appdmg.json
|
||||
appdmg appdmg.json ${DMG_FINAL}
|
||||
|
||||
# appcast sign update
|
||||
${AppCastDir}/bin/sign_update ${DMG_FINAL}
|
||||
|
||||
umount "/Volumes/${APP_NAME}"
|
||||
}
|
||||
|
||||
function makeDmg() {
|
||||
echo "正在打包版本: V"${APP_Version}
|
||||
@ -199,7 +215,7 @@ function makeDmg() {
|
||||
updatePlistVersion
|
||||
downloadV2ray
|
||||
build
|
||||
createDmg
|
||||
createDmgByAppdmg
|
||||
}
|
||||
|
||||
function publish() {
|
||||
|
||||
0
Build/sketch/bg.sketch
Normal file → Executable file
0
Build/sketch/bg.sketch
Normal file → Executable file
0
Build/sketch/icns.sketch
Normal file → Executable file
0
Build/sketch/icns.sketch
Normal file → Executable file
0
Build/sketch/icon.sketch
Normal file → Executable file
0
Build/sketch/icon.sketch
Normal file → Executable file
141
Build/test.sh
141
Build/test.sh
@ -1,141 +0,0 @@
|
||||
#!/bin/bash
|
||||
# 打包,发布
|
||||
|
||||
APP_NAME="V2rayU"
|
||||
INFOPLIST_FILE="Info.plist"
|
||||
BASE_DIR=$HOME/swift/V2rayU
|
||||
BUILD_DIR=${BASE_DIR}/Build
|
||||
V2rayU_ARCHIVE=${BUILD_DIR}/V2rayU.xcarchive
|
||||
V2rayU_RELEASE=${BUILD_DIR}/release
|
||||
APP_Version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${BASE_DIR}/${APP_NAME}/${INFOPLIST_FILE}")
|
||||
DMG_FINAL="${APP_NAME}.dmg"
|
||||
APP_TITLE="${APP_NAME} - V${APP_Version}"
|
||||
AppCastDir=$HOME/swift/appcast
|
||||
|
||||
function build() {
|
||||
echo "Building V2rayU."${APP_Version}
|
||||
echo "Cleaning up old archive & app..."
|
||||
rm -rf ${V2rayU_ARCHIVE} ${V2rayU_RELEASE}
|
||||
|
||||
echo "Building archive... please wait a minute"
|
||||
xcodebuild -workspace ${BASE_DIR}/V2rayU.xcworkspace -config Release -scheme V2rayU -archivePath ${V2rayU_ARCHIVE} archive
|
||||
|
||||
echo "Exporting archive..."
|
||||
xcodebuild -archivePath ${V2rayU_ARCHIVE} -exportArchive -exportPath ${V2rayU_RELEASE} -exportOptionsPlist ./build.plist
|
||||
|
||||
echo "Cleaning up archive..."
|
||||
rm -rf ${V2rayU_ARCHIVE}
|
||||
|
||||
chmod -R 755 "${V2rayU_RELEASE}/${APP_NAME}.app/Contents/Resources/v2ray-core"
|
||||
chmod -R 755 "${V2rayU_RELEASE}/${APP_NAME}.app/Contents/Resources/unzip.sh"
|
||||
}
|
||||
|
||||
function createDmg() {
|
||||
umount "/Volumes/${APP_NAME}"
|
||||
|
||||
############# 1 #############
|
||||
APP_PATH="${V2rayU_RELEASE}/${APP_NAME}.app"
|
||||
DMG_BACKGROUND_IMG="dmg-bg@2x.png"
|
||||
|
||||
DMG_TMP="${APP_NAME}-temp.dmg"
|
||||
|
||||
# 清理文件夹
|
||||
echo "createDmg start."
|
||||
rm -rf "${DMG_TMP}" "${DMG_FINAL}"
|
||||
# 创建文件夹,拷贝,计算
|
||||
SIZE=`du -sh "${APP_PATH}" | sed 's/\([0-9\.]*\)M\(.*\)/\1/'`
|
||||
SIZE=`echo "${SIZE} + 1.0" | bc | awk '{print int($1+0.5)}'`
|
||||
# 容错处理
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: Cannot compute size of staging dir"
|
||||
exit
|
||||
fi
|
||||
# 创建临时dmg文件
|
||||
hdiutil create -srcfolder "${APP_PATH}" -volname "${APP_NAME}" -fs HFS+ \
|
||||
-fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "${DMG_TMP}"
|
||||
echo "Created DMG: ${DMG_TMP}"
|
||||
|
||||
############# 2 #############
|
||||
DEVICE=$(hdiutil attach -readwrite -noverify "${DMG_TMP}"| egrep '^/dev/' | sed 1q | awk '{print $1}')
|
||||
|
||||
# 拷贝背景图片
|
||||
mkdir /Volumes/"${APP_NAME}"/.background
|
||||
cp "${BUILD_DIR}/${DMG_BACKGROUND_IMG}" /Volumes/"${APP_NAME}"/.background/
|
||||
# 使用applescript设置一系列的窗口属性
|
||||
echo '
|
||||
tell application "Finder"
|
||||
tell disk "'${APP_NAME}'"
|
||||
open
|
||||
set current view of container window to icon view
|
||||
set toolbar visible of container window to false
|
||||
set statusbar visible of container window to false
|
||||
set the bounds of container window to {0, 0, 560, 297}
|
||||
set viewOptions to the icon view options of container window
|
||||
set arrangement of viewOptions to not arranged
|
||||
set icon size of viewOptions to 80
|
||||
set background picture of viewOptions to file ".background:'${DMG_BACKGROUND_IMG}'"
|
||||
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
|
||||
delay 1
|
||||
set position of item "'${APP_NAME}'.app" of container window to {120, 120}
|
||||
set position of item "Applications" of container window to {380, 120}
|
||||
close
|
||||
open
|
||||
update without registering applications
|
||||
delay 2
|
||||
end tell
|
||||
end tell
|
||||
' | osascript
|
||||
|
||||
sync
|
||||
# 卸载
|
||||
hdiutil detach "${DEVICE}"
|
||||
|
||||
############# 3 #############
|
||||
echo "Creating compressed image"
|
||||
hdiutil convert "${DMG_TMP}" -format UDZO -imagekey zlib-level=9 -o "${DMG_FINAL}"
|
||||
|
||||
# appcast sign update
|
||||
${AppCastDir}/bin/sign_update ${DMG_FINAL}
|
||||
|
||||
umount "/Volumes/${APP_NAME}"
|
||||
}
|
||||
|
||||
function downloadV2ray() {
|
||||
echo "正在查询最新版v2ray ..."
|
||||
rm -fr v2ray-macos.zip v2ray-core
|
||||
tag=$(curl --silent "https://api.github.com/repos/v2ray/v2ray-core/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||
echo "v2ray-core version: ${tag}"
|
||||
url="https://github.com/v2ray/v2ray-core/releases/download/${tag}/v2ray-macos.zip"
|
||||
echo "正在下载最新版v2ray: ${tag}"
|
||||
curl -Lo v2ray-macos.zip ${url}
|
||||
|
||||
unzip -o v2ray-macos.zip -d v2ray-core
|
||||
rm -fr v2ray-macos.zip
|
||||
}
|
||||
|
||||
echo "正在打包版本: V"${APP_Version}
|
||||
read -n1 -r -p "请确认版本号是否正确 [Y/N]? " answer
|
||||
case ${answer} in
|
||||
Y | y ) echo
|
||||
echo "你选择了Y";;
|
||||
N | n ) echo
|
||||
echo ""
|
||||
echo "OK, goodbye"
|
||||
exit;;
|
||||
*)
|
||||
echo ""
|
||||
echo "请输入Y|N"
|
||||
exit;;
|
||||
esac
|
||||
|
||||
rm -fr ${DMG_FINAL} ${V2rayU_RELEASE}
|
||||
updatePlistVersion
|
||||
downloadV2ray
|
||||
build
|
||||
createDmg
|
||||
read -p "请输入版本描述: " release_note
|
||||
pushRelease ${release_note}
|
||||
generateAppcast ${release_note}
|
||||
commit
|
||||
rm -rf "${DMG_TMP}" "${APP_PATH}" "${V2rayU_RELEASE}"
|
||||
echo "Done"
|
||||
@ -43,6 +43,7 @@
|
||||
66FEAD53217EE14C009DECF9 /* ConfigWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 66FEAD4E217EE14C009DECF9 /* ConfigWindow.xib */; };
|
||||
6D6DF2CF13D9FD3C7C6492A4 /* QrcodeWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6DF12EA09D2D80788666D0 /* QrcodeWindow.swift */; };
|
||||
6D6DF2F2DFB2234541488BBD /* PreferenceSubscribe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6DF5345E4582EE0EBD468D /* PreferenceSubscribe.swift */; };
|
||||
6D6DF426E93AA9929183CE26 /* appdmg.json in Resources */ = {isa = PBXBuildFile; fileRef = 6D6DF927AC79EEF7378C192A /* appdmg.json */; };
|
||||
6D6DF51271B1AF55EACC79F2 /* PreferenceSubscribe.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6D6DF0CCE47F1253DECD5855 /* PreferenceSubscribe.strings */; };
|
||||
6D6DF5F67A917F78FF652D45 /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = 6D6DF8F5112A8407EE959998 /* .gitignore */; };
|
||||
6D6DF6553CF221AEB71913EE /* PreferenceGeneral.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D6DFFB29020127E034AD168 /* PreferenceGeneral.swift */; };
|
||||
@ -204,6 +205,7 @@
|
||||
6D6DF870C8E334815FBA78B2 /* PreferenceAbout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferenceAbout.swift; sourceTree = "<group>"; };
|
||||
6D6DF87840CDA04AF0E9D36E /* Scanner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Scanner.swift; sourceTree = "<group>"; };
|
||||
6D6DF8F5112A8407EE959998 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = file.gitignore; path = .gitignore; sourceTree = "<group>"; };
|
||||
6D6DF927AC79EEF7378C192A /* appdmg.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = appdmg.json; sourceTree = "<group>"; };
|
||||
6D6DFD730D8572B1FCAB1FFE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = V2rayU/Base.lproj/PreferenceSubscribe.xib; sourceTree = SOURCE_ROOT; };
|
||||
6D6DFD9F5991B38B128888D6 /* V2rayConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = V2rayConfig.swift; sourceTree = "<group>"; };
|
||||
6D6DFE1CDFAD9828F2FDE1A5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = V2rayU/Base.lproj/PreferenceAdvance.xib; sourceTree = SOURCE_ROOT; };
|
||||
@ -358,6 +360,7 @@
|
||||
66FEAD45217D75FC009DECF9 /* release.sh */,
|
||||
6D6DFD93CE866018306A090E /* pac */,
|
||||
6653C20422E0A2B700754D66 /* publish.sh */,
|
||||
6D6DF927AC79EEF7378C192A /* appdmg.json */,
|
||||
);
|
||||
path = Build;
|
||||
sourceTree = "<group>";
|
||||
@ -582,6 +585,7 @@
|
||||
6D6DFFD18860EBE148F6DF1F /* PreferencePac.strings in Resources */,
|
||||
66193A8923EE46BC00289B6A /* PreferenceRouting.xib in Resources */,
|
||||
6D6DF51271B1AF55EACC79F2 /* PreferenceSubscribe.strings in Resources */,
|
||||
6D6DF426E93AA9929183CE26 /* appdmg.json in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -1038,7 +1042,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.5.0;
|
||||
MARKETING_VERSION = 2.0.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayU;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@ -1066,7 +1070,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.5.0;
|
||||
MARKETING_VERSION = 2.0.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayU;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.5.1</string>
|
||||
<string>2.0.0</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
@ -34,7 +34,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.5.1</string>
|
||||
<string>2.0.0</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user