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 +4 -4
- data/lib/objc-obfuscator/cli.rb +5 -4
- data/lib/objc-obfuscator/integrator.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98cb53b24c655e999b4787b3b263fcaa05eb4396
|
4
|
+
data.tar.gz: be44de23f63e6bc4e3a076b2c3ef5a6f4b70fc9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbd195a5b02a43e2480c9e9462dbd0ddff2d421b6dcd615bdf5aa77fe1219cd75b2726798e0e32549a124d63ca0d6b27130c6096a877b1020ab20257932fb4fe
|
7
|
+
data.tar.gz: 493e06e2f1029159993f9d657a2d004bc67ab09d8c8b1a8d371ae3fbc85eb14a7e53a085ee3882adf2cb151844e09dbec77225218756d1f05a1a2e365a1bb649
|
data/lib/objc-obfuscator/cli.rb
CHANGED
@@ -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
|
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
|
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')
|