Author SHA1 Message Date
xenosandGitHub ba459cff40 Merge pull request #22 from tomaszk8266/master
Add macOS signing
2026-07-11 10:27:31 +08:00
Tomasz K. 8b54da6adf macOS: Sign the patched app before launching and increase timeout 2026-07-11 00:20:54 +02:00
2 changed files with 24 additions and 4 deletions
+21 -1
View File
@@ -364,7 +364,7 @@ async function captureIntegrityHashes(executablePath) {
child.kill();
reject(new Error("Timed out waiting for integrity check output"));
}
}, 20000);
}, 30000);
const handleData = data => {
output += data.toString();
@@ -663,6 +663,26 @@ async function patchApp() {
process.exit(1);
}
// macOS: Sign the patched app
if (isMac) {
const appBundlePath = path.resolve(appPath, '..', '..');
console.log(chalk.yellowBright('[+] Signing HTTP Toolkit with ad-hoc signature...'));
try {
execSync(`codesign --deep --force --sign - "${appBundlePath}"`, {stdio: "pipe"});
console.log(chalk.greenBright('[+] HTTP Toolkit signed successfully'));
console.log(chalk.yellowBright(` Make sure to whitelist the app in privacy and security settings!`));
} catch (e) {
rm(extractPath);
console.error(chalk.redBright(`[!] Failed to sign HTTP Toolkit: ${e.message}`));
process.exit(1);
}
try {
execSync(`xattr -d com.apple.quarantine "${appBundlePath}" 2>/dev/null`, {stdio: 'pipe'});
} catch (e) {
console.log(chalk.redBright('[!] Failed to remove the quarantine attribute'));
}
}
console.log(chalk.yellowBright('[+] Launching HTTP Toolkit to read integrity hashes...'));
let hashes;
try {
+3 -3
View File
@@ -86,9 +86,9 @@
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "5.0.6",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",
"integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz",
"integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==",
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"