2

在我的应用程序的构建和归档期间,.strings文件被复制到应用程序包中,例如

CopyStringsFile
/Users/Systems/Library/Developer/Xcode/DerivedData/MyProject-dqtbpsfqkwnliuflrsytopqbuvpr/Build/Intermediates/ArchiveIntermediates/Evolve/InstallationBuildProductsLocation/Applications/Evolve.app/en.lproj/InfoPlist.strings
MyProject/en.lproj/InfoPlist.strings
    cd /Users/Systems/luke/repos/MyProject/MyProject
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-copyStrings --validate --inputencoding utf-8 --outputencoding binary --outdir /Users/Systems/Library/Developer/Xcode/DerivedData/MyProject-dqtbpsfqkwnliuflrsytopqbuvpr/Build/Intermediates/ArchiveIntermediates/Evolve/InstallationBuildProductsLocation/Applications/Evolve.app/en.lproj
-- MyProject/en.lproj/InfoPlist.strings

解压缩 ipa 并将字符串文件加载到文本编辑器中会显示二进制内容。

我想使用 bash 读取 ASCII UTF-8 中的字符串文件的内容,找到并替换一些字符串并再次将其编码为二进制。

具体来说,我应该如何将文件的内容解码为 ASCI?

4

1 回答 1

3

原来这是一个超级简单的 bash 命令:

plutil -convert xml1 <PATH_TO_STRINGS_FILE>

并再次将其转换回来:

plutil -convert binary1 <PATH_TO_STRINGS_FILE>
于 2013-03-01T16:57:56.197 回答