mysigner 0.1.2 → 0.1.4

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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.githooks/pre-commit +15 -0
  3. data/.githooks/pre-push +21 -0
  4. data/.github/workflows/ci.yml +29 -0
  5. data/.gitignore +4 -0
  6. data/.rubocop.yml +55 -0
  7. data/.rubocop_todo.yml +126 -0
  8. data/CHANGELOG.md +96 -0
  9. data/Gemfile +5 -3
  10. data/Gemfile.lock +38 -8
  11. data/README.md +14 -16
  12. data/Rakefile +5 -3
  13. data/bin/console +4 -3
  14. data/bin/setup +3 -0
  15. data/certificate_.cer +0 -0
  16. data/exe/mysigner +19 -2
  17. data/iOS_App_Store_Profile.mobileprovision +1 -0
  18. data/iOS_Distribution_Certificate.cer +1 -0
  19. data/lib/mysigner/build/android_executor.rb +83 -63
  20. data/lib/mysigner/build/android_parser.rb +33 -40
  21. data/lib/mysigner/build/configurator.rb +17 -16
  22. data/lib/mysigner/build/detector.rb +39 -50
  23. data/lib/mysigner/build/error_analyzer.rb +70 -68
  24. data/lib/mysigner/build/executor.rb +30 -37
  25. data/lib/mysigner/build/parser.rb +18 -18
  26. data/lib/mysigner/cleanup/private_keys_purger.rb +41 -0
  27. data/lib/mysigner/cli/auth_commands.rb +771 -764
  28. data/lib/mysigner/cli/build_commands.rb +962 -796
  29. data/lib/mysigner/cli/concerns/actionable_suggestions.rb +208 -154
  30. data/lib/mysigner/cli/concerns/api_helpers.rb +46 -54
  31. data/lib/mysigner/cli/concerns/error_handlers.rb +247 -237
  32. data/lib/mysigner/cli/concerns/helpers.rb +44 -1
  33. data/lib/mysigner/cli/diagnostic_commands.rb +667 -636
  34. data/lib/mysigner/cli/resource_commands.rb +1153 -985
  35. data/lib/mysigner/cli/validate_commands.rb +25 -25
  36. data/lib/mysigner/cli.rb +11 -1
  37. data/lib/mysigner/client.rb +27 -19
  38. data/lib/mysigner/config.rb +161 -60
  39. data/lib/mysigner/export/exporter.rb +38 -37
  40. data/lib/mysigner/signing/certificate_checker.rb +18 -23
  41. data/lib/mysigner/signing/gradle_signing_injector.rb +67 -0
  42. data/lib/mysigner/signing/keystore_manager.rb +81 -61
  43. data/lib/mysigner/signing/validator.rb +38 -40
  44. data/lib/mysigner/signing/wizard.rb +329 -342
  45. data/lib/mysigner/upload/app_store_automation.rb +96 -49
  46. data/lib/mysigner/upload/app_store_submission.rb +87 -92
  47. data/lib/mysigner/upload/asc_rest_uploader.rb +119 -0
  48. data/lib/mysigner/upload/play_store_uploader.rb +164 -144
  49. data/lib/mysigner/upload/uploader.rb +136 -115
  50. data/lib/mysigner/version.rb +3 -1
  51. data/lib/mysigner.rb +13 -11
  52. data/mysigner.gemspec +36 -33
  53. data/profile_.mobileprovision +0 -0
  54. data/test_manual.rb +37 -36
  55. metadata +44 -17
  56. data/.DS_Store +0 -0
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Mysigner
2
4
  class CLI < Thor
3
5
  module Concerns
@@ -8,15 +10,13 @@ module Mysigner
8
10
  # 1. Environment variable
9
11
  # 2. Check if localhost is running
10
12
  # 3. Production default
11
-
13
+
12
14
  return ENV['MYSIGNER_API_URL'] if ENV['MYSIGNER_API_URL']
13
-
15
+
14
16
  # Check if localhost:3000 is accessible
15
17
  localhost_url = 'http://localhost:3000'
16
- if localhost_accessible?(localhost_url)
17
- return localhost_url
18
- end
19
-
18
+ return localhost_url if localhost_accessible?(localhost_url)
19
+
20
20
  # Default to production
21
21
  'https://mysigner.dev'
22
22
  end
