xcode Apple 是否更改了 .mobileprovision 文件格式,我如何查看当前格式?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10988998/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Did Apple change the .mobileprovision file format, and how can I view the current format?
提问by jwl
I'm finding many articles on the web where it is implied that you can view the .mobileprovision file contents in a text editor. For example, this Urban Airship post:
我在网上找到了很多文章,其中暗示您可以在文本编辑器中查看 .mobileprovision 文件内容。例如,这个城市飞艇帖子:
When push notifications are enabled for an app, the aps-environment key will appear in the .mobileprovision file specifying the provisioning profile:
为应用启用推送通知后,aps-environment 密钥将出现在 .mobileprovision 文件中,指定配置文件:
<key>Entitlements</key>
<dict>
<key>application-identifier</key>
...
However the mobilprovision files I have (obtained within the last few days) contain 466 1/2 rows of 8 groups of 4 hex digits, (e.g. 4851 3842 4176 2845 0a09 01a2 404d 4382
). How can I view this type of file?
然而,我拥有的 mobilprovision 文件(在过去几天内获得)包含 466 1/2 行 8 组 4 个十六进制数字,(例如4851 3842 4176 2845 0a09 01a2 404d 4382
)。如何查看此类文件?
采纳答案by Till
You are using a text-editor that is a bit too clever for you :D.
您使用的文本编辑器对您来说有点太聪明了:D。
Your editor finds out that the file actually is binary and shows it as a hex-dump - for example Sublime 2 does it that way. Open that same file using TextEdit. You will see a couple of lines of binary garbledegock and then some plain-text (XML) that should contain the information you are looking for.
您的编辑器发现该文件实际上是二进制文件并将其显示为十六进制转储 - 例如 Sublime 2 就是这样做的。使用 TextEdit 打开同一个文件。您将看到几行二进制 garbledegock,然后是一些应包含您要查找的信息的纯文本 (XML)。
However, do notedit that file using TextEdit, that will render it unusable!
然而,这样做不是编辑该文件使用文本编辑,这将使其不能使用!
回答by Alfie Hanssen
Provisioning Profiles are encoded. To decode them and examine the XML you can use this via command line:
供应配置文件被编码。要解码它们并检查 XML,您可以通过命令行使用它:
security cms -D -i #{@profilePath}
security cms -D -i #{@profilePath}
where #{@profilePath}
is the filepath to your .mobileprovision file.
这里#{@profilePath}
是文件路径到你的文件名为.mobileprovision。
A fuller Ruby example is:
一个更完整的 Ruby 示例是:
require 'plist'
profile = `security cms -D -i #{@profilePath}`
xml = Plist::parse_xml(profile)
appID = xml['Entitlements']['application-identifier']
回答by Skabber
If you want Sublime Text 2 to be able to read .mobileprovision profiles this is the setting
如果您希望 Sublime Text 2 能够读取 .mobileprovision 配置文件,这就是设置
"enable_hexadecimal_encoding": false,
回答by Skabber
You can use openssl to output the contents of the signed profile.
您可以使用 openssl 输出签名配置文件的内容。
openssl smime -in /path/to/your.mobileprovision -inform der -verify