-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathtest-mac-inject.sh
More file actions
executable file
·63 lines (55 loc) · 1.41 KB
/
Copy pathtest-mac-inject.sh
File metadata and controls
executable file
·63 lines (55 loc) · 1.41 KB
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
#!/bin/bash
function build() {
echo "==========Build Start=========="
chmod +x build-macOS_x86.sh
./build-macOS_x86.sh
echo "==========Build Finish=========="
}
function testCase() {
echo "==========Test Start=========="
./inject inject -d @executable_path/testMac/libtestinject.dylib
codesign -s - -f --preserve-metadata=entitlements inject
echo "==========Test otool=========="
otool -L inject
echo "==========Test Run=========="
./inject
echo "==========Test Finish=========="
}
function clean() {
echo "==========Clean Start=========="
rm -rf inject
mv inject_back inject
echo "==========Clean Finish=========="
}
build
echo " "
testCase
echo " "
clean
function buildarm() {
echo "==========Build Start=========="
chmod +x build-macOS_arm.sh
./build-macOS_arm.sh
echo "==========Build Finish=========="
}
function testCasearm() {
echo "==========Test Start=========="
./inject_arm64 inject_arm64 -d @executable_path/testMac/libtestinject.dylib
codesign -s - -f --preserve-metadata=entitlements inject_arm64
echo "==========Test otool=========="
otool -L inject_arm64
echo "==========Test Run=========="
./inject_arm64
echo "==========Test Finish=========="
}
function cleanarm() {
echo "==========Clean Start=========="
rm -rf inject_arm64
mv inject_arm64_back inject_arm64
echo "==========Clean Finish=========="
}
buildarm
echo " "
testCasearm
echo " "
cleanarm