-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvert_appzip_to_ipa.sh
More file actions
59 lines (42 loc) · 980 Bytes
/
convert_appzip_to_ipa.sh
File metadata and controls
59 lines (42 loc) · 980 Bytes
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
#!/usr/bin/env bash
# convert_appzip_to_ipa.sh
# Uso:
# ./convert_appzip_to_ipa.sh Runner.app.zip
#
# Convierte:
# *.app.zip -> *.ipa
set -e
if [ $# -lt 1 ]; then
echo "Uso: $0 archivo.app.zip"
exit 1
fi
INPUT="$1"
if [ ! -f "$INPUT" ]; then
echo "Error: archivo no encontrado: $INPUT"
exit 1
fi
TMP_DIR=$(mktemp -d)
cleanup() {
rm -rf "$TMP_DIR"
}
trap cleanup EXIT
echo "[+] Extrayendo ZIP..."
unzip -q "$INPUT" -d "$TMP_DIR"
APP_DIR=$(find "$TMP_DIR" -maxdepth 2 -type d -name "*.app" | head -n 1)
if [ -z "$APP_DIR" ]; then
echo "Error: no se encontró ninguna carpeta .app dentro del ZIP"
exit 1
fi
APP_NAME=$(basename "$APP_DIR")
BASE_NAME="${APP_NAME%.app}"
PAYLOAD_DIR="$TMP_DIR/Payload"
mkdir -p "$PAYLOAD_DIR"
mv "$APP_DIR" "$PAYLOAD_DIR/"
OUTPUT_IPA="${BASE_NAME}.ipa"
echo "[+] Creando IPA..."
(
cd "$TMP_DIR"
zip -qry "$OLDPWD/$OUTPUT_IPA" Payload
)
echo "[+] IPA creada correctamente:"
echo " $OUTPUT_IPA"