Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
source 'https://rubygems.org'

gemspec
gem 'two_captcha'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval(File.read(plugins_path), binding) if File.exist?(plugins_path)
2 changes: 1 addition & 1 deletion fastlane-plugin-firebase.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'fastlane', '>= 2.5.0'
spec.add_dependency 'mechanize'
spec.add_dependency 'mechanize', '2.7.6'

end
54 changes: 39 additions & 15 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,57 @@ xcode-select --install
</tr>
</table>

# Available Actions
### test_list
### google_api_key_list_allowed_bundle_ids
```
fastlane test_list
google_api_key_list_allowed_bundle_ids(
project_number: "some:project-id",
api_key_id: "fd1d4e87-0ba5-4e2e-bacd-54d96b70befd",
type: 'ios',
username: ENV['GOOGLE_USERNAME'],
password: ENV['GOOGLE_PASSWORD'],
)
```

### test_add_client
```
fastlane test_add_client
google_api_key_list_allowed_bundle_ids(
project_number: "some:project-id",
api_key_id: "fd1d4e87-0ba5-4e2e-bacd-54d96b70befd",
type: 'android',
username: ENV['GOOGLE_USERNAME'],
password: ENV['GOOGLE_PASSWORD'],
)
```

### test_delete_client
### google_api_key_add_allowed_bundle_ids
```
fastlane test_delete_client
google_api_key_add_allowed_bundle_ids(
project_number: "some:project-id",
api_key_id: "fd1d4e87-0ba5-4e2e-bacd-54d96b70befd",
type: 'ios',
bundle_id: 'com.example.test',
username: ENV['GOOGLE_USERNAME'],
password: ENV['GOOGLE_PASSWORD'],
)
google_api_key_add_allowed_bundle_ids(
project_number: "some:project-id",
api_key_id: "fd1d4e87-0ba5-4e2e-bacd-54d96b70befd",
type: 'android',
bundle_id: 'com.example.test',
fingerprint: '2a:ae:6c:35:c9:4f:cf:b4:15:db:e9:5f:40:8b:9c:e9:1e:e8:46:ed',
username: ENV['GOOGLE_USERNAME'],
password: ENV['GOOGLE_PASSWORD'],
)
```

### test_upload_certificate
```
fastlane test_upload_certificate
```
### firebase_get_server_key

### test_download_config
```
fastlane test_download_config
firebase_get_server_key(
project_number: "project-name-or-number",
username: ENV['GOOGLE_USERNAME'],
password: ENV['GOOGLE_PASSWORD'],
)
```


----

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
module Fastlane
module Actions
class FirebaseAddAndroidCertificateAction < Action

def self.run(params)
manager = Firebase::Manager.new
#Login
api = manager.login(params[:username], params[:password])

#Select project
project = manager.select_project(params[:project_number])

# Client input
type = params[:type].to_sym

bundle_id = params[:bundle_id]
name = params[:name]
appstore_id = params[:appstore_id]
sha256 = params[:sha256]

begin
client = api.add_android_certificate(project["projectNumber"], bundle_id, sha256)
rescue Firebase::Api::BadRequestError => e
if e.message != 'Requested entity already exists' then
raise
end
end

UI.success "Successfuly added android certificate of app #{bundle_id}"
end

def self.description
"An unofficial tool to access Firebase"
end

def self.authors
["Tomas Kohout"]
end

def self.return_value
# If your method provides a return value, you can describe here what it does
end

def self.details
# Optional:
"Firebase helps you list your projects, create applications, download configuration files and more..."
end

def self.available_options
[
FastlaneCore::ConfigItem.new(key: :username,
env_name: "FIREBASE_USERNAME",
description: "Username for your google account",
optional: false),
FastlaneCore::ConfigItem.new(key: :password,
env_name: "FIREBASE_PASSWORD",
sensitive: true,
description: "Password to your firebase account",
optional: true),
FastlaneCore::ConfigItem.new(key: :project_number,
env_name: "FIREBASE_PROJECT_NUMBER",
description: "Project number",
optional: true),
FastlaneCore::ConfigItem.new(key: :download_config,
env_name: "FIREBASE_DOWNLOAD_CONFIG",
description: "Should download config for created client",
optional: false,
is_string: false,
default_value: true),
FastlaneCore::ConfigItem.new(key: :type,
env_name: "FIREBASE_TYPE",
description: "Type of client (ios, android)",
optional: true),
FastlaneCore::ConfigItem.new(key: :bundle_id,
env_name: "FIREBASE_BUNDLE_ID",
description: "Bundle ID (package name)",
optional: false),
FastlaneCore::ConfigItem.new(key: :name,
env_name: "FIREBASE_BUNDLE_ID",
description: "Display name",
optional: true),
FastlaneCore::ConfigItem.new(key: :appstore_id,
env_name: "FIREBASE_APPSTORE_ID",
description: "AppStore ID",
optional: true),
FastlaneCore::ConfigItem.new(key: :output_path,
env_name: "FIREBASE_OUTPUT_PATH",
description: "Path for the downloaded config",
optional: false,
default_value: "./"),
FastlaneCore::ConfigItem.new(key: :output_name,
env_name: "FIREBASE_OUTPUT_NAME",
description: "Name of the downloaded file",
optional: true),
FastlaneCore::ConfigItem.new(key: :sha256,
env_name: "FIREBASE_SHA_256",
description: "SHA256 for android",
optional: false)
]
end

