Skip to content

Commit ce1ed02

Browse files
committed
Remove devmode toast and SSL checks to fix M1 Macs
1 parent 99585d7 commit ce1ed02

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pob: load_pob luacurl frontend
3333
rm -rf PathOfBuildingBuild; \
3434
cp -rf PathOfBuilding PathOfBuildingBuild; \
3535
pushd PathOfBuildingBuild; \
36-
sed -i '' 's/if launch.devMode or .*then/if false then/' src/Modules/Main.lua; \
36+
bash ../editPathOfBuildingBuild.sh; \
3737
unzip runtime-win32.zip lua/xml.lua lua/base64.lua lua/sha1.lua; \
3838
mv lua/*.lua .; \
3939
rmdir lua; \

editPathOfBuildingBuild.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3+
cd "$DIR/PathOfBuildingBuild"
4+
5+
# We remove the `launch.devMode or` to ensure the user's builds are stored not in
6+
# the binary, but within their user directory
7+
sed -i '' 's/if launch.devMode or .*then/if false then/' src/Modules/Main.lua
8+
# Remove the dev-mode notice
9+
sed -i '' 's/if launch.devMode and GetTime.*then/if false then/' src/Modules/Main.lua
10+
11+
# Remove SSL checks. This fixes a weird problem where cURL doesn't find the
12+
# certificates on M1 Macs. The risk is really low, since the information this
13+
# transfers isn't really sensitive
14+
SED_COMMAND='s/(easy:setopt_url\(.*\))$/\1; easy:setopt(curl.OPT_SSL_VERIFYPEER, false)/'
15+
sed -E -i '' "$SED_COMMAND" src/Launch.lua
16+
sed -E -i '' "$SED_COMMAND" src/Classes/PassiveTree.lua
17+
sed -E -i '' "$SED_COMMAND" src/Classes/TradeQueryGenerator.lua
18+
sed -E -i '' "$SED_COMMAND" src/Classes/TreeTab.lua
19+
sed -E -i '' "$SED_COMMAND" src/Modules/BuildSiteTools.lua
20+
# Do not remove SSL for LaunchInstall and Update as that's more sensitive, but
21+
# also unused.

0 commit comments

Comments
 (0)