-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript
103 lines (90 loc) · 2.84 KB
/
script
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
# Check if the tccplus package is already installed
if ! command -v tccplus &> /dev/null; then
echo "tccplus package not found. Downloading..."
# Download the tccplus file from GitHub
curl -L -o tccplus https://github.com/zamkara/Allowme/raw/main/tccplus
# Move the tccplus file to /usr/local/bin/ with sudo access
sudo mv tccplus /usr/local/bin/
# Change the permission of the tccplus file to executable
sudo chmod +x /usr/local/bin/tccplus
echo "tccplus package downloaded and installed successfully."
fi
# Check if the command is 'flag'
if [ "$1" == "flag" ]; then
echo "emFta2FyYQ=={th15_15_n0t_4_fl4g}"
exit 0
fi
# Check the number of arguments provided
if [ $# -lt 3 ] || [ "$1" == "-h" ]; then
echo "Usage: allowme [add/reset] [permission] [application_path]"
echo "permission:"
echo " - All"
echo " - Accessibility"
echo " - AddressBook"
echo " - AppleEvents"
echo " - Calendar"
echo " - Camera"
echo " - ContactsFull"
echo " - ContactsLimited"
echo " - DeveloperTool"
echo " - Facebook"
echo " - LinkedIn"
echo " - ListenEvent"
echo " - Liverpool"
echo " - Location"
echo " - MediaLibrary"
echo " - Microphone"
echo " - Motion"
echo " - Photos"
echo " - PhotosAdd"
echo " - PostEvent"
echo " - Reminders"
echo " - ScreenCapture"
echo " - ShareKit"
echo " - SinaWeibo"
echo " - Siri"
echo " - SpeechRecognition"
echo " - SystemPolicyAllFiles"
echo " - SystemPolicyDesktopFolder"
echo " - SystemPolicyDeveloperFiles"
echo " - SystemPolicyDocumentsFolder"
echo " - SystemPolicyDownloadsFolder"
echo " - SystemPolicyNetworkVolumes"
echo " - SystemPolicyRemovableVolumes"
echo " - SystemPolicySysAdminFiles"
echo " - TencentWeibo"
echo " - Twitter"
echo " - Ubiquity"
echo " - Willow"
exit 1
fi
# Get the options from the provided arguments
command=$1
permission=$2
app_directory=$3
# Check for valid options
if [ "$command" != "add" ] && [ "$command" != "reset" ]; then
echo "Usage: allowme [add/reset] [permission] [application_path]"
exit 1
fi
# Check if the application directory exists
if [ -d "$app_directory" ]; then
# Get the CFBundleIdentifier value from Info.plist
bundle_identifier=$(defaults read "$app_directory/Contents/Info.plist" CFBundleIdentifier)
# Check if CFBundleIdentifier is found
if [ -z "$bundle_identifier" ]; then
echo "CFBundleIdentifier not found"
exit 1
fi
# Form the command with the provided permission option
if [ "$command" == "reset" ]; then
command="sudo tccplus reset $permission $bundle_identifier"
else
command="sudo tccplus add $permission $bundle_identifier"
fi
# Run the command
eval "$command"
else
echo "Application directory not found"
fi