@@ -24,7 +24,7 @@ module Mysigner
24
24
  def localhost_accessible?(url)
25
25
  require 'net/http'
26
26
  require 'uri'
27
-
27
+
28
28
  begin
29
29
  uri = URI.parse(url)
30
30
  http = Net::HTTP.new(uri.host, uri.port)
@@ -33,7 +33,7 @@ module Mysigner
33
33
  request = Net::HTTP::Get.new('/up')
34
34
  response = http.request(request)
35
35
  response.code == '200'
36
- rescue
36
+ rescue StandardError
37
37
  false
38
38
  end
39
39
  end
@@ -42,78 +42,70 @@ module Mysigner
42
42
  def prompt_api_url
43
43
  default = default_api_url
44
44
  say "API URL: #{default}", :cyan
45
-
45
+
46
46
  loop do
47
- custom = ask("Press Enter to use default, or type custom URL:", default: "")
48
-
47
+ custom = ask('Press Enter to use default, or type custom URL:', default: '')
48
+
49
49
  # Use default if empty or nil
50
- if custom.nil? || custom.empty?
51
- return default
52
- end
53
-
50
+ return default if custom.nil? || custom.empty?
51
+
54
52
  # Validate and normalize the custom URL
55
53
  normalized_url = normalize_api_url(custom.strip)
56
-
57
- if valid_api_url?(normalized_url)
58
- return normalized_url
59
- else
60
- error "Invalid URL format"
61
- say "Please enter a valid URL (e.g., http://localhost:3000 or https://api.example.com)", :yellow
62
- say ""
63
- end
54
+
55
+ return normalized_url if valid_api_url?(normalized_url)
56
+
57
+ error 'Invalid URL format'
58
+ say 'Please enter a valid URL (e.g., http://localhost:3000 or https://api.example.com)', :yellow
59
+ say ''
64
60
  end
65
61
  end
66
62
 
67
63
  # Normalize API URL (add protocol, remove trailing slash)
68
64
  def normalize_api_url(url)
69
65
  # Add http:// if no protocol specified
70
- url = "http://#{url}" unless url.match?(/^https?:\/\//)
71
-
66
+ url = "http://#{url}" unless url.match?(%r{^https?://})
67
+
72
68
  # Remove trailing slash
73
- url = url.chomp('/')
74
-
75
- url
69
+ url.chomp('/')
76
70
  end
77
71
 
78
72
  # Validate API URL format
79
73
  def valid_api_url?(url)
80
- begin
81
- uri = URI.parse(url)
82
-
83
- # Must have http or https scheme
84
- return false unless uri.scheme.to_s.match?(/^https?$/)
85
-
86
- # Must have a host
87
- return false if uri.host.nil? || uri.host.empty?
88
-
89
- # Valid formats:
90
- # - http://localhost:3000
91
- # - https://api.example.com
92
- # - http://192.168.1.1:8080
93
- true
94
- rescue URI::InvalidURIError
95
- false
96
- end
74
+ uri = URI.parse(url)
75
+
76
+ # Must have http or https scheme
77
+ return false unless uri.scheme.to_s.match?(/^https?$/)
78
+
79
+ # Must have a host
80
+ return false if uri.host.nil? || uri.host.empty?
81
+
82
+ # Valid formats:
83
+ # - http://localhost:3000
84
+ # - https://api.example.com
85
+ # - http://192.168.1.1:8080
86
+ true
87
+ rescue URI::InvalidURIError
88
+ false
97
89
  end
98
90
 
99
91
  # Prompt for user email with validation
100
92
  def prompt_for_email
101
93
  loop do
102
- email = ask("Your Email:").to_s.strip
103
-
94
+ email = ask('Your Email:').to_s.strip
95
+
104
96
  if email.empty?
105
- error "Email cannot be empty"
106
- say ""
97
+ error 'Email cannot be empty'
98
+ say ''
107
99
  next
108
100
  end
109
-
101
+
110
102
  unless valid_email?(email)
111
- error "Invalid email format"
112
- say "Please enter a valid email address (e.g., user@example.com)", :yellow
113
- say ""
103
+ error 'Invalid email format'
104
+ say 'Please enter a valid email address (e.g., user@example.com)', :yellow
105
+ say ''
114
106
  next
115
107
  end
116
-
108
+
117
109
  return email
118
110
  end
119
111
  end