Skip to content

Commit 6535af6

Browse files
sec: remove automation of credential injection
1 parent 902a716 commit 6535af6

File tree

8 files changed

+219
-610
lines changed

8 files changed

+219
-610
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ If you are using GitHub Actions, check out the dedicated [`guidepup/setup-action
4040
4141
### MacOS
4242
43-
If you are running this command locally, you might find it prompts you to pass in credentials so that it can using UI automation to change a checkbox value which enables the automation of VoiceOver. If you are uncomfortable with providing your credentials you can manually achieve these steps by following the [manual VoiceOver setup documentation](https://www.guidepup.dev/docs/guides/manual-voiceover-setup).
43+
If you are running this command locally you may need to take some manual steps to complete setup by following the [manual VoiceOver setup documentation](https://www.guidepup.dev/docs/guides/manual-voiceover-setup).
4444
4545
#### CI
4646

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"@guidepup/guidepup": "^0.22.0",
5353
"chalk": "^4.0.0",
5454
"decompress": "^4.2.1",
55-
"inquirer": "^8.2.0",
5655
"regedit": "5.0.1",
5756
"semver": "^7.5.4"
5857
},

src/errors.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export const ERR_MACOS_UNABLE_TO_WRITE_DATABASE_FILE =
1313
"Unable to write to the VoiceOver database file - SIP might not be disabled";
1414
export const ERR_MACOS_UNABLE_TO_WRITE_USER_TCC_DB =
1515
"Unable to write to the user TCC.db - SIP might not be disabled";
16-
export const ERR_MACOS_UNABLE_TO_UPDATE_UI_PREFERENCES =
17-
"Unable to enable VoiceOver control via UI preferences";
1816
export const ERR_MACOS_UI_PROMPT_FAILURE =
1917
"Unable to retrieve user input from prompt";
2018
export const ERR_MACOS_UI_CONTROL_NOT_CONSENTED =
@@ -24,7 +22,10 @@ export const ERR_MACOS_REQUIRES_MANUAL_USER_INTERACTION =
2422
export const ERR_MACOS_FAILED_TO_ENABLE_DO_NOT_DISTURB =
2523
'Failed to enable "Do not disturb" mode';
2624

27-
export const ERR_WINDOWS_UNABLE_TO_ACCESS_REGISTRY = "Unable to access Windows registry";
28-
export const ERR_WINDOWS_UNABLE_TO_UPDATE_REGISTRY = "Unable to update Windows registry";
25+
export const ERR_WINDOWS_UNABLE_TO_ACCESS_REGISTRY =
26+
"Unable to access Windows registry";
27+
export const ERR_WINDOWS_UNABLE_TO_UPDATE_REGISTRY =
28+
"Unable to update Windows registry";
2929
export const ERR_WINDOWS_FAILED_TO_INSTALL_NVDA = "Unable to install NVDA";
30-
export const ERR_WINDOWS_FAILED_TO_RESTART_EXPLORER = "Unable to restart explorer.exe";
30+
export const ERR_WINDOWS_FAILED_TO_RESTART_EXPLORER =
31+
"Unable to restart explorer.exe";

src/macOS/Credentials.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/macOS/askUserToControlUi.ts

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/macOS/setVoiceOverEnabledViaUi.ts

Lines changed: 0 additions & 104 deletions
This file was deleted.

src/macOS/setup.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { platform, release } from "os";
22
import { macOSRecord } from "@guidepup/guidepup";
3+
import chalk from "chalk";
34
import { checkVersion } from "./checkVersion";
45
import { enableAppleScriptControlSystemDefaults } from "./enableAppleScriptControlSystemDefaults";
56
import { disableSplashScreenSystemDefaults } from "./disableSplashScreenSystemDefaults";
@@ -8,8 +9,6 @@ import { isSipEnabled } from "./isSipEnabled";
89
import { writeDatabaseFile } from "./writeDatabaseFile";
910
import { SYSTEM_PATH, USER_PATH, updateTccDb } from "./updateTccDb";
1011
import { isAppleScriptControlEnabled } from "./isAppleScriptControlEnabled";
11-
import { askUserToControlUi } from "./askUserToControlUi";
12-
import { setVoiceOverEnabledViaUi } from "./setVoiceOverEnabledViaUi";
1312
import { handleWarning, logInfo } from "../logging";
1413
import { ERR_MACOS_REQUIRES_MANUAL_USER_INTERACTION } from "../errors";
1514
import { enableDoNotDisturb } from "./enableDoNotDisturb";
@@ -74,13 +73,14 @@ export async function setup(): Promise<void> {
7473
throw new Error(ERR_MACOS_REQUIRES_MANUAL_USER_INTERACTION);
7574
}
7675

77-
const credentials = await askUserToControlUi();
78-
79-
logInfo("");
80-
logInfo("Starting UI control...");
81-
logInfo("Please refrain from interaction until the script has completed");
82-
83-
await setVoiceOverEnabledViaUi(credentials);
76+
logInfo(
77+
"Please complete remaining setup by following this guide:\n\n--> " +
78+
chalk.underline(
79+
chalk.bold(
80+
"https://www.guidepup.dev/docs/guides/manual-voiceover-setup"
81+
)
82+
)
83+
);
8484
} finally {
8585
stopRecording();
8686
}

0 commit comments

Comments
 (0)