objc-obfuscator 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88744f3b2d2512777b1a4e5cf1bd1e0a8d5df372
4
- data.tar.gz: 7afa6ad33edbb87fee6202a067b54ffe5730f5b5
3
+ metadata.gz: 98cb53b24c655e999b4787b3b263fcaa05eb4396
4
+ data.tar.gz: be44de23f63e6bc4e3a076b2c3ef5a6f4b70fc9d
5
5
  SHA512:
6
- metadata.gz: d1e4fef3c417653f3db148474be28428c2b2c2682b5ff139fda477e7cd850141e1042853a0c8e778bfefad61a550853ce89e9c4e373b8734e962d4cfcbb25e1d
7
- data.tar.gz: fe4f1d2359e7ae59be243bacce17b88700a19c601cd30fe4d8d3ae961ed2c342611ac433b322390e94155ffda583118ccfa573120259d4fe9a9e81ed7689ba68
6
+ metadata.gz: fbd195a5b02a43e2480c9e9462dbd0ddff2d421b6dcd615bdf5aa77fe1219cd75b2726798e0e32549a124d63ca0d6b27130c6096a877b1020ab20257932fb4fe
7
+ data.tar.gz: 493e06e2f1029159993f9d657a2d004bc67ab09d8c8b1a8d371ae3fbc85eb14a7e53a085ee3882adf2cb151844e09dbec77225218756d1f05a1a2e365a1bb649
@@ -23,7 +23,7 @@ module Objc_Obfuscator
23
23
  :desc => 'Saves the original files as a .bak file'
24
24
  def obfuscate(key, *file_paths)
25
25
 
26
- raise Thor::Error, 'A valid key and file should be provided' if key.empty? || file_paths.empty?
26
+ raise Thor::Error, 'A valid key and file must be provided' if key.empty? || file_paths.empty?
27
27
 
28
28
  file_paths.each do |file_path|
29
29
  unless File.exist? file_path
@@ -34,10 +34,11 @@ module Objc_Obfuscator
34
34
  end
35
35
  end
36
36
 
37
- desc 'integrate [PROJECT_FILE]', "Integrate Objc Obfuscator with the Xcode project at PROJECT_FILE."
37
+ desc 'integrate [ENCRYPTION_KEY] [PROJECT_FILE]', "Integrate Objc Obfuscator with the Xcode project PROJECT_FILE."
38
38
  long_desc <<-LONGDESC
39
39
  Obfuscate build phases will be added to the Xcode project and a Podfile augmented with
40
40
  the required library to decode such strings. It requires a valid cocoapods project.
41
+ The strings will be obfuscated using ENCRYPTION_KEY as the obfuscation key.
41
42
  LONGDESC
42
43
  option :podfile,
43
44
  :type => :string,
@@ -47,7 +48,7 @@ module Objc_Obfuscator
47
48
  :type => :string,
48
49
  :default => '',
49
50
  :desc => 'Xcode project containing the "compile source" build phase. Default: the first target on the list.'
50
- def integrate(project_path)
51
+ def integrate(encryption_key, project_path)
51
52
  raise Thor::Error, 'A valid project file should be specified' unless File.exist?(project_path)
52
53
 
53
54
  podfile_path = File.join File.dirname(project_path), './Podfile'
@@ -56,7 +57,7 @@ module Objc_Obfuscator
56
57
  end
57
58
  raise Thor::Error, 'The project must be using cocoapods' unless File.exist?(podfile_path)
58
59
 
59
- integrate_xcode project_path, podfile_path, options[:target]
60
+ integrate_xcode encryption_key, project_path, podfile_path, options[:target]
60
61
 
61
62
  end
62
63
 
@@ -3,7 +3,7 @@ require 'xcodeproj'
3
3
 
4
4
  module Objc_Obfuscator
5
5
  module Integrator
6
- def integrate_xcode(project_path, podfile_path, target_name)
6
+ def integrate_xcode(encryption_key, project_path, podfile_path, target_name)
7
7
  project = Xcodeproj::Project.open project_path
8
8
 
9
9
  main_target = project.targets.first
@@ -24,8 +24,8 @@ module Objc_Obfuscator
24
24
  rvm rvmrc trust
25
25
  rvm rvmrc load
26
26
  fi
27
- find ${SRCROOT} -name "*.h" -exec objc-obfuscator obfuscate {} \\;
28
- find ${SRCROOT} -name "*.m" -exec objc-obfuscator obfuscate {} \\;
27
+ find ${SRCROOT} -name "*.h" -exec objc-obfuscator obfuscate #{encryption_key} {} \\;
28
+ find ${SRCROOT} -name "*.m" -exec objc-obfuscator obfuscate #{encryption_key} {} \\;
29
29
  SCRIPT
30
30
 
31
31
  phase_unobf = project.new('PBXShellScriptBuildPhase')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: objc-obfuscator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Gallonetto