-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix VPN uninstall not working for App Store users. #2951
Fix VPN uninstall not working for App Store users. #2951
Conversation
@@ -9531,7 +9531,7 @@ | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
shellPath = /bin/sh; | |||
shellScript = "# Embeds login items for the App Store build.\n\n# Skip login item embedding for release builds until they're ready to go live.\nif [ \"${CONFIGURATION}\" = \"Release\" ]; then\n VPN_AGENT_NAME=\"${AGENT_RELEASE_PRODUCT_NAME}\"\n PIR_AGENT_NAME=\"${DBP_BACKGROUND_AGENT_RELEASE_PRODUCT_NAME}\"\nelse\n VPN_AGENT_NAME=\"${AGENT_PRODUCT_NAME}\"\n PIR_AGENT_NAME=\"${DBP_BACKGROUND_AGENT_PRODUCT_NAME}\"\nfi\n\nVPN_AGENT_ORIGIN=$(readlink -f \"${CONFIGURATION_BUILD_DIR}/${VPN_AGENT_NAME}.app\")\nPIR_AGENT_ORIGIN=$(readlink -f \"${CONFIGURATION_BUILD_DIR}/${PIR_AGENT_NAME}.app\")\nAGENT_DESTINATION=\"${CONFIGURATION_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/Library/LoginItems\"\n \n# Make sure that Library/LoginItems exists before copying\nmkdir -p \"$AGENT_DESTINATION\"\n \necho \"Copying VPN agent from $VPN_AGENT_ORIGIN to $AGENT_DESTINATION\"\nrsync -r --links \"$VPN_AGENT_ORIGIN\" \"$AGENT_DESTINATION\"\n \necho \"Copying Personal Information Removal agent from $PIR_AGENT_ORIGIN to $AGENT_DESTINATION\"\nrsync -r --links \"$PIR_AGENT_ORIGIN\" \"$AGENT_DESTINATION\"\n"; | |||
shellScript = "# Embeds login items for the App Store build.\n\n# Skip login item embedding for release builds until they're ready to go live.\nif [ \"${CONFIGURATION}\" = \"Release\" ]; then\n PIR_AGENT_NAME=\"${DBP_BACKGROUND_AGENT_RELEASE_PRODUCT_NAME}\"\nelse\n PIR_AGENT_NAME=\"${DBP_BACKGROUND_AGENT_PRODUCT_NAME}\"\nfi\n\nVPN_AGENT_NAME=\"${AGENT_PRODUCT_NAME}\"\n\nif [ -z \"$VPN_AGENT_NAME\" ]; then\n echo \"VPN_AGENT_NAME is empty.\"\n exit 1\nelif [ -z \"$PIR_AGENT_NAME\" ]; then\n echo \"PIR_AGENT_NAME is empty.\"\n exit 1\nelse\n echo \"Both VPN_AGENT_NAME and PIR_AGENT_NAME are set.\"\n echo \"VPN_AGENT_NAME is set to '$VPN_AGENT_NAME'.\"\n echo \"PIR_AGENT_NAME is set to '$PIR_AGENT_NAME'.\"\nfi\n\nVPN_AGENT_ORIGIN=$(readlink -f \"${CONFIGURATION_BUILD_DIR}/${VPN_AGENT_NAME}.app\")\nPIR_AGENT_ORIGIN=$(readlink -f \"${CONFIGURATION_BUILD_DIR}/${PIR_AGENT_NAME}.app\")\nAGENT_DESTINATION=\"${CONFIGURATION_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/Library/LoginItems\"\n \n# Make sure that Library/LoginItems exists before copying\nmkdir -p \"$AGENT_DESTINATION\"\n \necho \"Copying VPN agent from $VPN_AGENT_ORIGIN to $AGENT_DESTINATION\"\nrsync -r --links \"$VPN_AGENT_ORIGIN\" \"$AGENT_DESTINATION\"\n \necho \"Copying Personal Information Removal agent from $PIR_AGENT_ORIGIN to $AGENT_DESTINATION\"\nrsync -r --links \"$PIR_AGENT_ORIGIN\" \"$AGENT_DESTINATION\"\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to look at this in Xcode. Basically removed the override and just use AGENT_PRODUCT_NAME
.
I've also added a check to ensure that VPN_AGENT_NAME
and PIR_AGENT_NAME
are not empty, since if they're empty some really odd stuff happens later in the build.
@@ -54,7 +54,7 @@ AGENT_BUNDLE_ID[config=CI][sdk=*] = $(AGENT_BUNDLE_ID_BASE).debug | |||
AGENT_BUNDLE_ID[config=Review][sdk=*] = $(AGENT_BUNDLE_ID_BASE).review | |||
|
|||
AGENT_PRODUCT_NAME = DuckDuckGo VPN App Store | |||
AGENT_RELEASE_PRODUCT_NAME = DuckDuckGo VPN | |||
AGENT_PRODUCT_NAME[config=Release][sdk=*] = DuckDuckGo VPN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite honestly there should be no difference in just setting this directly, because in the end we were loading this value directly into the product name.
Additionally AGENT_PRODUCT_NAME
is saved in Info.plist so that the code knows what the agent product name is - this is what was causing the issue since the app was trying to launch the VPN menu app with the wrong product name (loaded from info.plist).
@@ -44,7 +44,7 @@ CODE_SIGN_IDENTITY[config=CI][sdk=macosx*] = | |||
PRODUCT_NAME_PREFIX = $(AGENT_PRODUCT_NAME) | |||
PRODUCT_NAME = $(AGENT_PRODUCT_NAME) | |||
PRODUCT_NAME[config=Review][arch=*][sdk=*] = $(AGENT_PRODUCT_NAME) | |||
PRODUCT_NAME[config=Release][arch=*][sdk=*] = $(AGENT_RELEASE_PRODUCT_NAME) | |||
PRODUCT_NAME[config=Release][arch=*][sdk=*] = $(AGENT_PRODUCT_NAME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read my comment below. Even though we always use AGENT_PRODUCT_NAME
this is specifically expanded because the value of AGENT_PRODUCT_NAME
is different for release builds, and Xcode otherwise seems to miss it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can see, this works well. The archived App Store build includes the VPN agent with the correct product name, and other build types were unaffected when testing, even when making multiple builds of various types.
Task/Issue URL: https://app.asana.com/0/1203108348835387/1207749767717701/f
Description
App Store users can't uninstall the VPN due to an issue with the VPN menu app target name.
Testing
Since making a test App Store release build isn't trivial, this can be checked by looking at some files instead. That said once this is merged we should quickly make a new internal build and check that the VPN works correctly.
Test 1: Verify the product name is right
ManualAppStoreRelease.xcconfig
... you need to uncomment a line in that file to make a manual buildAGENT_PRODUCT_NAME
isDuckDuckGo VPN
DuckDuckGo VPN.app
Test 2: Test the VPN in debug
Reset all changes and ensure the VPN works fine in debug builds.
Definition of Done:
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation