fastlane-plugin-shake_bugs 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +70 -0
- data/lib/fastlane/plugin/shake_bugs/actions/internal/shake_bugs_upload_file_action.rb +46 -0
- data/lib/fastlane/plugin/shake_bugs/actions/shake_bugs_upload_dsym_action.rb +86 -0
- data/lib/fastlane/plugin/shake_bugs/actions/shake_bugs_upload_proguard_mapping_action.rb +86 -0
- data/lib/fastlane/plugin/shake_bugs/helper/android_helper.rb +32 -0
- data/lib/fastlane/plugin/shake_bugs/helper/ios_helper.rb +30 -0
- data/lib/fastlane/plugin/shake_bugs/helper/message_helper.rb +39 -0
- data/lib/fastlane/plugin/shake_bugs/helper/object_helper.rb +17 -0
- data/lib/fastlane/plugin/shake_bugs/helper/upload_helper.rb +59 -0
- data/lib/fastlane/plugin/shake_bugs/version.rb +5 -0
- data/lib/fastlane/plugin/shake_bugs.rb +16 -0
- metadata +195 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 583a0b625154e68e5ac13899d93e47be9e81fcdd4cec2f9e51d6fb43923f6473
|
4
|
+
data.tar.gz: 620facaf729186a35dad5894d416f288b34ada4318eef09e8ff48f12f4236895
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6e1d9178f9b781498351a695c53a02b322d00896bf7f500526fe1415a73c378d6209b1dd36f07bb6feb7755ddac7f125255fbc32bb629505814d1f80d40bd31e
|
7
|
+
data.tar.gz: 8c0a73cef5bfd06dc0ae99818135f27c9ff5af36652133e7762ba70037ed068884fa472f34513f9a48cfa1413411ef0e22cf7d48067b680785a8dabaea99b4fc
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2022 Doruk Kangal <dorukkangal@gmail.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# shake_bugs plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-shake_bugs)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-shake_bugs`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin shake_bugs
|
11
|
+
```
|
12
|
+
|
13
|
+
## About shake_bugs
|
14
|
+
|
15
|
+
Upload deobfuscation files for Android and symbolication files for iOS to Shake
|
16
|
+
|
17
|
+
### Uploading Proguard Mapping File
|
18
|
+
```ruby
|
19
|
+
shake_bugs_upload_proguard_mapping(
|
20
|
+
client_id: '...',
|
21
|
+
client_secret: '...',
|
22
|
+
application_id: '...', # Do not use if using apk
|
23
|
+
version_name: '...', # Do not use if using apk
|
24
|
+
version_code: '...', # Do not use if using apk
|
25
|
+
mapping_file: 'path to mapping.txt to upload',
|
26
|
+
apk: 'path to built apk file to upload'
|
27
|
+
)
|
28
|
+
```
|
29
|
+
|
30
|
+
### Uploading Dsym File
|
31
|
+
```ruby
|
32
|
+
shake_bugs_upload_dsym(
|
33
|
+
client_id: '...',
|
34
|
+
client_secret: '...',
|
35
|
+
bundle_id: '...', # Do not use if using ipa
|
36
|
+
version_number: '...', # Do not use if using ipa
|
37
|
+
build_number: '...', # Do not use if using ipa
|
38
|
+
dsym_file: 'path to YourApp.app.dSYM.zip to upload',
|
39
|
+
ipa: 'path to built ipa file to upload'
|
40
|
+
)
|
41
|
+
```
|
42
|
+
|
43
|
+
## Run tests for this plugin
|
44
|
+
|
45
|
+
To run both the tests, and code style validation, run
|
46
|
+
|
47
|
+
```
|
48
|
+
rake
|
49
|
+
```
|
50
|
+
|
51
|
+
To automatically fix many of the styling issues, use
|
52
|
+
```
|
53
|
+
rubocop -a
|
54
|
+
```
|
55
|
+
|
56
|
+
## Issues and Feedback
|
57
|
+
|
58
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
59
|
+
|
60
|
+
## Troubleshooting
|
61
|
+
|
62
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
63
|
+
|
64
|
+
## Using _fastlane_ Plugins
|
65
|
+
|
66
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
67
|
+
|
68
|
+
## About _fastlane_
|
69
|
+
|
70
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../../helper/upload_helper'
|
3
|
+
require_relative '../../helper/object_helper'
|
4
|
+
require_relative '../../helper/message_helper'
|
5
|
+
|
6
|
+
module Fastlane
|
7
|
+
module Actions
|
8
|
+
class ShakeBugsUploadFileAction < Action
|
9
|
+
def self.run(options)
|
10
|
+
@access_token = Helper::UploadHelper.get_access_token(
|
11
|
+
client_id: options[:client_id],
|
12
|
+
client_secret: options[:client_secret]
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.available_options
|
17
|
+
[
|
18
|
+
FastlaneCore::ConfigItem.new(key: :client_id,
|
19
|
+
env_name: 'SHAKE_CLIENT_ID',
|
20
|
+
description: 'The actual client id you have in your workspace settings',
|
21
|
+
optional: false,
|
22
|
+
type: String,
|
23
|
+
verify_block: proc do |value|
|
24
|
+
UI.user_error!(Message::MISSING_CLIENT_ID) unless Helper::ObjectHelper.present?(value)
|
25
|
+
end),
|
26
|
+
FastlaneCore::ConfigItem.new(key: :client_secret,
|
27
|
+
env_name: 'SHAKE_CLIENT_SECRET',
|
28
|
+
description: 'The actual client secret you have in your workspace settings',
|
29
|
+
optional: false,
|
30
|
+
type: String,
|
31
|
+
verify_block: proc do |value|
|
32
|
+
UI.user_error!(Message::MISSING_CLIENT_SECRET) unless Helper::ObjectHelper.present?(value)
|
33
|
+
end)
|
34
|
+
] + other_options
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.other_options
|
38
|
+
[]
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.authors
|
42
|
+
['Doruk Kangal']
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative 'internal/shake_bugs_upload_file_action'
|
3
|
+
require_relative '../helper/ios_helper'
|
4
|
+
require_relative '../helper/upload_helper'
|
5
|
+
require_relative '../helper/object_helper'
|
6
|
+
require_relative '../helper/message_helper'
|
7
|
+
|
8
|
+
module Fastlane
|
9
|
+
module Actions
|
10
|
+
class ShakeBugsUploadDsymAction < ShakeBugsUploadFileAction
|
11
|
+
def self.run(options)
|
12
|
+
super
|
13
|
+
|
14
|
+
dsym_file = options[:dsym_file]
|
15
|
+
UI.user_error!(Message.dsym_not_found(dsym_file)) if Helper::ObjectHelper.present?(dsym_file) && !Helper::ObjectHelper.exist?(dsym_file)
|
16
|
+
|
17
|
+
dsym_file = Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] unless Helper::ObjectHelper.present?(dsym_file)
|
18
|
+
UI.user_error!(Message::MISSING_DSYM_FILE) unless Helper::ObjectHelper.exist?(dsym_file)
|
19
|
+
|
20
|
+
ipa = options[:ipa]
|
21
|
+
UI.user_error!(Message.ipa_not_found(ipa)) if Helper::ObjectHelper.present?(ipa) && !Helper::ObjectHelper.exist?(ipa)
|
22
|
+
ipa = Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] unless Helper::ObjectHelper.exist?(ipa)
|
23
|
+
|
24
|
+
bundle_id = options[:bundle_id] || Helper::IosHelper.bundle_id(ipa)
|
25
|
+
UI.user_error!(Message::MISSING_BUNDLE_ID) unless Helper::ObjectHelper.present?(bundle_id)
|
26
|
+
|
27
|
+
version_number = options[:version_number] || Helper::IosHelper.version_number(ipa)
|
28
|
+
UI.user_error!(Message::MISSING_VERSION_NUMBER) unless Helper::ObjectHelper.present?(version_number)
|
29
|
+
|
30
|
+
build_number = options[:build_number] || Helper::IosHelper.build_number(ipa)
|
31
|
+
UI.user_error!(Message::MISSING_BUILD_NUMBER) unless Helper::ObjectHelper.present?(build_number)
|
32
|
+
|
33
|
+
Helper::UploadHelper.upload_mapping_file(
|
34
|
+
access_token: @access_token,
|
35
|
+
mapping_file: dsym_file,
|
36
|
+
application_id: bundle_id,
|
37
|
+
version_name: version_number,
|
38
|
+
version_code: build_number,
|
39
|
+
platform: 'iOS'
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.other_options
|
44
|
+
[
|
45
|
+
FastlaneCore::ConfigItem.new(key: :dsym_file,
|
46
|
+
env_name: 'IOS_DSYM_PATH',
|
47
|
+
description: 'The path to the dsym file to upload',
|
48
|
+
optional: true,
|
49
|
+
type: String),
|
50
|
+
FastlaneCore::ConfigItem.new(key: :ipa,
|
51
|
+
env_name: 'IOS_IPA_PATH',
|
52
|
+
description: 'The path to the newly built ipa file',
|
53
|
+
optional: true,
|
54
|
+
type: String),
|
55
|
+
FastlaneCore::ConfigItem.new(key: :bundle_id,
|
56
|
+
env_name: 'IOS_BUNDLE_ID',
|
57
|
+
description: 'The bundle id of your app',
|
58
|
+
optional: true,
|
59
|
+
type: String),
|
60
|
+
FastlaneCore::ConfigItem.new(key: :version_number,
|
61
|
+
env_name: 'IOS_VERSION_NUMBER',
|
62
|
+
description: 'The current version number set on your project',
|
63
|
+
optional: true,
|
64
|
+
type: String),
|
65
|
+
FastlaneCore::ConfigItem.new(key: :build_number,
|
66
|
+
env_name: 'IOS_BUILD_NUMBER',
|
67
|
+
description: 'The current build number set on your project',
|
68
|
+
optional: true,
|
69
|
+
type: String)
|
70
|
+
]
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.is_supported?(platform)
|
74
|
+
platform == :ios
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.description
|
78
|
+
'Upload dsym files for iOS to Shake'
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.details
|
82
|
+
'This action is used to upload symbolication files to Shake'
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative 'internal/shake_bugs_upload_file_action'
|
3
|
+
require_relative '../helper/android_helper'
|
4
|
+
require_relative '../helper/upload_helper'
|
5
|
+
require_relative '../helper/object_helper'
|
6
|
+
require_relative '../helper/message_helper'
|
7
|
+
|
8
|
+
module Fastlane
|
9
|
+
module Actions
|
10
|
+
class ShakeBugsUploadProguardMappingAction < ShakeBugsUploadFileAction
|
11
|
+
def self.run(options)
|
12
|
+
super
|
13
|
+
|
14
|
+
mapping_file = options[:mapping_file]
|
15
|
+
UI.user_error!(Message.mapping_not_found(mapping_file)) if Helper::ObjectHelper.present?(mapping_file) && !Helper::ObjectHelper.exist?(mapping_file)
|
16
|
+
|
17
|
+
mapping_file = Actions.lane_context[SharedValues::GRADLE_MAPPING_TXT_OUTPUT_PATH] unless Helper::ObjectHelper.present?(mapping_file)
|
18
|
+
UI.user_error!(Message::MISSING_MAPPING_FILE) unless Helper::ObjectHelper.exist?(mapping_file)
|
19
|
+
|
20
|
+
apk = options[:apk]
|
21
|
+
UI.user_error!(Message.apk_not_found(apk)) if Helper::ObjectHelper.present?(apk) && !Helper::ObjectHelper.exist?(apk)
|
22
|
+
apk = Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] unless Helper::ObjectHelper.exist?(apk)
|
23
|
+
|
24
|
+
application_id = options[:application_id] || Helper::AndroidHelper.application_id(apk)
|
25
|
+
UI.user_error!(Message::MISSING_APPLICATION_ID) unless Helper::ObjectHelper.present?(application_id)
|
26
|
+
|
27
|
+
version_name = options[:version_name] || Helper::AndroidHelper.version_name(apk)
|
28
|
+
UI.user_error!(Message::MISSING_VERSION_NAME) unless Helper::ObjectHelper.present?(version_name)
|
29
|
+
|
30
|
+
version_code = options[:version_code] || Helper::AndroidHelper.version_code(apk)
|
31
|
+
UI.user_error!(Message::MISSING_VERSION_CODE) unless Helper::ObjectHelper.present?(version_code)
|
32
|
+
|
33
|
+
Helper::UploadHelper.upload_mapping_file(
|
34
|
+
access_token: @access_token,
|
35
|
+
mapping_file: mapping_file,
|
36
|
+
application_id: application_id,
|
37
|
+
version_name: version_name,
|
38
|
+
version_code: version_code,
|
39
|
+
platform: 'Android'
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.other_options
|
44
|
+
[
|
45
|
+
FastlaneCore::ConfigItem.new(key: :mapping_file,
|
46
|
+
env_name: 'ANDROID_MAPPING_TXT_PATH',
|
47
|
+
description: 'The path to the mapping.txt file to upload',
|
48
|
+
optional: true,
|
49
|
+
type: String),
|
50
|
+
FastlaneCore::ConfigItem.new(key: :apk,
|
51
|
+
env_name: 'ANDROID_APK_PATH',
|
52
|
+
description: 'The path to the newly built apk file',
|
53
|
+
optional: true,
|
54
|
+
type: String),
|
55
|
+
FastlaneCore::ConfigItem.new(key: :application_id,
|
56
|
+
env_name: 'ANDROID_APPLICATION_ID',
|
57
|
+
description: 'The application id of your app',
|
58
|
+
optional: true,
|
59
|
+
type: String),
|
60
|
+
FastlaneCore::ConfigItem.new(key: :version_name,
|
61
|
+
env_name: 'ANDROID_VERSION_NAME',
|
62
|
+
description: 'The current version name set on your project',
|
63
|
+
optional: true,
|
64
|
+
type: String),
|
65
|
+
FastlaneCore::ConfigItem.new(key: :version_code,
|
66
|
+
env_name: 'ANDROID_VERSION_CODE',
|
67
|
+
description: 'The current version code set on your project',
|
68
|
+
optional: true,
|
69
|
+
type: String)
|
70
|
+
]
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.is_supported?(platform)
|
74
|
+
platform == :android
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.description
|
78
|
+
'Upload mapping files for Android to Shake'
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.details
|
82
|
+
'This action is used to upload de-obfuscation files to Shake'
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative 'object_helper'
|
2
|
+
require_relative 'message_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Helper
|
6
|
+
class AndroidHelper
|
7
|
+
def self.application_id(apk)
|
8
|
+
analyze_apk(apk, 'application-id')
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.version_name(apk)
|
12
|
+
analyze_apk(apk, 'version-name')
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.version_code(apk)
|
16
|
+
analyze_apk(apk, 'version-code')
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.analyze_apk(apk, info_name)
|
20
|
+
UI.user_error!(Message::ANDROID_HOME_NOT_SET) unless Helper::ObjectHelper.exist?(ENV['ANDROID_HOME'])
|
21
|
+
|
22
|
+
if !ObjectHelper.exist?(apk) || !ObjectHelper.present?(info_name)
|
23
|
+
return ''
|
24
|
+
end
|
25
|
+
|
26
|
+
result = `apkanalyzer manifest #{info_name} #{apk}`&.strip || ''
|
27
|
+
UI.message("Apk analyzer -> #{info_name} of the #{apk} is '#{result}'")
|
28
|
+
result
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'fastlane/actions/get_ipa_info_plist_value'
|
2
|
+
require_relative 'object_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Helper
|
6
|
+
class IosHelper
|
7
|
+
def self.bundle_id(ipa)
|
8
|
+
analyze_ipa(ipa, 'CFBundleIdentifier')
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.version_number(ipa)
|
12
|
+
analyze_ipa(ipa, 'CFBundleShortVersionString')
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.build_number(ipa)
|
16
|
+
analyze_ipa(ipa, 'CFBundleVersion')
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.analyze_ipa(ipa, info_name)
|
20
|
+
if !ObjectHelper.exist?(ipa) || !ObjectHelper.present?(info_name)
|
21
|
+
return ''
|
22
|
+
end
|
23
|
+
|
24
|
+
result = Actions::GetIpaInfoPlistValueAction.run(ipa: ipa, key: info_name)&.strip || ''
|
25
|
+
UI.message("Ipa analyzer -> #{info_name} of the #{ipa} is '#{result}'")
|
26
|
+
result
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Message
|
2
|
+
MISSING_CLIENT_ID = 'Client id must be specified'
|
3
|
+
MISSING_CLIENT_SECRET = 'Client secret must be specified'
|
4
|
+
|
5
|
+
MISSING_MAPPING_FILE = 'Could not find any mapping file generated by `gradle`'
|
6
|
+
MISSING_APPLICATION_ID = 'Application id must be specified or apk must be provided for extraction'
|
7
|
+
MISSING_VERSION_NAME = 'Version name must be specified or apk must be provided for extraction'
|
8
|
+
MISSING_VERSION_CODE = 'Version code must be specified or apk must be provided for extraction'
|
9
|
+
ANDROID_HOME_NOT_SET = 'ANDROID_HOME environment variable is not set'
|
10
|
+
|
11
|
+
MISSING_DSYM_FILE = 'Could not find any dSYM file generated by `gym`'
|
12
|
+
MISSING_BUNDLE_ID = 'Bundle id must be specified or ipa must be provided for extraction'
|
13
|
+
MISSING_VERSION_NUMBER = 'Version number must be specified or ipa must be provided for extraction'
|
14
|
+
MISSING_BUILD_NUMBER = 'Build number must be specified or ipa must be provided for extraction'
|
15
|
+
|
16
|
+
AUTHENTICATION_SUCCEEDED = 'Authenticated successfully'
|
17
|
+
AUTHENTICATION_FAILED = 'Please check your credentials'
|
18
|
+
UPLOAD_SUCCEEDED = 'Mapping file uploaded successfully'
|
19
|
+
|
20
|
+
def self.mapping_not_found(mapping_file)
|
21
|
+
"Could not find mapping file at path #{mapping_file}"
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.apk_not_found(apk)
|
25
|
+
"Could not find apk at path #{apk}"
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.dsym_not_found(dsym_file)
|
29
|
+
"Could not find dSYM file at path #{dsym_file}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.ipa_not_found(ipa)
|
33
|
+
"Could not find ipa at path #{ipa}"
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.upload_failed(error)
|
37
|
+
"Error while uploading mapping file: #{error}"
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class ObjectHelper
|
4
|
+
def self.present?(str)
|
5
|
+
!str.nil? && !str.strip.empty?
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.exist?(file_name)
|
9
|
+
present?(file_name) && File.exist?(file_name)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.version_code(apk)
|
13
|
+
analyze_apk(apk, 'version-code')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'faraday/multipart'
|
3
|
+
require 'signet'
|
4
|
+
require 'signet/oauth_2/client'
|
5
|
+
require_relative 'message_helper'
|
6
|
+
|
7
|
+
module Fastlane
|
8
|
+
module Helper
|
9
|
+
class UploadHelper
|
10
|
+
@api = 'https://api.shakebugs.com'
|
11
|
+
|
12
|
+
def self.get_access_token(client_id:, client_secret:)
|
13
|
+
client = Signet::OAuth2::Client.new(
|
14
|
+
token_credential_uri: "#{@api}/auth/oauth2/token",
|
15
|
+
client_id: client_id,
|
16
|
+
client_secret: client_secret
|
17
|
+
)
|
18
|
+
client.grant_type = 'client_credentials'
|
19
|
+
client.fetch_access_token!
|
20
|
+
UI.success(Message::AUTHENTICATION_SUCCEEDED)
|
21
|
+
client.access_token
|
22
|
+
rescue Signet::AuthorizationError => _e
|
23
|
+
UI.user_error!(Message::AUTHENTICATION_FAILED)
|
24
|
+
rescue StandardError => e
|
25
|
+
UI.user_error!("Unknown error: #{e}")
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.upload_mapping_file(access_token:, mapping_file:, application_id:, version_name:, version_code:, platform:)
|
29
|
+
UI.message("Mapping file uploading...")
|
30
|
+
UI.message("mapping_file:'#{mapping_file}'")
|
31
|
+
UI.message("application_id:'#{application_id}'")
|
32
|
+
UI.message("version_name:'#{version_name}'")
|
33
|
+
UI.message("version_code:'#{version_code}'")
|
34
|
+
|
35
|
+
@client = Faraday.new do |builder|
|
36
|
+
builder.use(Faraday::Response::RaiseError)
|
37
|
+
builder.request(:multipart)
|
38
|
+
builder.request(:url_encoded)
|
39
|
+
end
|
40
|
+
|
41
|
+
begin
|
42
|
+
@client.post("#{@api}/api/1.0/crash_reporting/app_debug_file/#{application_id}") do |request|
|
43
|
+
request.headers['Authorization'] = "Bearer #{access_token}"
|
44
|
+
request.body = {
|
45
|
+
file: Faraday::Multipart::FilePart.new(mapping_file, 'text/plain'),
|
46
|
+
app_version_name: version_name,
|
47
|
+
app_version_code: version_code,
|
48
|
+
os: platform,
|
49
|
+
platform: platform
|
50
|
+
}
|
51
|
+
end
|
52
|
+
UI.success(Message::UPLOAD_SUCCEEDED)
|
53
|
+
rescue StandardError => e
|
54
|
+
UI.user_error!(Message.upload_failed(e))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/shake_bugs/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module ShakeBugs
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::ShakeBugs.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,195 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-shake_bugs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Doruk Kangal
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-09-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: fastlane
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.210.1
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.210.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec_junit_formatter
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.12.1
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.12.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-performance
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-require_tools
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
description:
|
154
|
+
email: dorukkangal@gmail.com
|
155
|
+
executables: []
|
156
|
+
extensions: []
|
157
|
+
extra_rdoc_files: []
|
158
|
+
files:
|
159
|
+
- LICENSE
|
160
|
+
- README.md
|
161
|
+
- lib/fastlane/plugin/shake_bugs.rb
|
162
|
+
- lib/fastlane/plugin/shake_bugs/actions/internal/shake_bugs_upload_file_action.rb
|
163
|
+
- lib/fastlane/plugin/shake_bugs/actions/shake_bugs_upload_dsym_action.rb
|
164
|
+
- lib/fastlane/plugin/shake_bugs/actions/shake_bugs_upload_proguard_mapping_action.rb
|
165
|
+
- lib/fastlane/plugin/shake_bugs/helper/android_helper.rb
|
166
|
+
- lib/fastlane/plugin/shake_bugs/helper/ios_helper.rb
|
167
|
+
- lib/fastlane/plugin/shake_bugs/helper/message_helper.rb
|
168
|
+
- lib/fastlane/plugin/shake_bugs/helper/object_helper.rb
|
169
|
+
- lib/fastlane/plugin/shake_bugs/helper/upload_helper.rb
|
170
|
+
- lib/fastlane/plugin/shake_bugs/version.rb
|
171
|
+
homepage: https://github.com/dorukkangal/fastlane-plugin-shake_bugs
|
172
|
+
licenses:
|
173
|
+
- MIT
|
174
|
+
metadata: {}
|
175
|
+
post_install_message:
|
176
|
+
rdoc_options: []
|
177
|
+
require_paths:
|
178
|
+
- lib
|
179
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '2.6'
|
184
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
186
|
+
- - ">="
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
189
|
+
requirements: []
|
190
|
+
rubygems_version: 3.0.3.1
|
191
|
+
signing_key:
|
192
|
+
specification_version: 4
|
193
|
+
summary: Upload deobfuscation files for Android and symbolication files for iOS to
|
194
|
+
Shake
|
195
|
+
test_files: []
|