class Fastlane::Actions::ModifyIntentSchemeAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/androidmanifest_editor/actions/modify_intent_scheme.rb, line 37
def self.authors
  ["任福新"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/androidmanifest_editor/actions/modify_intent_scheme.rb, line 20
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :manifest_file,
                         description: "Path of AndroidManifest.xml",
                            optional: false,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :scheme,
                         description: "scheme",
                            optional: false,
                                type: String)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/androidmanifest_editor/actions/modify_intent_scheme.rb, line 33
def self.description
  "edit scheme data of intent-filter in AndroidManifest.xml"
end
details() click to toggle source
# File lib/fastlane/plugin/androidmanifest_editor/actions/modify_intent_scheme.rb, line 45
def self.details
  "edit scheme data of intent-filter of application section in AndroidManifest.xml"
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/androidmanifest_editor/actions/modify_intent_scheme.rb, line 49
def self.is_supported?(platform)
  [:android].include?(platform)
end
return_value() click to toggle source
# File lib/fastlane/plugin/androidmanifest_editor/actions/modify_intent_scheme.rb, line 41
def self.return_value
  # If your method provides a return value, you can describe here what it does
end
run(params) click to toggle source
# File lib/fastlane/plugin/androidmanifest_editor/actions/modify_intent_scheme.rb, line 4
def self.run(params)
  manifest_file = params[:manifest_file]
  scheme = params[:scheme]

  require 'nokogiri'
  doc = File.open(manifest_file) { |f|
    @doc = Nokogiri::XML(f)

    @doc.css("intent-filter data").each do |response_node|
      response_node["android:scheme"] = scheme
    end
    
    File.write(manifest_file, @doc.to_xml)
  }
end