How to determine at run-time if app is for development, app store or ad hoc distribution?

后端 未结 5 532
半阙折子戏
半阙折子戏 2020-12-07 09:00

Is there a way to determine programmatically if the currently running app was built and signed for development only or whether it was built for distribution? And can one det

5条回答
  •  伪装坚强ぢ
    2020-12-07 09:19

    I've extracted an embedded.mobileprovision file and pasted into an online ASN.1 viewer (e.g. http://www.geocities.co.jp/SiliconValley-SanJose/3377/asn1JS.html), and that's what a got:

    SEQUENCE {
       OBJECTIDENTIFIER 1.2.840.113549.1.7.2 (signedData)
       [0] {
          SEQUENCE {
             INTEGER 1
             SET {
                SEQUENCE {
                   OBJECTIDENTIFIER 1.3.14.3.2.26
                   NULL 
                }
             }
             SEQUENCE {
                OBJECTIDENTIFIER 1.2.840.113549.1.7.1 (data)
                [0] {
                   OCTETSTRING 3c3f786d6c20766 ... 6c6973743e0a
                }
             }
             [0] {
                SEQUENCE {
                   SEQUENCE {
                      [0] {
                         INTEGER 2
                      }
     ... [much more]
    

    With this and some ASN.1 knowledge, your explanation makes perfect sense.

    The interesting part is the octet string starting 3c3f786d6c. That's the XML part in Apple's property list format that contains all the answers about the distribution type (developer, ad-hoc, App Store).

提交回复
热议问题