2018-03-11 21:58:02 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
### UUID finder for Mac
|
|
|
|
## author: @overdodactyl
|
2018-04-14 19:42:02 +00:00
|
|
|
## version: 1.1
|
2018-03-11 21:58:02 +00:00
|
|
|
|
2018-04-14 19:42:02 +00:00
|
|
|
## Get current mappings from online repo
|
|
|
|
webextension_mappings="https://raw.githubusercontent.com/overdodactyl/ShadowFox/master/scripts/webextension_mappings.txt"
|
|
|
|
web_ex=$(curl -s ${webextension_mappings})
|
2018-03-11 21:58:02 +00:00
|
|
|
|
2018-04-14 19:42:02 +00:00
|
|
|
## declare directory
|
|
|
|
declare -A styled=()
|
|
|
|
|
|
|
|
## Generate dictionaries from file
|
|
|
|
while IFS="|" read -r webex_name webex_id; do
|
|
|
|
styled["$webex_id"]+="$webex_name"
|
2018-04-14 20:05:25 +00:00
|
|
|
done <<< "$web_ex"
|
2018-04-14 19:42:02 +00:00
|
|
|
|
|
|
|
## Get installed extesnsions from prefs.js
|
2018-03-11 21:58:02 +00:00
|
|
|
line=$(sed -n -e 's/^user_pref("extensions.webextensions.uuids", "{\(.*\).*}");/\1/p' ../prefs.js)
|
|
|
|
|
2018-04-14 19:42:02 +00:00
|
|
|
## Write to internal_UUIDs
|
2018-03-11 21:58:02 +00:00
|
|
|
IFS=',' read -ra EXTS <<< "$line"
|
|
|
|
for i in "${EXTS[@]}"; do
|
|
|
|
id=$(echo $i | sed -n 's/.*"\(.*\)\\":.*/\1/p')
|
|
|
|
uuid=$(echo $i | sed -n 's/.*"\(.*\)\\".*/\1/p')
|
|
|
|
if [[ -n "${styled[$id]}" ]]
|
|
|
|
then
|
2018-04-14 19:42:02 +00:00
|
|
|
echo "${styled[$id]}_UUID=$uuid" >> 'ShadowFox_customization/internal_UUIDs.txt'
|
2018-03-11 21:58:02 +00:00
|
|
|
fi;
|
|
|
|
done
|