Class: IpaUtilities
- Inherits:
-
Object
- Object
- IpaUtilities
- Defined in:
- lib/ipa_utilities/IpaUtilities.rb
Instance Attribute Summary collapse
-
#provisionParser ⇒ Object
readonly
Returns the value of attribute provisionParser.
Instance Method Summary collapse
- #bundleName ⇒ Object
- #cleanUp ⇒ Object
- #deleteOldSignature ⇒ Object
-
#initialize(ipaPath) ⇒ IpaUtilities
constructor
A new instance of IpaUtilities.
- #parse ⇒ Object
- #unzip ⇒ Object
- #unzipAndParse ⇒ Object
- #verifyCodeSign ⇒ Object
- #zip(path) ⇒ Object
Constructor Details
#initialize(ipaPath) ⇒ IpaUtilities
10 11 12 13 14 15 |
# File 'lib/ipa_utilities/IpaUtilities.rb', line 10 def initialize ipaPath pn = Pathname.new(ipaPath) @ipaPath = pn.dirname @ipaName = pn.basename @fullPath = ipaPath end |
Instance Attribute Details
#provisionParser ⇒ Object (readonly)
Returns the value of attribute provisionParser.
8 9 10 |
# File 'lib/ipa_utilities/IpaUtilities.rb', line 8 def provisionParser @provisionParser end |
Instance Method Details
#bundleName ⇒ Object
29 30 31 |
# File 'lib/ipa_utilities/IpaUtilities.rb', line 29 def bundleName Dir.entries("Payload").last end |
#cleanUp ⇒ Object
57 58 59 60 61 62 |
# File 'lib/ipa_utilities/IpaUtilities.rb', line 57 def cleanUp system "rm -rf Payload" system "rm -rf tmp.plist" system "rm -rf Entitlements.plist" system "rm -rf _new.ipa" end |
#deleteOldSignature ⇒ Object
52 53 54 55 |
# File 'lib/ipa_utilities/IpaUtilities.rb', line 52 def deleteOldSignature system "rm -rf Payload/*.app/_CodeSignature" puts "Deleting old code sign file" if $verbose end |
#parse ⇒ Object
38 39 40 41 |
# File 'lib/ipa_utilities/IpaUtilities.rb', line 38 def parse @provisionPath = "Payload/#{bundleName}/embedded.mobileprovision" @provisionParser = ProvisionParser.new @provisionPath end |
#unzip ⇒ Object
17 18 19 20 |
# File 'lib/ipa_utilities/IpaUtilities.rb', line 17 def unzip say "Unzipping " + @fullPath.green if $verbose system "unzip #{@fullPath} > log.txt" end |
#unzipAndParse ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/ipa_utilities/IpaUtilities.rb', line 43 def unzipAndParse unzip puts "App bundle name is " + bundleName.green if $verbose parse say "Reading provision profile at "+ @provisionPath.green if $verbose puts if $verbose end |
#verifyCodeSign ⇒ Object
33 34 35 36 |
# File 'lib/ipa_utilities/IpaUtilities.rb', line 33 def verifyCodeSign result = `codesign -v Payload/#{bundleName} 2>&1` result.empty? ? "Signature Valid\n".green : "Signature Not Valid\n".red + result.red if $verbose end |
#zip(path) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/ipa_utilities/IpaUtilities.rb', line 22 def zip path say "Zipping " + @fullPath.green if $verbose system "zip -qr \"_new.ipa\" Payload" system "cp _new.ipa #{path}" say "Resigned ipa saved at " + path.green if $verbose end |