Class: Fastlane::Actions::AndroidChangeAppNameAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::AndroidChangeAppNameAction
- Defined in:
- lib/fastlane/plugin/android_change_app_name/actions/android_change_app_name_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
36 37 38 |
# File 'lib/fastlane/plugin/android_change_app_name/actions/android_change_app_name_action.rb', line 36 def self. ["MaximusMcCann"] end |
.available_options ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/fastlane/plugin/android_change_app_name/actions/android_change_app_name_action.rb', line 48 def self. [ FastlaneCore::ConfigItem.new(key: :newName, env_name: "", description: "The new name for the app", optional: true, type: String), FastlaneCore::ConfigItem.new(key: :manifest, env_name: "", description: "Optional custom location for AndroidManifest.xml", optional: false, type: String, default_value: "app/src/main/AndroidManifest.xml") ] end |
.description ⇒ Object
32 33 34 |
# File 'lib/fastlane/plugin/android_change_app_name/actions/android_change_app_name_action.rb', line 32 def self.description "Changes the manifest's label attribute (appName). Stores the original name for revertinng." end |
.details ⇒ Object
44 45 46 |
# File 'lib/fastlane/plugin/android_change_app_name/actions/android_change_app_name_action.rb', line 44 def self.details "Changes the apk manifest file's label attribute (appName). Stores the original label value for reverting later." end |
.is_supported?(platform) ⇒ Boolean
70 71 72 |
# File 'lib/fastlane/plugin/android_change_app_name/actions/android_change_app_name_action.rb', line 70 def self.is_supported?(platform) platform == :android end |
.output ⇒ Object
64 65 66 67 68 |
# File 'lib/fastlane/plugin/android_change_app_name/actions/android_change_app_name_action.rb', line 64 def self.output [ ['ANDROID_CHANGE_APP_NAME_ORIGINAL_NAME', 'The original app name.'] ] end |
.return_value ⇒ Object
40 41 42 |
# File 'lib/fastlane/plugin/android_change_app_name/actions/android_change_app_name_action.rb', line 40 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fastlane/plugin/android_change_app_name/actions/android_change_app_name_action.rb', line 7 def self.run(params) require 'nokogiri' newName = params[:newName] manifest = params[:manifest] doc = File.open(manifest) { |f| @doc = Nokogiri::XML(f) originalName = nil @doc.css("application").each do |response_node| originalName = response_node["android:label"] response_node["android:label"] = newName UI.("Updating app name to: #{newName}") end Actions.lane_context[SharedValues::ANDROID_CHANGE_APP_NAME_ORIGINAL_NAME] = originalName File.write(manifest, @doc.to_xml) } end |