Java Read IPA info.plist get version information __java

Source: Internet
Author: User
and Android Manifest.xml similar to an application in iOS version information, application name, compatible minimum version, etc. are listed in the IPA package info.plist, but for a packaged IPA bag, inside the info.plist is garbled, want to get information is quite troublesome. And more recently to this demand, the first solution found is to use Java to invoke Linux In the Plutil tool to achieve the info.plist resolution, although this can be achieved but feel too far-fetched, the second solution is to continue to find a pure Java solution, look for the last or on a foreigner's website (overstackflow.com) Find someone to mention such a problem, fortunately there are a lot of buddies reply, the foreigner is really good, and finally do, feasible, the specific is to find a jar package, simple call on OK, first paste the code, For how to extract info.plist from IPA is not wordy, use zip flow can be done, provide a reference for others to do the implementation of the OK (http://code.google.com/p/sunlab/source/detail?r=339) :

[Java] ImportJava.io.File;ImportCom.dd.plist.PropertyListParser; Publicclassplist { PublicStatic voidMain (string[] args)throwsException {File File =NewFile ("D:\\angryinfo.plist"); File file1 =New file ("D:\\angryinfo1.plist");                      propertylistparser.converttoxml (File, file1)  ;                                                //inputstream input = plist.class.getclassloader (). GetResourceAsStream ( "");   //      nsdictionary rootdict =  ( nsdictionary)  propertylistparser.parse (file);   //          //         //          //         //       string namE = rootdict.objectforkey ("Name"). ToString ();   //       NSObject[] parameters =  ((Nsarray)  rootdict.objectforkey ("parameters")). GetArray ();    //      for  (nsobject param : parameters)  {   //             //           system.out.println (Param.toXMLPropertyList ());    //             //           if  (Param.getclass (). Equals (Nsnumber.class))  {    //               nsnumber num =  (nsnumber)  param;   //               switch  (Num.type ())  {   //               case NSNumber.BOOLEAN: {   //                   boolean  bool = num.boolvalue ();   //                   // ...   //                   break;    //              }    //              case  nsnumber.integer: {   //                &nbsP;  long l = num.longvalue ();   //                   // or int i =  num.intvalue ();   //                   // ...   //                   break;   //               }   //               case NSNumber.REAL: {    //                   double d = num.doublevalue ();   //                   // ...   //                   break;    //              }    //              }    //          }   //           // else...   //       }        }  }  

Under D disk to find angryinfo1.plist open, is not garbled, now want to extract what information even though extracted.

Used jar Load:

free download address in http://linux.linuxidc.com/

username and password are www.linuxidc.com

Download Catalog in /2012/January/14th/java Read IPA info.plist get version information/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.