def self.is_supported?(platform)
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
#
# [:ios, :mac, :android].include?(platform)
true
end
end
end
end
100 changes: 100 additions & 0 deletions lib/fastlane/plugin/firebase/actions/firebase_add_apple_store_id.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
module Fastlane
module Actions
class FirebaseAddAppleStoreIdAction < Action

def self.run(params)
manager = Firebase::Manager.new
#Login
api = manager.login(params[:username], params[:password])

#Select project
project = manager.select_project(params[:project_number])

# Client input
type = params[:type].to_sym

bundle_id = params[:bundle_id]
name = params[:name]
appstore_id = params[:appstore_id]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only realized know that we can pass the appstore_id as a param, so should remove the store_id variable


client = api.add_apple_store_id(project["projectNumber"], bundle_id, appstore_id)

UI.success "Successfuly added apple store id of app #{bundle_id}"
end

def self.description
"An unofficial tool to access Firebase"
end

def self.authors
["Tomas Kohout"]
end

def self.return_value
# If your method provides a return value, you can describe here what it does
end

def self.details
# Optional:
"Firebase helps you list your projects, create applications, download configuration files and more..."
end

def self.available_options
[
FastlaneCore::ConfigItem.new(key: :username,
env_name: "FIREBASE_USERNAME",
description: "Username for your google account",
optional: false),
FastlaneCore::ConfigItem.new(key: :password,
env_name: "FIREBASE_PASSWORD",
sensitive: true,
description: "Password to your firebase account",
optional: true),
FastlaneCore::ConfigItem.new(key: :project_number,
env_name: "FIREBASE_PROJECT_NUMBER",
description: "Project number",
optional: true),
FastlaneCore::ConfigItem.new(key: :download_config,
env_name: "FIREBASE_DOWNLOAD_CONFIG",
description: "Should download config for created client",
optional: false,
is_string: false,
default_value: true),
FastlaneCore::ConfigItem.new(key: :type,
env_name: "FIREBASE_TYPE",
description: "Type of client (ios, android)",
optional: true),
FastlaneCore::ConfigItem.new(key: :bundle_id,
env_name: "FIREBASE_BUNDLE_ID",
description: "Bundle ID (package name)",
optional: false),
FastlaneCore::ConfigItem.new(key: :name,
env_name: "FIREBASE_BUNDLE_ID",
description: "Display name",
optional: true),
FastlaneCore::ConfigItem.new(key: :appstore_id,
env_name: "FIREBASE_APPSTORE_ID",
description: "AppStore ID",
optional: false),
FastlaneCore::ConfigItem.new(key: :output_path,
env_name: "FIREBASE_OUTPUT_PATH",
description: "Path for the downloaded config",
optional: false,
default_value: "./"),
FastlaneCore::ConfigItem.new(key: :output_name,
env_name: "FIREBASE_OUTPUT_NAME",
description: "Name of the downloaded file",
optional: true)
]
end

def self.is_supported?(platform)
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
#
# [:ios, :mac, :android].include?(platform)
true
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class FirebaseAddClientAction < Action
def self.run(params)
manager = Firebase::Manager.new
#Login
api = manager.login(params[:username])
api = manager.login(params[:username], params[:password])

#Select project
project = manager.select_project(params[:project_number])
Expand Down Expand Up @@ -68,6 +68,11 @@ def self.available_options
env_name: "FIREBASE_USERNAME",
description: "Username for your google account",
optional: false),
FastlaneCore::ConfigItem.new(key: :password,
env_name: "FIREBASE_PASSWORD",
sensitive: true,
description: "Password to your firebase account",
optional: true),
FastlaneCore::ConfigItem.new(key: :project_number,
env_name: "FIREBASE_PROJECT_NUMBER",
description: "Project number",
Expand Down
Loading