This repository has been archived by the owner on Nov 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
160 lines (136 loc) · 6.16 KB
/
save_shsh2.yml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Auto Save SHSH2
permissions: write-all # Allow Release 允许发布 release
env:
## --- required
MODEL: iPhone8,1 # specify device by its model (eg. iPhone8,1)
ECID: ab46efcbf71 # must be either DEC or HEX
## --- choosing one of these three below and comment others
LATEST: true # if set true, FIRMWARE_VERSION and FIRMWARE_BUILD_ID will become invalid
# FIRMWARE_VERSION: 15.7 # specify firmware version
# FIRMWARE_BUILD_ID: 19H12 # if set this, FIRMWARE_VERSION will become invalid
## ---
NO_BOARDBAND: false # Request tickets without baseband. If set true, BOARDBAND will become invalid
BOARDBAND: n71ap # recommend set this for iPhone. Specific boardconfig instead of device model
## ---
GEN: "0x1111111111111111" # manually specify generator in format 0x%%16llx
APNONCE: "" # required for saving blobs for A12/S4 and newer devices with generator
## --- Enable the following options to use beta firmware
BETA: false
## --- Logging
LOG_REQ: false # print the TSS request that will be sent to Apple
LOG_RSP: false # print the TSS response that comes from Apple
on:
push:
branches:
- 'master'
paths:
- .github/workflows/*
schedule:
- cron: '20 5 * * 1' # Runs at 05:20 UTC on Mon.
workflow_dispatch:
inputs:
args:
description: 'Manual Arguments(Will use args here instead of using env. Use `--ecid` instead of `-e` if you get some error. Do not set `-s` and `--save-path`!)\n\n本程序免费开源,如果你从其他人那付费获得了 Github Action 自动保存 shsh2 的程序,那么恭喜你被骗了!'
required: true
default: "-d iPhone8,1 -B n71ap --ecid ab46efcbf71 -l --generator 0x1111111111111111"
jobs:
save_shsh2:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: prepare (auto)
if: github.event.inputs == 0
shell: bash
run: |
echo "Auto mode.\n本程序免费开源,如果你从其他人那付费获得了 Github Action 自动保存 shsh2 的程序,那么恭喜你被骗了!"
tss_arg=""
if [ -z "${{ env.MODEL }}" ] || [ -z "${{ env.ECID }}" ]; then
echo "::error env.MODEL and env.ECID can't be NULL"
exit 1
fi
if [ -z "${{ env.APNONCE }}" ]; then
echo "::warning env.APNONCE is NULL, If you are using A12/S4 and newer, the blobs may not use. Read more: https://github.com/1Conan/tsschecker#nonce-entangling-apple-a12s4-and-newer"
fi
if [ -n "${{ env.MODEL }}" ]; then
tss_arg=$tss_arg" -d "${{ env.MODEL }}
fi
if [ -n "${{ env.ECID }}" ]; then
tss_arg=$tss_arg" --ecid "${{ env.ECID }}
fi
if [ "${{ env.LATEST }}" = "true" ]
then
tss_arg=$tss_arg" -l "
elif [ -n "${{ env.FIRMWARE_BUILD_ID }}" ]
then
tss_arg=$tss_arg" -Z "${{ env.FIRMWARE_BUILD_ID }}
else
tss_arg=$tss_arg" -i "${{ env.FIRMWARE_VERSION }}
fi
if [ "${{ env.NO_BOARDBAND }}" = "true" ]; then
tss_arg=$tss_arg" -b "
else
tss_arg=$tss_arg" -B "${{ env.BOARDBAND }}
fi
if [ -n "${{ env.GEN }}" ]; then
tss_arg=$tss_arg" --generator "${{ env.GEN }}
fi
if [ -n "${{ env.APNONCE }}" ]; then
tss_arg=$tss_arg" --apnonce "${{ env.APNONCE }}
fi
if [ "${{ env.BETA }}" = "true" ]; then
tss_arg=$tss_arg" --ota --beta "
fi
if [ "${{ env.LOG_REQ }}" = "true" ]; then
tss_arg=$tss_arg" --print-tss-request "
fi
if [ "${{ env.LOG_RSP }}" = "true" ]; then
tss_arg=$tss_arg" --print-tss-response "
fi
tss_arg=$tss_arg" -s --save-path .\\blobs "
echo tssArg="$tss_arg" >> $GITHUB_ENV
- name: prepare (manually)
if: github.event.inputs
shell: bash
run: |
echo "Manually run.\n本程序免费开源,如果你从其他人那付费获得了 Github Action 自动保存 shsh2 的程序,那么恭喜你被骗了!"
echo ECID=`echo "${{ github.event.inputs.args }}" | awk -F '--ecid' '{print $2}' | awk '{print $1}'` >> $GITHUB_ENV
echo tssArg="${{ github.event.inputs.args }} -s --save-path .\\blobs" >> $GITHUB_ENV
- name: run tsschecker
shell: pwsh
run: |
if(!(Test-Path "blobs")) { mkdir "blobs" }
echo ${{ env.tssArg }} "\n本程序免费开源,如果你从其他人那付费获得了 Github Action 自动保存 shsh2 的程序,那么恭喜你被骗了!"
.\\tsschecker378.exe ${{ env.tssArg }}
- name: get info
id: shsh2-info
shell: bash
run: |
output=`ls blobs`
if [ -z $output ]; then
echo "blobs folder is empty!"
exit 1
fi
firmware=`echo ${output} | awk -F '_' '{print $4}'`
echo firmware="${firmware}" >> $GITHUB_OUTPUT
echo nonce=`echo ${output} | awk -F '_' '{print $5}' | awk -F '.' '{print $1}'` >> $GITHUB_OUTPUT
echo model=`echo ${output} | awk -F '_' '{print $2}'` >> $GITHUB_OUTPUT
echo tagName="${firmware}" >> $GITHUB_OUTPUT
mv "./blobs/"$output "./blobs/"`date +"%Y-%m-%d"`"_"$output
echo artifactName=$output >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v2
with:
name: steps.shsh2-info.outputs.artifactName
path: blobs/*
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ success() }}
with:
tag_name: ${{ steps.shsh2-info.outputs.tagName }}
body: >-
${{ format(fromJSON('"ecid: {0}\nmodel: {1}\nfirmware: {2}\nnonce: {3}\n\n\n本程序免费[开源](https://github.com/tom-snow/autosave_SHSH2),如果你从其他人那付费获得了 Github Action 自动保存 shsh2 的程序,那么恭喜你被骗了!"'),
env.ECID,
steps.shsh2-info.outputs.model,
steps.shsh2-info.outputs.firmware,
steps.shsh2-info.outputs.nonce
) }}
files: blobs/*