fastlane-plugin-rename_android 1.0.4 → 1.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7f8ec4f9dd5fb13a3ed884f29d67d2a5ca04bd543e751fa54d0ed629dea80cb
4
- data.tar.gz: 0ca8eb3a8030974b85a8a171f06f9d10f9f47c78cef0cfb7d12f865f92b78033
3
+ metadata.gz: f4f8dd16cb6fe24cab8523efeb34b8e60e1cffcff2a4f2a16cadfac025553185
4
+ data.tar.gz: f4257ed943b4326671376fdf98b7afb83b3f0d02ed380a527ab62ca3830cea45
5
5
  SHA512:
6
- metadata.gz: 3edb40b9f52e10bcc27c7a92401aa0024779f78060556bf128580ebcf9a1ef0deb5bc84901654a25c90cfb09d35533bca35ba7756534469b7e2002b75131ff15
7
- data.tar.gz: fe0e56438b52e680e25c72a02fc0df68f98ab16c83ee43959e57b3e34be2e6bf85391148633857ec144a5708e11ee8c822e31e4d0fadc399c57774185712c98a
6
+ metadata.gz: cfb64c795dd67b6e9cb2ea5e98bd77fcfbcbb9c977f266e08231f0e02778f9c26f314f1f52ea3536c90a6122e7e0484f250706ad30a24196378ad0188fc4927d
7
+ data.tar.gz: a33f9f355e46e65a204696850f001a038796f00ae7cc455f6f921ecedd280effb11e87d14ce4864d3a8eb4f6e4fcea280d1ccfc6bafaa32f9407c11c9f948b68
data/README.md CHANGED
@@ -11,22 +11,42 @@ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To
11
11
  fastlane add_plugin rename_android
12
12
  ```
13
13
 
14
- ## About rename_android
14
+ ## Actions
15
15
 
16
- Renames Android package for .java, .kt, AndroidManifest.xml, and build.gradle files
16
+ ### rename_android
17
17
 
18
- ## Example
18
+ Renames the Android package name across `.java`, `.kt`, `AndroidManifest.xml`, and `build.gradle` files.
19
19
 
20
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
20
+ ```rb
21
+ rename_android(
22
+ path: "./",
23
+ package_name: "com.example.oldapp",
24
+ new_package_name: "com.example.newapp"
25
+ )
26
+ ```
27
+
28
+ | Parameter | Description | Required | Default |
29
+ |---|---|---|---|
30
+ | `path` | Path to the Android project root | Yes | |
31
+ | `package_name` | The current package name | Yes | |
32
+ | `new_package_name` | The new package name | Yes | |
33
+
34
+ ### rename_android_app_name
35
+
36
+ Changes the `android:label` attribute in the `AndroidManifest.xml` file. This is the display name of the app.
21
37
 
22
38
  ```rb
23
- rename_android(
24
- path: "./",
25
- package_name: "com.joshholtz.fastlane.app",
26
- new_package_name: "com.newjoshholtz.fastlane.app"
39
+ rename_android_app_name(
40
+ new_name: "My New App Name",
41
+ manifest: "app/src/main/AndroidManifest.xml"
27
42
  )
28
43
  ```
29
44
 
45
+ | Parameter | Description | Required | Default |
46
+ |---|---|---|---|
47
+ | `new_name` | The new display name for the app | No | |
48
+ | `manifest` | Path to the AndroidManifest.xml file | No | `app/src/main/AndroidManifest.xml` |
49
+
30
50
  ## Run tests for this plugin
31
51
 
32
52
  To run both the tests, and code style validation, run
@@ -0,0 +1,84 @@
1
+ # Originally based off of https://github.com/MaximusMcCann/fastlane-plugin-android_change_app_name
2
+ # Updated to use Ox XML parser instead of Nokogiri.
3
+ # Removed the reverting functionality.
4
+
5
+ require 'fastlane/action'
6
+ require 'fastlane_core/configuration/config_item'
7
+ require 'fastlane_core/ui/ui'
8
+
9
+ module Fastlane
10
+ module Actions
11
+ class RenameAndroidAppNameAction < Action
12
+ def self.run(params)
13
+ require 'ox'
14
+
15
+ new_name = params[:new_name]
16
+ manifest = params[:manifest]
17
+
18
+ xml = File.read(manifest)
19
+ doc = Ox.parse(xml)
20
+
21
+ find_elements(doc, 'application').each do |app_node|
22
+ app_node['android:label'] = new_name
23
+ FastlaneCore::UI.message("Updating app name to: #{new_name}")
24
+ end
25
+
26
+ File.write(manifest, Ox.dump(doc, indent: 2))
27
+ end
28
+
29
+ def self.find_elements(node, name)
30
+ results = []
31
+ return results unless node.respond_to?(:nodes)
32
+
33
+ node.nodes.each do |child|
34
+ next unless child.kind_of?(Ox::Element)
35
+
36
+ results << child if child.name == name
37
+ results.concat(find_elements(child, name))
38
+ end
39
+ results
40
+ end
41
+
42
+ def self.description
43
+ "Changes the manifest's label attribute (appName)."
44
+ end
45
+
46
+ def self.authors
47
+ ["Sourcetoad"]
48
+ end
49
+
50
+ def self.return_value
51
+ # If your method provides a return value, you can describe here what it does
52
+ end
53
+
54
+ def self.details
55
+ "Changes the apk manifest file's label attribute (appName)."
56
+ end
57
+
58
+ def self.available_options
59
+ [
60
+ FastlaneCore::ConfigItem.new(key: :new_name,
61
+ env_name: "FL_RENAME_ANDROID_PACKAGE_NEW_APP_NAME",
62
+ description: "The new name for the app",
63
+ optional: true,
64
+ type: String,
65
+ default_value: ""),
66
+ FastlaneCore::ConfigItem.new(key: :manifest,
67
+ env_name: "FL_RENAME_ANDROID_PACKAGE_ANDROID_MANIFEST_PATH",
68
+ description: "Optional custom location for AndroidManifest.xml",
69
+ optional: true,
70
+ type: String,
71
+ default_value: "app/src/main/AndroidManifest.xml")
72
+ ]
73
+ end
74
+
75
+ def self.output
76
+ []
77
+ end
78
+
79
+ def self.is_supported?(platform)
80
+ platform == :android
81
+ end
82
+ end
83
+ end
84
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module RenameAndroid
3
- VERSION = "1.0.4"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-rename_android
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Holtz
@@ -9,8 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-10-22 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2026-03-27 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: ox
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '2.14'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '2.14'
14
28
  description:
15
29
  email: info@sourcetoad.com
16
30
  executables: []
@@ -21,6 +35,7 @@ files:
21
35
  - README.md
22
36
  - lib/fastlane/plugin/rename_android.rb
23
37
  - lib/fastlane/plugin/rename_android/actions/rename_android_action.rb
38
+ - lib/fastlane/plugin/rename_android/actions/rename_android_app_name_action.rb
24
39
  - lib/fastlane/plugin/rename_android/version.rb
25
40
  homepage: https://github.com/sourcetoad/fastlane-plugin-rename_android
26
41
  licenses:
@@ -35,7 +50,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
35
50
  requirements:
36
51
  - - ">="
37
52
  - !ruby/object:Gem::Version
38
- version: '2.6'
53
+ version: '2.7'
39
54
  required_rubygems_version: !ruby/object:Gem::Requirement
40
55
  requirements:
41
56
  - - ">="