mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
add Info.plist.in
This commit is contained in:
@@ -20,6 +20,10 @@ set(LIBS ${LIBS}
|
||||
|
||||
set_target_properties(${PROJECT} PROPERTIES
|
||||
MACOSX_BUNDLE TRUE
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/macos/app/Info.plist.in"
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER "${BUILD_OSX_APP_IDENTIFIER}"
|
||||
MACOSX_BUNDLE_BUNDLE_NAME "AmneziaVPN"
|
||||
MACOSX_BUNDLE_COPYRIGHT ""
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}"
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION_TWEAK}"
|
||||
)
|
||||
|
||||
@@ -35,12 +35,10 @@ fi
|
||||
run_cmd launchctl bootout system "$LAUNCH_DAEMONS_PLIST_NAME" || run_cmd launchctl unload "$LAUNCH_DAEMONS_PLIST_NAME"
|
||||
run_cmd rm -f "$LAUNCH_DAEMONS_PLIST_NAME"
|
||||
|
||||
# Add separate group for xray filtering
|
||||
# Add separate group for xray filtering (do not exit the script if the group already exists)
|
||||
if dscl . -read "/Groups/$SERVICE_GROUP" >/dev/null 2>&1; then
|
||||
log "Group $SERVICE_GROUP already exists"
|
||||
return 0
|
||||
else
|
||||
local next_gid
|
||||
next_gid=$(dscl . -list /Groups PrimaryGroupID 2>/dev/null | awk '{print $2}' | sort -n | awk '$1>=500{g=$1} END{print (g?g+1:501)}')
|
||||
run_cmd dscl . -create "/Groups/$SERVICE_GROUP"
|
||||
run_cmd dscl . -create "/Groups/$SERVICE_GROUP" PrimaryGroupID "$next_gid"
|
||||
@@ -56,6 +54,12 @@ LSREGISTER="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchS
|
||||
if [ -d "$APP_PATH" ]; then
|
||||
log "Launch Services: lsregister -f -R $APP_PATH"
|
||||
run_cmd "$LSREGISTER" -f -R "$APP_PATH" || true
|
||||
INFO_PLIST="$APP_PATH/Contents/Info.plist"
|
||||
if [ -f "$INFO_PLIST" ] && plutil -p "$INFO_PLIST" 2>/dev/null | grep -q 'CFBundleURLTypes'; then
|
||||
log "Info.plist: CFBundleURLTypes present (vpn:// can be registered with Launch Services)"
|
||||
else
|
||||
log "ERROR: Info.plist has no CFBundleURLTypes — open vpn:// will fail (-10814). Fix the app bundle Info.plist at build time; lsregister cannot invent URL schemes."
|
||||
fi
|
||||
else
|
||||
log "WARN: $APP_PATH missing, skipping lsregister"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user