-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmd-trollstore
executable file
·58 lines (47 loc) · 1.4 KB
/
md-trollstore
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
#!/bin/bash
DIR=${CODESIGNING_FOLDER_PATH}/../trollbuild
APP=${CODESIGNING_FOLDER_PATH}
function run_at {
pushd $1
shift
$@
popd
}
codesign --remove "${APP}"
if [ -e "${APP}/_CodeSignature" ]; then
rm -rf "${APP}/_CodeSignature"
fi
if [ -e "${APP}/embedded.mobileprovision" ]; then
rm -rf "${APP}/embedded.mobileprovision"
fi
if [ -z "${CODE_SIGN_ENTITLEMENTS}" ]; then
CODE_SIGN_ENTITLEMENTS=${PROJECT_DIR}/${TARGET_NAME}/${TARGET_NAME}.entitlements
fi
if [ ! -f "${CODE_SIGN_ENTITLEMENTS}" ]; then
echo "entitlements not exist ${CODE_SIGN_ENTITLEMENTS}, try another"
CODE_SIGN_ENTITLEMENTS=${PROJECT_DIR}/${TARGET_NAME}.entitlements
if [ ! -f "${CODE_SIGN_ENTITLEMENTS}" ]; then
echo "entitlements not exist ${CODE_SIGN_ENTITLEMENTS}, exit"
exit 1
fi
fi
echo "use entitlements ${CODE_SIGN_ENTITLEMENTS}"
ldid -S${CODE_SIGN_ENTITLEMENTS} ${APP}/${TARGET_NAME}
rm -rf ${DIR}/${TARGET_NAME}.tipa ${DIR}/Payload
mkdir -p ${DIR}/Payload
cp -rf ${APP} ${DIR}/Payload
run_at ${DIR} "zip -qr ${TARGET_NAME}.tipa Payload"
rm -rf ${DIR}/Payload
IPA_PATH=${DIR}/${TARGET_NAME}.tipa
if [ ! -f ${IPA_PATH} ]; then
echo "build failed"
exit -1
fi
if [ ! -z "${TROLLSTORE_DEVICE_IP}" ]; then
curl -v ${TROLLSTORE_DEVICE_IP}:1222/install/${TARGET_NAME}.tipa -T ${IPA_PATH}
if [ ! $? -eq 0 ]; then
echo "install failed"
exit -1
fi
fi
exit 0