5

I need a tool that prints the actual text in a plist file (plutil changes the format, cat prints gibberish, and there is no defaults command for iOS). It needs to be in a script, so text editors don't work.

This is what I need it for:

apps="$(find /var/mobile/Applications -name "Info.plist" | grep "\.app/Info\.plist")"
mkdir /var/mobile/rmnames
for app in $apps; do 
    newplist="$(echo $app | sed 's|/var/mobile/Applications/[^/]*/||' | sed 's|\.app/Info\.plist|.txt|')"
    #1# $app | sed 's|<string>#2#</string>|<string></string>|' > "/var/mobile/rmnames/"$newplist
    mv "/var/mobile/rmnames/"$newplist $app 
done
rm -rf /var/mobile/rmnames

What I hope for this to do is delete all of the app store app names on my springboard without having to do it by hand. Where "#1#" is a plist printing utility, and "#2#" is a regex to find the CFBundleDisplayName.

Also, if you are wondering why I don't just get a Cydia tweak that does this, I despise Mobile Substrate.. haha, thanks ahead of time!

Example of what I mean by gibberish:

mobile:Flixster.app> cat Info.plist
bplist00?#


!"#$%&'()*+,(4567(9:;    <=>CDEVWXY[\]^_bc_CFBundleSignatureYDTSDKName_DTPlatformBuild_BuildMachineOSBuil  d_UIPrerenderedIcon_MedialetsUseTestServers_CFShortVersionString_CFBundleExecuta  ble_CFBundleIconFiles_LSRequiresIPhoneOS]NSMainNibFile^MedialetsAppID_CFBundlePackageTypeZDTSDKBuild_UIRequiresPersistentWiFi\DTXcodeBuild_NSMainNibFile~ipad_CFBundleResourceSpecificationZDTCompiler_CFBundleDisplayName_%UISupportedInterfaceOrientations~ipad_CFBundleDevelopmentRegion^DTPlatformName_CFBundleURLTypes\CFBundleName_CFBundleVersion_DTPlatformVersion_CFBundleSupportedPlatformsWDTXcode_FLXReleaseCandidate_MinimumOSVersion_CFBundleIdentifier^UIDeviceFamily_CFBundleIconFile_CFBundleInfoDictionaryVersionT????[iphoneos5.0U9A334V10K549 T5.20XFlixster?-./012XIcon.png[[email protected][Icon-72.png_Icon-Small-50.png^[email protected]    ZMainWindow_(83e69fab771f958d7de70ada6ba32ff334b9eec1TAPPLU9A334    U4C199_MainWindow-iPad_ResourceRules.plist_com.apple.compilers.llvmgcc42P??@AB_#UIInterfaceOrientationLandscapeLeft_$UIInterfaceOrientationLandscapeRight_UIInterfaceOrientationPortrait_(UIInterfaceOrientationPortraitUpsideDownUen_USXiphoneos?F?GHIJ_CFBundleURLName_CFBundleURLSchemes_com.jeffreygrossman.moviesapp?  KLMNOPQRSTUXflixster\fb2558160538\fb2373897986\fb2446021478]fb55312797380\fb5769  273609\fb2352444510\fb2451978556]fb16478767641]fb87604592406\fb2532675812XFlixst  erT5.20S5.0?ZXiPhoneOST0420R10S4.0_com.jeffreygrossman.moviesapp? `aXIcon.pngS6.Qeo??????(7MXs??????)<I[o???????%+2349BIR^j~?????????? 238^????????.:CP]┘│??????????????!␍%└⎺␉␋┌␊:F┌␋│⎽├␊⎼.▒⎻⎻> 
4
  • All the plist files I've seen are plain text (XML). Are you quite certain yours is not supposed to be?
    – Kevin
    Mar 8, 2012 at 1:14
  • they are UTF-8 encoded plists...
    – Cade
    Mar 8, 2012 at 1:21
  • What's wrong with plutil exactly? It should be able to produce XML from your binary plist (and back).
    – Mat
    Mar 8, 2012 at 20:20
  • how do I save the changes that I make with plutil? Because plutil changes the format of the plists. So, when I try to send the changed text back into a .plist, it doesn't have the correct plist formatting.
    – Cade
    Mar 9, 2012 at 22:36

1 Answer 1

6

You could use file to determine the type of the plist and if it is binary:

 plutil -convert xml1 $file && sed /*whatever*/  $file && plutil -convert binary1 $file

otherwise of course you can just use sed (or perl) directly on the xml file.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .