├── README.md
├── patch.sh
└── synocodectool
├── original
├── synocodectool.6.0-7321-0_6.0.3-8754-8.original
├── synocodectool.6.1-15047-0_6.1.1-15101-4.original
├── synocodectool.6.1.2-15132-0_6.1.3-15152-8.original
├── synocodectool.6.1.4-15217-0_6.2-23739-2.original
├── synocodectool.6.2.1-23824-0_6.2.3-25426-3.original
├── synocodectool.7.0.1-42216-0_7.0.1-42218-3.original
├── synocodectool.7.1-42661-0_7.1-42661-0.CodecPack.patch
└── synocodectool.7.1-42661-0_7.1-42661-0.original
└── patch
├── synocodectool.6.0-7321-0_6.0.3-8754-8.patch
├── synocodectool.6.1-15047-0_6.1.1-15101-4.patch
├── synocodectool.6.1.2-15132-0_6.1.3-15152-8.patch
├── synocodectool.6.1.4-15217-0_6.2-23739-2.patch
├── synocodectool.6.2.1-23824-0_6.2.3-25426-3.patch
├── synocodectool.7.0.1-42216-0_7.0.1-42218-3.patch
├── synocodectool.7.1-42661-0_7.1-42661-0.CodecPack.original
└── synocodectool.7.1-42661-0_7.1-42661-0.patch
/README.md:
--------------------------------------------------------------------------------
1 | # synocodectool-patch
2 |
3 | 
4 |
5 | This patch enables transcoding on Synologys DiskStation Manager 6+ without a valid serial number.
6 | The structure is loosely based on https://github.com/keylase/nvidia-patch
7 |
8 |
9 |
10 | Requirements:
11 | - DiskStation Manager 6 or higher
12 | - Your serial number ***must*** be in the proper format (e.g. XXXXPDNXXXXXX for DS918+, XXXXODNXXXXXX for DS3617xs, XXXXLWNXXXXXX for 3615xs)
13 | - x86-64 based
14 | - SSH/Terminal Access
15 | - sudo/root
16 |
17 | ## Version Table
18 |
19 | | Version | Patch supported | Original SHA1 | Patch SHA1 | Original| Patch |
20 | |:--------|:---------------:|:-------------:|:----------:|:-------:|:-----:|
21 | |6.0 7321-0 -
6.0.3 8754-8 | :heavy_check_mark: | cde88ed8fdb2bfeda8de5
2ef3adede87a72326ef | e5c1a65b396796856047
6fcda5071fd37db40223 | [Link](../../raw/master/synocodectool/original/synocodectool.6.0-7321-0_6.0.3-8754-8.original)| [Link](../../raw/master/synocodectool/patch/synocodectool.6.0-7321-0_6.0.3-8754-8.patch) |
22 | |6.1 15047-0 -
6.1.1 15101-4 | :heavy_check_mark: | ec0c3f5bbb857fa84f5d
1153545d30d7b408520b | d58f5b33ff2b6f214103
6837ddf15dd5188384c6 | [Link](../../raw/master/synocodectool/original/synocodectool.6.1-15047-0_6.1.1-15101-4.original) | [Link](../../raw/master/synocodectool/patch/synocodectool.6.1-15047-0_6.1.1-15101-4.patch) |
23 | |6.1.2 15132-0 -
6.1.3 15152-8| :heavy_check_mark: | 1473d6ad6ff6e5b8419c
6b0bc41006b72fd777dd | 56ca9adaf117e8aae9a3
a2e29bbcebf0d8903a99 | [Link](../../raw/master/synocodectool/original/synocodectool.6.1.2-15132-0_6.1.3-15152-8.original) | [Link](../../raw/master/synocodectool/patch/synocodectool.6.1.2-15132-0_6.1.3-15152-8.patch) |
24 | |6.1.4 15217-0 -
6.2 23739-2 | :heavy_check_mark: | 26e42e43b393811c176d
ac651efc5d61e4569305 | 511dec657daa60b0f11d
a20295e2c665ba2c749c | [Link](../../raw/master/synocodectool/original/synocodectool.6.1.4-15217-0_6.2-23739-2.original) | [Link](../../raw/master/synocodectool/patch/synocodectool.6.1.4-15217-0_6.2-23739-2.patch) |
25 | |6.2.1 23824-0 -
6.2.3 25426-3| :heavy_check_mark: | 1d01ee38211f21c67a43
11f90315568b3fa530e6 | 93067026c251b100e278
05a8b4b9d8f0ae8e291c | [Link](../../raw/master/synocodectool/original/synocodectool.6.2.1-23824-0_6.2.3-25426-3.original) | [Link](../../raw/master/synocodectool/patch/synocodectool.6.2.1-23824-0_6.2.3-25426-3.patch) |
26 | |7.0.1 42216-0 -
7.0.1 42218-3| :heavy_check_mark: | c2f07f4cebf0bfb63e3c
a38f811fd5b6112a797e | 873749b00e1624df4b01
335e0b69102acc185eb9 | [Link](../../raw/master/synocodectool/original/synocodectool.7.0.1-42216-0_7.0.1-42218-3.original) | [Link](../../raw/master/synocodectool/patch/synocodectool.7.0.1-42216-0_7.0.1-42218-3.patch) |
27 | |7.1 42661-0 -
7.1 42661-0| :warning: | 796ac7fab2dcad7978a0
e8ae48abc9150aba916c | 06d543b2aab5ea73600c
a96497febdad96dc7864 | [Link](../../raw/master/synocodectool/original/synocodectool.7.1-42661-0_7.1-42661-0.original) | [Link](../../raw/master/synocodectool/patch/synocodectool.7.1-42661-0_7.1-42661-0.patch) |
28 | |7.1 42661-0 -
7.1 42661-0
(CodecPack)| :warning: | 22445f5b0d8b6714954b
50930c47b8805cf32b98 | 3a5ed18dc41ff243f348
1b6e3cf4770651df0b54 | [Link](../../raw/master/synocodectool/original/synocodectool.7.1-42661-0_7.1-42661-0.CodecPack.original) | [Link](../../raw/master/synocodectool/patch/synocodectool.7.1-42661-0_7.1-42661-0.CodecPack.patch) |
29 |
30 | :warning: : Not tested yet
31 |
32 | ## Synopsis
33 |
34 | ```
35 | # sudo ./patch.sh -h
36 |
37 | SYNOPSIS
38 | patch.sh [-h] [-p|-r|-l]
39 | DESCRIPTION
40 | Patch to enable transcoding without a valid serial in DSM 6+
41 | -h Print this help message
42 | -p Patch synocodectool
43 | -r Restore original from backup
44 | -l List supported DSM versions
45 |
46 | ```
47 |
48 | ## Manual
49 |
50 | Examples are provided for DSM Version 6.2.2 24992-6
51 |
52 | ### Downloading and making script executable
53 |
54 |
55 | ```bash
56 | wget https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/master/patch.sh
57 | chmod +x patch.sh
58 | ```
59 |
60 | ### Patching synocodectool
61 |
62 | This patch performs a backup of the original file prior to making changes.
63 |
64 | ```bash
65 | sudo ./patch.sh -p
66 | ```
67 |
68 |
69 | ### Restoring original file
70 |
71 | If something goes horribly wrong restoring the original file is possible
72 |
73 | ```bash
74 | bash ./patch.sh -r
75 | ```
76 |
77 |
--------------------------------------------------------------------------------
/patch.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -eo pipefail;
3 | shopt -s nullglob;
4 |
5 | #variables
6 | bin_file="synocodectool"
7 | conf_file="activation.conf"
8 | conf_path="/usr/syno/etc/codec"
9 | conf_string='{"success":true,"activated_codec":["hevc_dec","ac3_dec","h264_dec","h264_enc","aac_dec","aac_enc","mpeg4part2_dec","vc1_dec","vc1_enc"],"token":"123456789987654abc"}'
10 | opmode="patchhelp"
11 |
12 | #arrays
13 | declare -A binhash_version_list=(
14 | ["cde88ed8fdb2bfeda8de52ef3adede87a72326ef"]="6.0-7321-0_6.0.3-8754-8"
15 | ["ec0c3f5bbb857fa84f5d1153545d30d7b408520b"]="6.1-15047-0_6.1.1-15101-4"
16 | ["1473d6ad6ff6e5b8419c6b0bc41006b72fd777dd"]="6.1.2-15132-0_6.1.3-15152-8"
17 | ["26e42e43b393811c176dac651efc5d61e4569305"]="6.1.4-15217-0_6.2-23739-2"
18 | ["1d01ee38211f21c67a4311f90315568b3fa530e6"]="6.2.1-23824-0_6.2.3-25426-3"
19 | ["c2f07f4cebf0bfb63e3ca38f811fd5b6112a797e"]="7.0.1-42216-0_7.0.1-42218-3"
20 | ["796ac7fab2dcad7978a0e8ae48abc9150aba916c"]="7.1-42661-0_7.1-42661-0"
21 | ["22445f5b0d8b6714954b50930c47b8805cf32b98"]="7.1-42661-0_7.1-42661-0"
22 | )
23 |
24 | declare -A patchhash_binhash_list=(
25 | ["e5c1a65b3967968560476fcda5071fd37db40223"]="cde88ed8fdb2bfeda8de52ef3adede87a72326ef"
26 | ["d58f5b33ff2b6f2141036837ddf15dd5188384c6"]="ec0c3f5bbb857fa84f5d1153545d30d7b408520b"
27 | ["56ca9adaf117e8aae9a3a2e29bbcebf0d8903a99"]="1473d6ad6ff6e5b8419c6b0bc41006b72fd777dd"
28 | ["511dec657daa60b0f11da20295e2c665ba2c749c"]="26e42e43b393811c176dac651efc5d61e4569305"
29 | ["93067026c251b100e27805a8b4b9d8f0ae8e291c"]="1d01ee38211f21c67a4311f90315568b3fa530e6"
30 | ["873749b00e1624df4b01335e0b69102acc185eb9"]="c2f07f4cebf0bfb63e3ca38f811fd5b6112a797e"
31 | ["06d543b2aab5ea73600ca96497febdad96dc7864"]="796ac7fab2dcad7978a0e8ae48abc9150aba916c"
32 | ["3a5ed18dc41ff243f3481b6e3cf4770651df0b54"]="22445f5b0d8b6714954b50930c47b8805cf32b98"
33 | )
34 |
35 | declare -A binhash_patch_list=(
36 | ["cde88ed8fdb2bfeda8de52ef3adede87a72326ef"]="00002dc0: 27000084c0eb4cb9b6000000badd6940\n00003660: 24f0000000e8961e000084c00f84b400"
37 | ["ec0c3f5bbb857fa84f5d1153545d30d7b408520b"]="00002dc0: 27000084c0eb4cb9b7000000bafd6940\n000036f0: 0000e8291e000084c0eb1eb9ec000000"
38 | ["1473d6ad6ff6e5b8419c6b0bc41006b72fd777dd"]="00002dc0: 27000084c0eb4cb9b7000000baad6a40\n000036f0: 0000e8291e000084c0eb1eb9ec000000"
39 | ["26e42e43b393811c176dac651efc5d61e4569305"]="00002dc0: 27000084c0eb4cb9ba000000badf6a40\n00003710: f0000000e8271e000084c0eb1eb9ef00"
40 | ["1d01ee38211f21c67a4311f90315568b3fa530e6"]="00002dc0: 27000084c0eb4cb9bd000000baf76a40\n00003720: 24f0000000e8261e000084c0eb1eb9f2"
41 | ["c2f07f4cebf0bfb63e3ca38f811fd5b6112a797e"]="00002dc0: 000084c0eb2141b8c1000000b9586c40\n00003780: 1d000084c0e90d0100009041b8f60000"
42 | ["796ac7fab2dcad7978a0e8ae48abc9150aba916c"]="000035b0: 74cd4889efe8f623000084c0eb004c8d\n000040a0: fdffff4c89efe80519000084c0eb0048"
43 | ["22445f5b0d8b6714954b50930c47b8805cf32b98"]="00003850: e7e89a27000084c0eb00488dac249000\n00004340: fdffff4c89efe8a51c000084c0eb0048"
44 | )
45 |
46 | declare -a binpath_list=()
47 |
48 | declare -a path_list=(
49 | "/usr/syno/bin"
50 | "/volume1/@appstore/VideoStation/bin"
51 | "/volume2/@appstore/VideoStation/bin"
52 | "/volume3/@appstore/VideoStation/bin"
53 | "/volume1/@appstore/MediaServer/bin"
54 | "/volume2/@appstore/MediaServer/bin"
55 | "/volume3/@appstore/MediaServer/bin"
56 | "/volume1/@appstore/SurveillanceStation/bin"
57 | "/volume2/@appstore/SurveillanceStation/bin"
58 | "/volume3/@appstore/SurveillanceStation/bin"
59 | "/volume1/@appstore/CodecPack/bin"
60 | "/volume2/@appstore/CodecPack/bin"
61 | "/volume3/@appstore/CodecPack/bin"
62 | "/volume1/@appstore/AudioStation/bin"
63 | "/volume2/@appstore/AudioStation/bin"
64 | "/volume3/@appstore/AudioStation/bin"
65 | )
66 |
67 | declare -a versions_list=(
68 | "6.0 7321-0"
69 | "6.0 7321-1"
70 | "6.0 7321-2"
71 | "6.0 7321-3"
72 | "6.0 7321-4"
73 | "6.0 7321-5"
74 | "6.0 7321-6"
75 | "6.0 7321-7"
76 | "6.0.1 7393-0"
77 | "6.0.1 7393-1"
78 | "6.0.1 7393-2"
79 | "6.0.2 8451-0"
80 | "6.0.2 8451-1"
81 | "6.0.2 8451-2"
82 | "6.0.2 8451-3"
83 | "6.0.2 8451-4"
84 | "6.0.2 8451-5"
85 | "6.0.2 8451-6"
86 | "6.0.2 8451-7"
87 | "6.0.2 8451-8"
88 | "6.0.2 8451-9"
89 | "6.0.2 8451-10"
90 | "6.0.2 8451-11"
91 | "6.0.3 8754-0"
92 | "6.0.3 8754-1"
93 | "6.0.3 8754-2"
94 | "6.0.3 8754-3"
95 | "6.0.3 8754-4"
96 | "6.0.3 8754-5"
97 | "6.0.3 8754-6"
98 | "6.0.3 8754-7"
99 | "6.0.3 8754-8"
100 | "6.1 15047-0"
101 | "6.1 15047-1"
102 | "6.1 15047-2"
103 | "6.1.1 15101-0"
104 | "6.1.1 15101-1"
105 | "6.1.1 15101-2"
106 | "6.1.1 15101-3"
107 | "6.1.1 15101-4"
108 | "6.1.2 15132-0"
109 | "6.1.2 15132-1"
110 | "6.1.3 15152-0"
111 | "6.1.3 15152-1"
112 | "6.1.3 15152-2"
113 | "6.1.3 15152-3"
114 | "6.1.3 15152-4"
115 | "6.1.3 15152-5"
116 | "6.1.3 15152-6"
117 | "6.1.3 15152-7"
118 | "6.1.3 15152-8"
119 | "6.1.4 15217-0"
120 | "6.1.4 15217-1"
121 | "6.1.4 15217-2"
122 | "6.1.4 15217-3"
123 | "6.1.4 15217-4"
124 | "6.1.4 15217-5"
125 | "6.1.4 15217-0"
126 | "6.1.5 15254-0"
127 | "6.1.5 15254-1"
128 | "6.1.6 15266-0"
129 | "6.1.6 15266-1"
130 | "6.1.7 15284-0"
131 | "6.1.7 15284-1"
132 | "6.1.7 15284-2"
133 | "6.1.7 15284-3"
134 | "6.2 23739-0"
135 | "6.2 23739-1"
136 | "6.2 23739-2"
137 | "6.2.1 23824-0"
138 | "6.2.1 23824-1"
139 | "6.2.1 23824-2"
140 | "6.2.1 23824-3"
141 | "6.2.1 23824-4"
142 | "6.2.1 23824-5"
143 | "6.2.1 23824-6"
144 | "6.2.2 24922-0"
145 | "6.2.2 24922-1"
146 | "6.2.2 24922-2"
147 | "6.2.2 24922-3"
148 | "6.2.2 24922-4"
149 | "6.2.2 24922-5"
150 | "6.2.2 24922-6"
151 | "6.2.3 25423-0"
152 | "6.2.3 25426-0"
153 | "6.2.3 25426-2"
154 | "6.2.3 25426-3"
155 | "7.0.1 42218-0"
156 | "7.0.1 42218-1"
157 | "7.0.1 42218-2"
158 | "7.0.1 42218-3"
159 | "7.1 42661-0"
160 | )
161 |
162 | #functions
163 | print_usage() {
164 | printf "
165 | SYNOPSIS
166 | patch.sh [-h] [-p|-r|-l]
167 | DESCRIPTION
168 | Patch to enable transcoding without a valid serial in DSM 6+
169 | -h Print this help message
170 | -p Patch synocodectool
171 | -r Restore from original from backup
172 | -l List supported DSM versions
173 | "
174 | }
175 | check_path () {
176 | for i in "${path_list[@]}"; do
177 | if [ -e "$i/$bin_file" ]; then
178 | binpath_list+=( "$i/$bin_file" )
179 | fi
180 | done
181 | }
182 |
183 | check_version () {
184 | local ver="$1"
185 | for i in "${versions_list[@]}" ; do
186 | [[ "$i" == "$ver" ]] && return 0
187 | done || return 1
188 | }
189 |
190 | list_versions () {
191 | for i in "${versions_list[@]}"; do
192 | echo "$i"
193 | done
194 | return 0
195 | }
196 |
197 | patch_menu() {
198 | local options=("$@")
199 | echo "Available binaries to patch/restore:"
200 | local PS3="Please choose which binary you want to patch/restore:"
201 | select option in "${options[@]}" "Quit"; do
202 | if [[ $REPLY = "$(( ${#options[@]}+1 ))" ]] ; then
203 | echo "Goodbye"
204 | exit 0
205 | fi
206 | bin_path="$option"
207 | break
208 | done
209 | }
210 |
211 | restore_menu() {
212 | local options=("$@")
213 | echo "Available backups to restore:"
214 | local PS3="Please choose which binary you want to restore to $bin_path:"
215 | select option in "${options[@]}" "Quit"; do
216 | if [[ $REPLY = "$(( ${#options[@]}+1 ))" ]] ; then
217 | echo "Goodbye"
218 | exit 0
219 | fi
220 | backup_file="$option"
221 | break
222 | done
223 | }
224 |
225 | patch_common () {
226 | source "/etc/VERSION"
227 | dsm_version="$productversion $buildnumber-$smallfixnumber"
228 | if [[ ! "$dsm_version" ]] ; then
229 | echo "Something went wrong. Could not fetch DSM version"
230 | exit 1
231 | fi
232 |
233 | echo "Detected DSM version: $dsm_version"
234 |
235 | if ! check_version "$dsm_version" ; then
236 | echo "Patch for DSM Version ($dsm_version) not found."
237 | echo "Patch is available for versions: "
238 | list_versions
239 | exit 1
240 | fi
241 |
242 | echo "Patch for DSM Version ($dsm_version) AVAILABLE!"
243 | check_path
244 |
245 | if ! (( ${#binpath_list[@]} )) ; then
246 | echo "Something went wrong. Could not find synocodectool"
247 | exit 1
248 | fi
249 |
250 | patch_menu "${binpath_list[@]}"
251 | }
252 |
253 | patch () {
254 | patch_common
255 | local backup_path="${bin_path%??????????????}/backup"
256 | local synocodectool_hash="$(sha1sum "$bin_path" | cut -f1 -d\ )"
257 | if [[ "${binhash_version_list[$synocodectool_hash]+isset}" ]] ; then
258 | local backup_identifier="${synocodectool_hash:0:8}"
259 | if [[ -f "$backup_path/$bin_file.$backup_identifier" ]]; then
260 | backup_hash="$(sha1sum "$backup_path/$bin_file.$backup_identifier" | cut -f1 -d\ )"
261 | if [[ "${binhash_version_list[$backup_hash]+isset}" ]]; then
262 | echo "Restored synocodectool and valid backup detected (DSM ${binhash_version_list[$backup_hash]}) . Patching..."
263 | echo -e "${binhash_patch_list[$synocodectool_hash]}" | xxd -r - "$bin_path"
264 | echo "Patched successfully"
265 | echo "Creating spoofed activation.conf.."
266 | if [ ! -e "$conf_path/$conf_file" ] ; then
267 | mkdir -p $conf_path
268 | echo "$conf_string" > "$conf_path/$conf_file"
269 | echo "Spoofed activation.conf created successfully"
270 | exit 0
271 | else
272 | rm "$conf_path/$conf_file"
273 | echo "$conf_string" > "$conf_path/$conf_file"
274 | echo "Spoofed activation.conf created successfully"
275 | exit 0
276 | fi
277 | else
278 | echo "Corrupted backup and original synocodectool detected. Overwriting backup..."
279 | mkdir -p "$backup_path"
280 | cp -p "$bin_path" \
281 | "$backup_path/$bin_file.$backup_identifier"
282 | exit 0
283 | fi
284 | else
285 | echo "Detected valid synocodectool. Creating backup.."
286 | mkdir -p "$backup_path"
287 | cp -p "$bin_path" \
288 | "$backup_path/$bin_file.$backup_identifier"
289 | echo "Patching..."
290 | echo -e "${binhash_patch_list[$synocodectool_hash]}" | xxd -r - "$bin_path"
291 | echo "Patched"
292 | echo "Creating spoofed activation.conf.."
293 | if [ ! -e "$conf_path/$conf_file" ] ; then
294 | mkdir -p $conf_path
295 | echo "$conf_string" > "$conf_path/$conf_file"
296 | echo "Spoofed activation.conf created successfully"
297 | exit 0
298 | else
299 | rm "$conf_path/$conf_file"
300 | echo "$conf_string" > "$conf_path/$conf_file"
301 | echo "Spoofed activation.conf created successfully"
302 | exit 0
303 | fi
304 | fi
305 | elif [[ "${patchhash_binhash_list[$synocodectool_hash]+isset}" ]]; then
306 | local original_hash="${patchhash_binhash_list[$synocodectool_hash]}"
307 | local backup_identifier="${original_hash:0:8}"
308 | if [[ -f "$backup_path/$bin_file.$backup_identifier" ]]; then
309 | backup_hash="$(sha1sum "$backup_path/$bin_file.$backup_identifier" | cut -f1 -d\ )"
310 | if [[ "$original_hash"="$backup_hash" ]]; then
311 | echo "Valid backup and patched synocodectool detected. Skipping patch."
312 | exit 0
313 | else
314 | echo "Patched synocodectool and corrupted backup detected. Skipping patch."
315 | exit 1
316 | fi
317 | else
318 | echo "Patched synocodectool and no backup detected. Skipping patch."
319 | exit 1
320 | fi
321 | else
322 | echo "Corrupted synocodectool detected. Please use the -r option to try restoring it."
323 | exit 1
324 | fi
325 | }
326 |
327 | rollback () {
328 | patch_common
329 | local backup_path="${bin_path%??????????????}/backup"
330 | local synocodectool_hash="$(sha1sum "$bin_path" | cut -f1 -d\ )"
331 | if [[ "${patchhash_binhash_list[$synocodectool_hash]+isset}" ]] ; then
332 | local original_hash="${patchhash_binhash_list[$synocodectool_hash]}"
333 | local backup_identifier="${original_hash:0:8}"
334 | if [[ -e "$backup_path/$bin_file.$backup_identifier" ]] ; then
335 | local backup_hash="$(sha1sum "$backup_path/$bin_file.$backup_identifier" | cut -f1 -d\ )"
336 | if [[ "$original_hash" = "$backup_hash" ]]; then
337 | cp -p "$backup_path/$bin_file.$backup_identifier" \
338 | "$bin_path"
339 | echo "Backup restored successfully (DSM ${binhash_version_list[$backup_hash]})"
340 | exit 0
341 | else
342 | echo "No valid backup found for patched synocodectool currently in use. You can download the original file for DSM ${binhash_version_list[$original_hash]} from https://github.com/stl88083365/synocodectool-patch/."
343 | exit 1
344 | fi
345 | else
346 | echo "No backups found for patched synocodectool currently in use. You can download the original file for DSM ${binhash_version_list[$original_hash]} from https://github.com/stl88083365/synocodectool-patch/."
347 | exit 1
348 | fi
349 | elif [[ "${binhash_version_list[$synocodectool_hash]+isset}" ]]; then
350 | echo "Detected unpatched original synocodectool. Restoring not neccessary!"
351 | exit 0
352 | else
353 | echo "Detected corrupted synocodectool."
354 | local backup_files=( "$backup_path"/* )
355 | if (( ${#backup_files[@]} )); then
356 | restore_menu "${backup_files[@]}"
357 | echo "Checking Hash.."
358 | local backup_hash="$(sha1sum "$backup_file" | cut -f1 -d\ )"
359 | if [[ "${binhash_version_list[$backup_hash]+isset}" ]]; then
360 | cp -p "$backup_file" \
361 | "$bin_path"
362 | echo "Backup restored successfully (DSM ${binhash_version_list[$backup_hash]})"
363 | exit 0
364 | else
365 | echo "Not a valid backup. You can either try restoring another backup or download the original file for DSM $dsm_version from https://github.com/stl88083365/synocodectool-patch/."
366 | exit 1
367 | fi
368 | else
369 | echo "No backups found. You can download the original file for DSM $dsm_version from https://github.com/stl88083365/synocodectool-patch/."
370 | exit 1
371 | fi
372 | fi
373 | }
374 |
375 | #main()
376 | if (( $EUID != 0 )); then
377 | echo "Please run as root"
378 | exit 1
379 | fi
380 |
381 | while getopts "prhl" flag; do
382 | case "${flag}" in
383 | p) opmode="patch";;
384 | r) opmode="patchrollback" ;;
385 | h) opmode="${opmode}" ;;
386 | l) opmode="listversions" ;;
387 | *) echo "Incorrect option specified in command line" ; exit 2 ;;
388 | esac
389 | done
390 |
391 | case "${opmode}" in
392 | patch) patch ;;
393 | patchrollback) rollback ;;
394 | patchhelp) print_usage ; exit 2 ;;
395 | listversions) list_versions ;;
396 | *) echo "Incorrect combination of flags. Use option -h to get help."
397 | exit 2 ;;
398 | esac
399 |
--------------------------------------------------------------------------------
/synocodectool/original/synocodectool.6.0-7321-0_6.0.3-8754-8.original:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/original/synocodectool.6.0-7321-0_6.0.3-8754-8.original
--------------------------------------------------------------------------------
/synocodectool/original/synocodectool.6.1-15047-0_6.1.1-15101-4.original:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/original/synocodectool.6.1-15047-0_6.1.1-15101-4.original
--------------------------------------------------------------------------------
/synocodectool/original/synocodectool.6.1.2-15132-0_6.1.3-15152-8.original:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/original/synocodectool.6.1.2-15132-0_6.1.3-15152-8.original
--------------------------------------------------------------------------------
/synocodectool/original/synocodectool.6.1.4-15217-0_6.2-23739-2.original:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/original/synocodectool.6.1.4-15217-0_6.2-23739-2.original
--------------------------------------------------------------------------------
/synocodectool/original/synocodectool.6.2.1-23824-0_6.2.3-25426-3.original:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/original/synocodectool.6.2.1-23824-0_6.2.3-25426-3.original
--------------------------------------------------------------------------------
/synocodectool/original/synocodectool.7.0.1-42216-0_7.0.1-42218-3.original:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/original/synocodectool.7.0.1-42216-0_7.0.1-42218-3.original
--------------------------------------------------------------------------------
/synocodectool/original/synocodectool.7.1-42661-0_7.1-42661-0.CodecPack.patch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/original/synocodectool.7.1-42661-0_7.1-42661-0.CodecPack.patch
--------------------------------------------------------------------------------
/synocodectool/original/synocodectool.7.1-42661-0_7.1-42661-0.original:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/original/synocodectool.7.1-42661-0_7.1-42661-0.original
--------------------------------------------------------------------------------
/synocodectool/patch/synocodectool.6.0-7321-0_6.0.3-8754-8.patch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/patch/synocodectool.6.0-7321-0_6.0.3-8754-8.patch
--------------------------------------------------------------------------------
/synocodectool/patch/synocodectool.6.1-15047-0_6.1.1-15101-4.patch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/patch/synocodectool.6.1-15047-0_6.1.1-15101-4.patch
--------------------------------------------------------------------------------
/synocodectool/patch/synocodectool.6.1.2-15132-0_6.1.3-15152-8.patch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/patch/synocodectool.6.1.2-15132-0_6.1.3-15152-8.patch
--------------------------------------------------------------------------------
/synocodectool/patch/synocodectool.6.1.4-15217-0_6.2-23739-2.patch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/patch/synocodectool.6.1.4-15217-0_6.2-23739-2.patch
--------------------------------------------------------------------------------
/synocodectool/patch/synocodectool.6.2.1-23824-0_6.2.3-25426-3.patch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/patch/synocodectool.6.2.1-23824-0_6.2.3-25426-3.patch
--------------------------------------------------------------------------------
/synocodectool/patch/synocodectool.7.0.1-42216-0_7.0.1-42218-3.patch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/patch/synocodectool.7.0.1-42216-0_7.0.1-42218-3.patch
--------------------------------------------------------------------------------
/synocodectool/patch/synocodectool.7.1-42661-0_7.1-42661-0.CodecPack.original:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/patch/synocodectool.7.1-42661-0_7.1-42661-0.CodecPack.original
--------------------------------------------------------------------------------
/synocodectool/patch/synocodectool.7.1-42661-0_7.1-42661-0.patch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmc31a42/synocodectool-patch/1098878c4b6285df525e5764af0ee1acd92902d3/synocodectool/patch/synocodectool.7.1-42661-0_7.1-42661-0.patch
--------------------------------------------------------------------------------