diff options
| author | 2023-07-21 03:40:28 +0700 | |
|---|---|---|
| committer | 2023-07-21 03:40:28 +0700 | |
| commit | 7ae455ff186ebc58db025ab5a0f260a1b090bb58 (patch) | |
| tree | 3df1197f15fbd7673d02fc59773f124b767dc1a1 /src | |
| parent | bd618e0ed1000c7e3a02bfad032cb444495d2531 (diff) | |
| download | ideviceinstaller-7ae455ff186ebc58db025ab5a0f260a1b090bb58.tar.gz ideviceinstaller-7ae455ff186ebc58db025ab5a0f260a1b090bb58.tar.bz2 | |
Use plist_from_memory instead of plist_from_bin/xml
Diffstat (limited to 'src')
| -rw-r--r-- | src/ideviceinstaller.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index a46b312..e5c36ef 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c | |||
| @@ -1181,11 +1181,7 @@ run_again: | |||
| 1181 | free(filename); | 1181 | free(filename); |
| 1182 | 1182 | ||
| 1183 | plist_t info = NULL; | 1183 | plist_t info = NULL; |
| 1184 | if (memcmp(ibuf, "bplist00", 8) == 0) { | 1184 | plist_from_memory(ibuf, filesize, &info, NULL); |
| 1185 | plist_from_bin(ibuf, filesize, &info); | ||
| 1186 | } else { | ||
| 1187 | plist_from_xml(ibuf, filesize, &info); | ||
| 1188 | } | ||
| 1189 | free(ibuf); | 1185 | free(ibuf); |
| 1190 | 1186 | ||
| 1191 | if (!info) { | 1187 | if (!info) { |
| @@ -1215,13 +1211,12 @@ run_again: | |||
| 1215 | zbuf = buf_from_file(extmeta, &flen); | 1211 | zbuf = buf_from_file(extmeta, &flen); |
| 1216 | if (zbuf && flen) { | 1212 | if (zbuf && flen) { |
| 1217 | meta = plist_new_data(zbuf, flen); | 1213 | meta = plist_new_data(zbuf, flen); |
| 1218 | if (memcmp(zbuf, "bplist00", 8) == 0) { | 1214 | plist_from_memory(zbuf, flen, &meta_dict, NULL); |
| 1219 | plist_from_bin(zbuf, flen, &meta_dict); | ||
| 1220 | } else { | ||
| 1221 | plist_from_xml(zbuf, flen, &meta_dict); | ||
| 1222 | } | ||
| 1223 | free(zbuf); | 1215 | free(zbuf); |
| 1224 | } else { | 1216 | } |
| 1217 | if (!meta_dict) { | ||
| 1218 | plist_free(meta); | ||
| 1219 | meta = NULL; | ||
| 1225 | fprintf(stderr, "WARNING: could not load external iTunesMetadata %s!\n", extmeta); | 1220 | fprintf(stderr, "WARNING: could not load external iTunesMetadata %s!\n", extmeta); |
| 1226 | } | 1221 | } |
| 1227 | zbuf = NULL; | 1222 | zbuf = NULL; |
| @@ -1231,12 +1226,11 @@ run_again: | |||
| 1231 | /* extract iTunesMetadata.plist from package */ | 1226 | /* extract iTunesMetadata.plist from package */ |
| 1232 | if (zip_get_contents(zf, ITUNES_METADATA_PLIST_FILENAME, 0, &zbuf, &len) == 0) { | 1227 | if (zip_get_contents(zf, ITUNES_METADATA_PLIST_FILENAME, 0, &zbuf, &len) == 0) { |
| 1233 | meta = plist_new_data(zbuf, len); | 1228 | meta = plist_new_data(zbuf, len); |
| 1234 | if (memcmp(zbuf, "bplist00", 8) == 0) { | 1229 | plist_from_memory(zbuf, len, &meta_dict, NULL); |
| 1235 | plist_from_bin(zbuf, len, &meta_dict); | 1230 | } |
| 1236 | } else { | 1231 | if (!meta_dict) { |
| 1237 | plist_from_xml(zbuf, len, &meta_dict); | 1232 | plist_free(meta); |
| 1238 | } | 1233 | meta = NULL; |
| 1239 | } else { | ||
| 1240 | fprintf(stderr, "WARNING: could not locate %s in archive!\n", ITUNES_METADATA_PLIST_FILENAME); | 1234 | fprintf(stderr, "WARNING: could not locate %s in archive!\n", ITUNES_METADATA_PLIST_FILENAME); |
| 1241 | } | 1235 | } |
| 1242 | free(zbuf); | 1236 | free(zbuf); |
| @@ -1269,11 +1263,7 @@ run_again: | |||
| 1269 | goto leave_cleanup; | 1263 | goto leave_cleanup; |
| 1270 | } | 1264 | } |
| 1271 | free(filename); | 1265 | free(filename); |
| 1272 | if (memcmp(zbuf, "bplist00", 8) == 0) { | 1266 | plist_from_memory(zbuf, len, &info, NULL); |
| 1273 | plist_from_bin(zbuf, len, &info); | ||
| 1274 | } else { | ||
| 1275 | plist_from_xml(zbuf, len, &info); | ||
| 1276 | } | ||
| 1277 | free(zbuf); | 1267 | free(zbuf); |
| 1278 | 1268 | ||
| 1279 | if (!info) { | 1269 | if (!info) { |
