Syndicate
Site (RSS, Atom)
Contact
Weblog status
Total entries: 50
Last entry: 2016-10-17 22:22:03
Last updated: 2016-10-18 07:57:57
powered by vim, bash, cat, grep, sed, and nb 3.4.2

September 2014 Archives

2014-09-29 14:26:05

Fix timestamps on iOS backup .ipa files

If you have backups of your iOS apps and the timestamps of the files are broken (the modification time), then it is easy to fix with one line of code on a linux system:

find . -name "*.ipa"|while read FILE;do echo $FILE; \
 ls -l "$FILE";touch -t $(date -d@$(unzip -l "$FILE" \
 |grep iTunesMetadata.plist \
 |grep " ..-..-20.. "|tr '-' ' '|awk \
 '{system("date +%s -d\""$4"-"$2"-"$3" "$5"\"")}' \
 |sort -un|tail -n 1) +%Y%m%d%H%M) "$FILE"; \
 ls -l "$FILE";done

This is a sample run:

./Zahlen.ipa
-rw-r--r--. 1 fwb root 60747116 Apr 26 09:44 ./Zahlen.ipa
-rw-r--r--. 1 fwb root 60747116 Apr 14 17:43 ./Zahlen.ipa

If you run a BSD type of OS like i.e. MacOS you must use "-r" instead of "-d@" to convert from unix timestamp.

Update 2015-01-11: Insert additional grep for "iTunesMetadata.plist" to speed up. Hint: If you use "Payload.*PkgInfo" instead of "iTunesMetadata.plist" you will get a date near by the build date of the app instead of the purchase date.


Posted by Frank W. Bergmann | Permanent link | File under: apple, shell