-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopenasar
executable file
·35 lines (28 loc) · 891 Bytes
/
openasar
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
#!/bin/sh
while IFS= read -r target
do
echo "Finding discord's app.asar file..."
file="null"
while IFS= read -r path
do
result=$(expr "$path" : "$target /..*/app\\.asar\$")
if [ "$result" -gt "0" ]
then
file=$(expr substr "$path" "$((${#target}+2))" "${#path}")
#Test if kernel is installed
kernel_file="${file/app.asar/app-original.asar}"
[ -f "${file/app.asar/app-original.asar}" ] && file="$kernel_file"
fi
done <<< $(pacman -Ql $target)
echo target $target
echo file $file
if [ "$file" = 'null' ]
then
echo "Unable to find discord's app.asar!"
else
mv $file $file.backup
wget -q -O $file https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar &&
echo "Installed OpenAsar for $file. If you have issues with launching rename $file.backup back to app.asar" ||
echo "Failed to invoke wget, maybe its not installed?"
fi
done