provise 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,25 @@
1
+ .bundle
2
+ db/*.sqlite3
3
+ log/
4
+ tmp/
5
+ .sass-cache/
6
+ public/system/
7
+ public/assets/
8
+ *.orig
9
+
10
+ # MacOS
11
+ .DS_Store
12
+
13
+ # from github template
14
+
15
+ *.gem
16
+ *.rbc
17
+ .config
18
+ coverage
19
+ InstalledFiles
20
+ lib/bundler/man
21
+ pkg
22
+ rdoc
23
+ spec/reports
24
+ test/tmp
25
+ test/version_tmp
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gemspec
@@ -0,0 +1,18 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ provise (0.0.1)
5
+ commander (~> 4.1.2)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ commander (4.1.2)
11
+ highline (~> 1.6.11)
12
+ highline (1.6.15)
13
+
14
+ PLATFORMS
15
+ ruby
16
+
17
+ DEPENDENCIES
18
+ provise!
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Felipe Sabino (http://felipe.sabino.me)
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ # provise
2
+
3
+ CLI used to change the provisioning profile of an iOS App (.ipa file). Also makes possible changing the bundle identifier if the new provisioning has a different one.
4
+
5
+ ## Installation
6
+
7
+ $ gem install provise
8
+
9
+ ## Usage
10
+
11
+ To simply change the provisioning
12
+
13
+ $ resign ipa -i Application.ipa -p foo/bar.mobileprovision -c \"iPhone Distribution: Bla Bla\"
14
+
15
+ To change the peovisionig and also the bundle identifier
16
+
17
+ $ resign ipa -i Application.ipa -p foo/bar.mobileprovision -c "iPhone Distribution: Bla Bla" -b br.com.new.bundle.identifier
18
+
@@ -0,0 +1,10 @@
1
+ require "bundler"
2
+ Bundler.setup
3
+
4
+ gemspec = eval(File.read("provise.gemspec"))
5
+
6
+ task :build => "#{gemspec.full_name}.gem"
7
+
8
+ file "#{gemspec.full_name}.gem" => gemspec.files + ["provise.gemspec"] do
9
+ system "gem build provise.gemspec"
10
+ end
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'commander/import'
4
+
5
+ $:.push File.expand_path("../../lib", __FILE__)
6
+ require 'provise'
7
+
8
+ HighLine.track_eof = false # Fix for built-in Ruby
9
+
10
+ program :version, Provise::VERSION
11
+ program :description, 'Re-sign iOS Apps (.ipa files)'
12
+
13
+ program :help, 'Author', 'Felipe Sabino <felipe@sabino.me>'
14
+ program :help, 'Website', 'http://twitter.com/felipesabino'
15
+ program :help_formatter, :compact
16
+
17
+ global_option '--verbose'
18
+ default_command :help
19
+
20
+ require 'provise/commands'
@@ -0,0 +1,3 @@
1
+ module Provise
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,4 @@
1
+ $:.push File.expand_path('../', __FILE__)
2
+
3
+ require 'commands/ipa'
4
+
@@ -0,0 +1,82 @@
1
+ command :ipa do |c|
2
+
3
+ c.syntax = '$ resign ipa [options]'
4
+ c.summary = 'Generate a new .ipa file with provisioning profile provided'
5
+ c.description = ''
6
+
7
+ c.example 'example', 'resign ipa -i Application.ipa -p foo/bar.mobileprovision -c \"iPhone Distribution: Bla Bla\"'
8
+ c.example 'example with bundle identifier change', 'resign ipa -i Application.ipa -p foo/bar.mobileprovision -c "iPhone Distribution: Bla Bla" -b br.com.new.bundle.identifier'
9
+
10
+ c.option '-i', '--ipa IPA', 'Path to the original .ipa file'
11
+ c.option '-p', '--provisioning PROVISIONING', 'Path to the provisioning profile file (generally a .mobileprovision file)'
12
+ c.option '-c', '--certificate CERTIFICATE', 'Name of the Distribution Certificate name (copy it from Certificate detail\'s "Common name" at the Keychain Access)'
13
+ c.option '-b', '--bundle BUNDLE', 'The new bundle identifier in case your new provisioning has a differente one'
14
+ c.option '-q', '--quiet', 'Supress warnings and info messages'
15
+
16
+ c.action do |args, options|
17
+
18
+ # getting parameters
19
+
20
+ @ipa_path = options.ipa
21
+ @provisioning_path = options.provisioning
22
+ @certificate_name = options.certificate
23
+ @new_bundle_identifier = options.bundle
24
+
25
+ return unless validate_params!
26
+
27
+ # unzip IPA file to manipulate the plist and the certificate resources
28
+
29
+ @ipa_filename = File.basename @ipa_path, File.extname(@ipa_path)
30
+ @tmp_dir = "#{Dir.tmpdir}/resign"
31
+
32
+ say "Unziping #{@ipa_filename}.ipa file to a temp dir" unless options.quiet
33
+ system "rm -rf #{@tmp_dir}"
34
+ system "mkdir #{@tmp_dir}"
35
+ system "unzip -q #{@ipa_path} -d #{@tmp_dir}"
36
+
37
+
38
+ say "Removing old code signatures" unless options.quiet
39
+ system "rm -rf #{@tmp_dir}/Payload/*.app/_CodeSignature #{@tmp_dir}/Payload/*.app/CodeResources"
40
+
41
+ if @new_bundle_identifier
42
+ say "Changing bundle identifier to #{@new_bundle_identifier}" unless options.quiet
43
+ system "/usr/libexec/PlistBuddy -c \"Set :CFBundleIdentifier #{@new_bundle_identifier}\" #{@tmp_dir}/Payload/*.app/Info.plist"
44
+ end
45
+
46
+ say "Replacing provisioning profile" unless options.quiet
47
+ system "cp #{@provisioning_path} #{@tmp_dir}/Payload/*.app/embedded.mobileprovision"
48
+
49
+ say "Replacing existing signatures" unless options.quiet
50
+ system "/usr/bin/codesign -f -s \"#{@certificate_name}\" --resource-rules #{@tmp_dir}/Payload/*.app/ResourceRules.plist #{@tmp_dir}/Payload/*.app"
51
+
52
+
53
+ new_ipa_file = "#{@ipa_filename}.resigned.ipa"
54
+
55
+ say "Packing resigned ipa file to #{new_ipa_file}" unless options.quiet
56
+
57
+ # to zip correctly, it must go to the correct path
58
+ script_folder = Dir.pwd.gsub(" ", "\\ ")
59
+ Dir.chdir(@tmp_dir) do
60
+ system "zip -qr #{script_folder}/#{new_ipa_file} ./Payload/"
61
+ end
62
+
63
+ say "Cleaning temp folders" unless options.quiet
64
+ system "rm -rf #{@tmp_dir}"
65
+
66
+ say "done." unless options.quiet
67
+
68
+ end
69
+
70
+ private
71
+
72
+ def validate_params!
73
+
74
+ say_error "Path to .ipa file is reqired" unless @ipa_path
75
+ say_error "Path to provisioning profile is required" unless @provisioning_path
76
+ say_error "Name of new certificate is required" unless @certificate_name
77
+
78
+ return true if @ipa_path and @provisioning_path and @certificate_name
79
+
80
+ end
81
+
82
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require 'provise'
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "provise"
7
+ gem.version = Provise::VERSION
8
+ gem.platform = Gem::Platform::RUBY
9
+ gem.authors = ["Felipe Sabino"]
10
+ gem.email = "felipe@sabino.me"
11
+ gem.description = "CLI for re-signing iOS Apps (.ipa files)"
12
+ gem.summary = "Re-sign iOS Apps (.ipa files)"
13
+ gem.homepage = ""
14
+
15
+ gem.add_dependency "commander", "~> 4.1.2"
16
+
17
+ gem.files = `git ls-files`.split("\n")
18
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ gem.require_paths = ["lib"]
21
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: provise
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Felipe Sabino
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: commander
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 4.1.2
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 4.1.2
30
+ description: CLI for re-signing iOS Apps (.ipa files)
31
+ email: felipe@sabino.me
32
+ executables:
33
+ - resign
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - .gitignore
38
+ - Gemfile
39
+ - Gemfile.lock
40
+ - LICENSE.txt
41
+ - README.md
42
+ - Rakefile
43
+ - bin/resign
44
+ - lib/provise.rb
45
+ - lib/provise/commands.rb
46
+ - lib/provise/commands/ipa.rb
47
+ - provise.gemspec
48
+ homepage: ''
49
+ licenses: []
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ segments:
61
+ - 0
62
+ hash: 1835449240709771196
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ segments:
70
+ - 0
71
+ hash: 1835449240709771196
72
+ requirements: []
73
+ rubyforge_project:
74
+ rubygems_version: 1.8.24
75
+ signing_key:
76
+ specification_version: 3
77
+ summary: Re-sign iOS Apps (.ipa files)
78
+ test_files: []