mirror of
https://github.com/usestrix/firewall.git
synced 2026-11-10 05:11:24 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40524327b3 |
No files matched your search
+21
-9
@@ -3,7 +3,8 @@
|
|||||||
# The package is notarized with the notarytool keychain profile in NOTARY_PROFILE; `build.sh debug`
|
# The package is notarized with the notarytool keychain profile in NOTARY_PROFILE; `build.sh debug`
|
||||||
# makes a Debug build and skips notarization.
|
# makes a Debug build and skips notarization.
|
||||||
#
|
#
|
||||||
# Xcode builds the bundles unsigned; they are signed here with Developer ID.
|
# Xcode builds the bundles unsigned; they are signed here. Debug builds use Apple Development signing
|
||||||
|
# because macOS refuses to activate a Developer ID extension that is not notarized.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
@@ -11,15 +12,23 @@ cd "$(dirname "$0")"
|
|||||||
: "${TEAM:?set TEAM in macos/.env}"
|
: "${TEAM:?set TEAM in macos/.env}"
|
||||||
export TEAM
|
export TEAM
|
||||||
|
|
||||||
CONFIGURATION=Release
|
# Identities are matched as a substring of the certificate name; set them if more than one matches.
|
||||||
if [ "${1:-}" = debug ]; then CONFIGURATION=Debug; fi
|
# Development profiles grant only the plain NetworkExtension values, Developer ID ones only -systemextension.
|
||||||
[ $CONFIGURATION = Debug ] || : "${NOTARY_PROFILE:?set NOTARY_PROFILE in macos/.env}"
|
if [ "${1:-}" = debug ]; then
|
||||||
|
CONFIGURATION=Debug
|
||||||
|
IDENTITY=${DEBUG_IDENTITY:-Apple Development}
|
||||||
|
NE_PROVIDER=app-proxy-provider
|
||||||
|
else
|
||||||
|
CONFIGURATION=Release
|
||||||
|
IDENTITY=${IDENTITY:-Developer ID Application}
|
||||||
|
NE_PROVIDER=app-proxy-provider-systemextension
|
||||||
|
: "${NOTARY_PROFILE:?set NOTARY_PROFILE in macos/.env}"
|
||||||
|
fi
|
||||||
|
export NE_PROVIDER
|
||||||
|
|
||||||
APP_ID=com.usestrix.firewall
|
APP_ID=com.usestrix.firewall
|
||||||
EXT_ID=com.usestrix.firewall.extension
|
EXT_ID=com.usestrix.firewall.extension
|
||||||
VERSION=0.1
|
VERSION=0.1
|
||||||
# Matched as a substring of the certificate name; set these if more than one certificate matches.
|
|
||||||
IDENTITY=${IDENTITY:-Developer ID Application}
|
|
||||||
INSTALLER_IDENTITY=${INSTALLER_IDENTITY:-Developer ID Installer}
|
INSTALLER_IDENTITY=${INSTALLER_IDENTITY:-Developer ID Installer}
|
||||||
PROFILES="$HOME/Library/Developer/Xcode/UserData/Provisioning Profiles"
|
PROFILES="$HOME/Library/Developer/Xcode/UserData/Provisioning Profiles"
|
||||||
|
|
||||||
@@ -82,12 +91,15 @@ notarize() {
|
|||||||
xcrun stapler staple build/Firewall.pkg
|
xcrun stapler staple build/Firewall.pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
# Prints the newest provisioning profile Xcode has downloaded for a bundle id.
|
# Prints the newest provisioning profile Xcode has downloaded for a bundle id that grants NE_PROVIDER.
|
||||||
profile_for() {
|
profile_for() {
|
||||||
local want=$TEAM.$1 newest= newest_time=0 id t
|
local want=$TEAM.$1 newest= newest_time=0 profile id t
|
||||||
for p in "$PROFILES"/*.provisionprofile; do
|
for p in "$PROFILES"/*.provisionprofile; do
|
||||||
id=$(security cms -D -i "$p" | plutil -extract Entitlements.com\\.apple\\.application-identifier raw -o - -)
|
profile=$(security cms -D -i "$p")
|
||||||
|
id=$(plutil -extract Entitlements.com\\.apple\\.application-identifier raw -o - - <<<"$profile")
|
||||||
[ "$id" = "$want" ] || continue
|
[ "$id" = "$want" ] || continue
|
||||||
|
plutil -extract Entitlements.com\\.apple\\.developer\\.networking\\.networkextension json -o - - <<<"$profile" |
|
||||||
|
grep -q "\"$NE_PROVIDER\"" || continue
|
||||||
t=$(stat -f %m "$p")
|
t=$(stat -f %m "$p")
|
||||||
if [ "$t" -gt "$newest_time" ]; then newest=$p; newest_time=$t; fi
|
if [ "$t" -gt "$newest_time" ]; then newest=$p; newest_time=$t; fi
|
||||||
done
|
done
|
||||||
|
|||||||
+2
-2
@@ -55,7 +55,7 @@ targets:
|
|||||||
com.apple.application-identifier: ${TEAM}.com.usestrix.firewall.extension
|
com.apple.application-identifier: ${TEAM}.com.usestrix.firewall.extension
|
||||||
com.apple.developer.team-identifier: ${TEAM}
|
com.apple.developer.team-identifier: ${TEAM}
|
||||||
com.apple.developer.networking.networkextension:
|
com.apple.developer.networking.networkextension:
|
||||||
- app-proxy-provider-systemextension
|
- ${NE_PROVIDER}
|
||||||
# NE requires NEMachServiceName to start with one of these.
|
# NE requires NEMachServiceName to start with one of these.
|
||||||
com.apple.security.application-groups:
|
com.apple.security.application-groups:
|
||||||
- ${TEAM}.com.usestrix.firewall
|
- ${TEAM}.com.usestrix.firewall
|
||||||
@@ -111,7 +111,7 @@ targets:
|
|||||||
com.apple.developer.team-identifier: ${TEAM}
|
com.apple.developer.team-identifier: ${TEAM}
|
||||||
com.apple.developer.system-extension.install: true
|
com.apple.developer.system-extension.install: true
|
||||||
com.apple.developer.networking.networkextension:
|
com.apple.developer.networking.networkextension:
|
||||||
- app-proxy-provider-systemextension
|
- ${NE_PROVIDER}
|
||||||
com.apple.security.network.client: true
|
com.apple.security.network.client: true
|
||||||
dependencies:
|
dependencies:
|
||||||
- target: Extension
|
- target: Extension
|
||||||
|
|||||||
Reference in new issue
Block a user