-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathstart.sh
executable file
·67 lines (58 loc) · 1.66 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
set -e
appimagetoolUrl='https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage'
baseAppImage=$(ls | grep -i '\.AppImage$' | head -n 1)
echo
# Check if AppImage exists
if [ -z $baseAppImage ]; then
echo "No AppImage found. Exiting..."
exit 1
fi
baseAppImagePath=$(readlink -f $baseAppImage)
# User prompt
echo
echo "Detected AppImage: $baseAppImage"
read -p "Start patching with this AppImage? [Y/n] " startScript
if [ $startScript == "n" ] || [ $startScript == "N" ]; then
echo "Exiting..."
exit 0
fi
# Build navicat patcher
echo
echo "Building Navicat Patcher..."
cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build . -- -j4
cp navicat-patcher navicat-keygen /patcher/bin
cd /patcher
# Extract AppImage
echo
echo "Extracting AppImage..."
mkdir -p /navicat_mount /navicat
mount -o loop $baseAppImagePath /navicat_mount
cp -r /navicat_mount/* /navicat
umount /navicat_mount
echo "Extracted AppImage."
# Start Patcher
echo
echo "Starting Patcher..."
/patcher/bin/navicat-patcher /navicat
echo "Navicat Patched."
# Repack
echo
echo "Repacking AppImage..."
wget -O appimagetool.AppImage $appimagetoolUrl
chmod +x appimagetool.AppImage
./appimagetool.AppImage /navicat /patcher/bin/$(echo $baseAppImage | sed 's/\.AppImage$/-patched.AppImage/')
echo "Repacked AppImage."
# Start Keygen
echo
echo "Starting Keygen... (REMEMBER TO DISCONNECT INTERNET)"
read -p "Continue? [Y/n] " startKeygen
if [ $startKeygen == "n" ] || [ $startKeygen == "N" ]; then
echo "Exiting..."
exit 0
fi
/patcher/bin/navicat-keygen --text ./RegPrivateKey.pem
echo
echo "Copy activation code and continue activation"
echo "Exiting..."
exit 0